CMakeLists.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #
  2. # Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
  17. set(ocr_public_header
  18. include/alibabacloud/ocr/OcrClient.h
  19. include/alibabacloud/ocr/OcrExport.h )
  20. set(ocr_public_header_model
  21. include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h
  22. include/alibabacloud/ocr/model/GetAsyncJobResultResult.h
  23. include/alibabacloud/ocr/model/RecognizeBankCardRequest.h
  24. include/alibabacloud/ocr/model/RecognizeBankCardResult.h
  25. include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h
  26. include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h
  27. include/alibabacloud/ocr/model/RecognizeCharacterRequest.h
  28. include/alibabacloud/ocr/model/RecognizeCharacterResult.h
  29. include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h
  30. include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h
  31. include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h
  32. include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h
  33. include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h
  34. include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h
  35. include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h
  36. include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h
  37. include/alibabacloud/ocr/model/RecognizePdfRequest.h
  38. include/alibabacloud/ocr/model/RecognizePdfResult.h
  39. include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h
  40. include/alibabacloud/ocr/model/RecognizeQrCodeResult.h
  41. include/alibabacloud/ocr/model/RecognizeQuotaInvoiceRequest.h
  42. include/alibabacloud/ocr/model/RecognizeQuotaInvoiceResult.h
  43. include/alibabacloud/ocr/model/RecognizeTableRequest.h
  44. include/alibabacloud/ocr/model/RecognizeTableResult.h
  45. include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h
  46. include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h
  47. include/alibabacloud/ocr/model/RecognizeTicketInvoiceRequest.h
  48. include/alibabacloud/ocr/model/RecognizeTicketInvoiceResult.h
  49. include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h
  50. include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h
  51. include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h
  52. include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h
  53. include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h
  54. include/alibabacloud/ocr/model/RecognizeVINCodeResult.h
  55. include/alibabacloud/ocr/model/RecognizeVideoCharacterRequest.h
  56. include/alibabacloud/ocr/model/RecognizeVideoCharacterResult.h )
  57. set(ocr_src
  58. src/OcrClient.cc
  59. src/model/GetAsyncJobResultRequest.cc
  60. src/model/GetAsyncJobResultResult.cc
  61. src/model/RecognizeBankCardRequest.cc
  62. src/model/RecognizeBankCardResult.cc
  63. src/model/RecognizeBusinessLicenseRequest.cc
  64. src/model/RecognizeBusinessLicenseResult.cc
  65. src/model/RecognizeCharacterRequest.cc
  66. src/model/RecognizeCharacterResult.cc
  67. src/model/RecognizeDriverLicenseRequest.cc
  68. src/model/RecognizeDriverLicenseResult.cc
  69. src/model/RecognizeDrivingLicenseRequest.cc
  70. src/model/RecognizeDrivingLicenseResult.cc
  71. src/model/RecognizeIdentityCardRequest.cc
  72. src/model/RecognizeIdentityCardResult.cc
  73. src/model/RecognizeLicensePlateRequest.cc
  74. src/model/RecognizeLicensePlateResult.cc
  75. src/model/RecognizePdfRequest.cc
  76. src/model/RecognizePdfResult.cc
  77. src/model/RecognizeQrCodeRequest.cc
  78. src/model/RecognizeQrCodeResult.cc
  79. src/model/RecognizeQuotaInvoiceRequest.cc
  80. src/model/RecognizeQuotaInvoiceResult.cc
  81. src/model/RecognizeTableRequest.cc
  82. src/model/RecognizeTableResult.cc
  83. src/model/RecognizeTaxiInvoiceRequest.cc
  84. src/model/RecognizeTaxiInvoiceResult.cc
  85. src/model/RecognizeTicketInvoiceRequest.cc
  86. src/model/RecognizeTicketInvoiceResult.cc
  87. src/model/RecognizeTrainTicketRequest.cc
  88. src/model/RecognizeTrainTicketResult.cc
  89. src/model/RecognizeVATInvoiceRequest.cc
  90. src/model/RecognizeVATInvoiceResult.cc
  91. src/model/RecognizeVINCodeRequest.cc
  92. src/model/RecognizeVINCodeResult.cc
  93. src/model/RecognizeVideoCharacterRequest.cc
  94. src/model/RecognizeVideoCharacterResult.cc )
  95. add_library(ocr ${LIB_TYPE}
  96. ${ocr_public_header}
  97. ${ocr_public_header_model}
  98. ${ocr_src})
  99. set_target_properties(ocr
  100. PROPERTIES
  101. LINKER_LANGUAGE CXX
  102. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  103. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  104. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  105. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}ocr
  106. )
  107. if(${LIB_TYPE} STREQUAL "SHARED")
  108. set_target_properties(ocr
  109. PROPERTIES
  110. DEFINE_SYMBOL ALIBABACLOUD_OCR_LIBRARY)
  111. endif()
  112. target_include_directories(ocr
  113. PRIVATE include
  114. ${CMAKE_SOURCE_DIR}/core/include
  115. )
  116. target_link_libraries(ocr
  117. core)
  118. if(CMAKE_HOST_WIN32)
  119. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  120. set(jsoncpp_install_dir ${INSTALL_DIR})
  121. add_dependencies(ocr
  122. jsoncpp)
  123. target_include_directories(ocr
  124. PRIVATE ${jsoncpp_install_dir}/include)
  125. target_link_libraries(ocr
  126. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  127. set_target_properties(ocr
  128. PROPERTIES
  129. COMPILE_OPTIONS "/bigobj")
  130. else()
  131. target_include_directories(ocr
  132. PRIVATE /usr/include/jsoncpp)
  133. target_link_libraries(ocr
  134. jsoncpp)
  135. endif()
  136. install(FILES ${ocr_public_header}
  137. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr)
  138. install(FILES ${ocr_public_header_model}
  139. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr/model)
  140. install(TARGETS ocr
  141. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  142. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  143. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  144. )