CMakeLists.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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(videorecog_public_header
  18. include/alibabacloud/videorecog/VideorecogClient.h
  19. include/alibabacloud/videorecog/VideorecogExport.h )
  20. set(videorecog_public_header_model
  21. include/alibabacloud/videorecog/model/DetectVideoShotRequest.h
  22. include/alibabacloud/videorecog/model/DetectVideoShotResult.h
  23. include/alibabacloud/videorecog/model/GenerateVideoCoverRequest.h
  24. include/alibabacloud/videorecog/model/GenerateVideoCoverResult.h
  25. include/alibabacloud/videorecog/model/GetAsyncJobResultRequest.h
  26. include/alibabacloud/videorecog/model/GetAsyncJobResultResult.h
  27. include/alibabacloud/videorecog/model/RecognizeVideoCastCrewListRequest.h
  28. include/alibabacloud/videorecog/model/RecognizeVideoCastCrewListResult.h
  29. include/alibabacloud/videorecog/model/SplitVideoPartsRequest.h
  30. include/alibabacloud/videorecog/model/SplitVideoPartsResult.h
  31. include/alibabacloud/videorecog/model/UnderstandVideoContentRequest.h
  32. include/alibabacloud/videorecog/model/UnderstandVideoContentResult.h )
  33. set(videorecog_src
  34. src/VideorecogClient.cc
  35. src/model/DetectVideoShotRequest.cc
  36. src/model/DetectVideoShotResult.cc
  37. src/model/GenerateVideoCoverRequest.cc
  38. src/model/GenerateVideoCoverResult.cc
  39. src/model/GetAsyncJobResultRequest.cc
  40. src/model/GetAsyncJobResultResult.cc
  41. src/model/RecognizeVideoCastCrewListRequest.cc
  42. src/model/RecognizeVideoCastCrewListResult.cc
  43. src/model/SplitVideoPartsRequest.cc
  44. src/model/SplitVideoPartsResult.cc
  45. src/model/UnderstandVideoContentRequest.cc
  46. src/model/UnderstandVideoContentResult.cc )
  47. add_library(videorecog ${LIB_TYPE}
  48. ${videorecog_public_header}
  49. ${videorecog_public_header_model}
  50. ${videorecog_src})
  51. set_target_properties(videorecog
  52. PROPERTIES
  53. LINKER_LANGUAGE CXX
  54. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  55. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  56. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  57. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}videorecog
  58. )
  59. if(${LIB_TYPE} STREQUAL "SHARED")
  60. set_target_properties(videorecog
  61. PROPERTIES
  62. DEFINE_SYMBOL ALIBABACLOUD_VIDEORECOG_LIBRARY)
  63. endif()
  64. target_include_directories(videorecog
  65. PRIVATE include
  66. ${CMAKE_SOURCE_DIR}/core/include
  67. )
  68. target_link_libraries(videorecog
  69. core)
  70. if(CMAKE_HOST_WIN32)
  71. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  72. set(jsoncpp_install_dir ${INSTALL_DIR})
  73. add_dependencies(videorecog
  74. jsoncpp)
  75. target_include_directories(videorecog
  76. PRIVATE ${jsoncpp_install_dir}/include)
  77. target_link_libraries(videorecog
  78. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  79. set_target_properties(videorecog
  80. PROPERTIES
  81. COMPILE_OPTIONS "/bigobj")
  82. else()
  83. target_include_directories(videorecog
  84. PRIVATE /usr/include/jsoncpp)
  85. target_link_libraries(videorecog
  86. jsoncpp)
  87. endif()
  88. install(FILES ${videorecog_public_header}
  89. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/videorecog)
  90. install(FILES ${videorecog_public_header_model}
  91. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/videorecog/model)
  92. install(TARGETS videorecog
  93. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  94. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  95. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  96. )