CMakeLists.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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/RecognizeBusinessCardRequest.h
  26. include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h
  27. include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h
  28. include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h
  29. include/alibabacloud/ocr/model/RecognizeCharacterRequest.h
  30. include/alibabacloud/ocr/model/RecognizeCharacterResult.h
  31. include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h
  32. include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h
  33. include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h
  34. include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h
  35. include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h
  36. include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h
  37. include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h
  38. include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h
  39. include/alibabacloud/ocr/model/RecognizePdfRequest.h
  40. include/alibabacloud/ocr/model/RecognizePdfResult.h
  41. include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h
  42. include/alibabacloud/ocr/model/RecognizeQrCodeResult.h
  43. include/alibabacloud/ocr/model/RecognizeQuotaInvoiceRequest.h
  44. include/alibabacloud/ocr/model/RecognizeQuotaInvoiceResult.h
  45. include/alibabacloud/ocr/model/RecognizeStampRequest.h
  46. include/alibabacloud/ocr/model/RecognizeStampResult.h
  47. include/alibabacloud/ocr/model/RecognizeTableRequest.h
  48. include/alibabacloud/ocr/model/RecognizeTableResult.h
  49. include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h
  50. include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h
  51. include/alibabacloud/ocr/model/RecognizeTicketInvoiceRequest.h
  52. include/alibabacloud/ocr/model/RecognizeTicketInvoiceResult.h
  53. include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h
  54. include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h
  55. include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h
  56. include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h
  57. include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h
  58. include/alibabacloud/ocr/model/RecognizeVINCodeResult.h
  59. include/alibabacloud/ocr/model/RecognizeVideoCharacterRequest.h
  60. include/alibabacloud/ocr/model/RecognizeVideoCharacterResult.h )
  61. set(ocr_src
  62. src/OcrClient.cc
  63. src/model/GetAsyncJobResultRequest.cc
  64. src/model/GetAsyncJobResultResult.cc
  65. src/model/RecognizeBankCardRequest.cc
  66. src/model/RecognizeBankCardResult.cc
  67. src/model/RecognizeBusinessCardRequest.cc
  68. src/model/RecognizeBusinessCardResult.cc
  69. src/model/RecognizeBusinessLicenseRequest.cc
  70. src/model/RecognizeBusinessLicenseResult.cc
  71. src/model/RecognizeCharacterRequest.cc
  72. src/model/RecognizeCharacterResult.cc
  73. src/model/RecognizeDriverLicenseRequest.cc
  74. src/model/RecognizeDriverLicenseResult.cc
  75. src/model/RecognizeDrivingLicenseRequest.cc
  76. src/model/RecognizeDrivingLicenseResult.cc
  77. src/model/RecognizeIdentityCardRequest.cc
  78. src/model/RecognizeIdentityCardResult.cc
  79. src/model/RecognizeLicensePlateRequest.cc
  80. src/model/RecognizeLicensePlateResult.cc
  81. src/model/RecognizePdfRequest.cc
  82. src/model/RecognizePdfResult.cc
  83. src/model/RecognizeQrCodeRequest.cc
  84. src/model/RecognizeQrCodeResult.cc
  85. src/model/RecognizeQuotaInvoiceRequest.cc
  86. src/model/RecognizeQuotaInvoiceResult.cc
  87. src/model/RecognizeStampRequest.cc
  88. src/model/RecognizeStampResult.cc
  89. src/model/RecognizeTableRequest.cc
  90. src/model/RecognizeTableResult.cc
  91. src/model/RecognizeTaxiInvoiceRequest.cc
  92. src/model/RecognizeTaxiInvoiceResult.cc
  93. src/model/RecognizeTicketInvoiceRequest.cc
  94. src/model/RecognizeTicketInvoiceResult.cc
  95. src/model/RecognizeTrainTicketRequest.cc
  96. src/model/RecognizeTrainTicketResult.cc
  97. src/model/RecognizeVATInvoiceRequest.cc
  98. src/model/RecognizeVATInvoiceResult.cc
  99. src/model/RecognizeVINCodeRequest.cc
  100. src/model/RecognizeVINCodeResult.cc
  101. src/model/RecognizeVideoCharacterRequest.cc
  102. src/model/RecognizeVideoCharacterResult.cc )
  103. add_library(ocr ${LIB_TYPE}
  104. ${ocr_public_header}
  105. ${ocr_public_header_model}
  106. ${ocr_src})
  107. set_target_properties(ocr
  108. PROPERTIES
  109. LINKER_LANGUAGE CXX
  110. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  111. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  112. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  113. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}ocr
  114. )
  115. if(${LIB_TYPE} STREQUAL "SHARED")
  116. set_target_properties(ocr
  117. PROPERTIES
  118. DEFINE_SYMBOL ALIBABACLOUD_OCR_LIBRARY)
  119. endif()
  120. target_include_directories(ocr
  121. PRIVATE include
  122. ${CMAKE_SOURCE_DIR}/core/include
  123. )
  124. target_link_libraries(ocr
  125. core)
  126. if(CMAKE_HOST_WIN32)
  127. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  128. set(jsoncpp_install_dir ${INSTALL_DIR})
  129. add_dependencies(ocr
  130. jsoncpp)
  131. target_include_directories(ocr
  132. PRIVATE ${jsoncpp_install_dir}/include)
  133. target_link_libraries(ocr
  134. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  135. set_target_properties(ocr
  136. PROPERTIES
  137. COMPILE_OPTIONS "/bigobj")
  138. else()
  139. target_include_directories(ocr
  140. PRIVATE /usr/include/jsoncpp)
  141. target_link_libraries(ocr
  142. jsoncpp)
  143. endif()
  144. install(FILES ${ocr_public_header}
  145. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr)
  146. install(FILES ${ocr_public_header_model}
  147. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr/model)
  148. install(TARGETS ocr
  149. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  150. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  151. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  152. )