CMakeLists.txt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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(nlp-automl_public_header
  18. include/alibabacloud/nlp-automl/Nlp_automlClient.h
  19. include/alibabacloud/nlp-automl/Nlp_automlExport.h )
  20. set(nlp-automl_public_header_model
  21. include/alibabacloud/nlp-automl/model/CreateAsyncPredictRequest.h
  22. include/alibabacloud/nlp-automl/model/CreateAsyncPredictResult.h
  23. include/alibabacloud/nlp-automl/model/GetAsyncPredictRequest.h
  24. include/alibabacloud/nlp-automl/model/GetAsyncPredictResult.h
  25. include/alibabacloud/nlp-automl/model/GetPredictResultRequest.h
  26. include/alibabacloud/nlp-automl/model/GetPredictResultResult.h
  27. include/alibabacloud/nlp-automl/model/RunPreTrainServiceRequest.h
  28. include/alibabacloud/nlp-automl/model/RunPreTrainServiceResult.h )
  29. set(nlp-automl_src
  30. src/Nlp-automlClient.cc
  31. src/model/CreateAsyncPredictRequest.cc
  32. src/model/CreateAsyncPredictResult.cc
  33. src/model/GetAsyncPredictRequest.cc
  34. src/model/GetAsyncPredictResult.cc
  35. src/model/GetPredictResultRequest.cc
  36. src/model/GetPredictResultResult.cc
  37. src/model/RunPreTrainServiceRequest.cc
  38. src/model/RunPreTrainServiceResult.cc )
  39. add_library(nlp-automl ${LIB_TYPE}
  40. ${nlp-automl_public_header}
  41. ${nlp-automl_public_header_model}
  42. ${nlp-automl_src})
  43. set_target_properties(nlp-automl
  44. PROPERTIES
  45. LINKER_LANGUAGE CXX
  46. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  47. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  48. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  49. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}nlp-automl
  50. )
  51. if(${LIB_TYPE} STREQUAL "SHARED")
  52. set_target_properties(nlp-automl
  53. PROPERTIES
  54. DEFINE_SYMBOL ALIBABACLOUD_NLP_AUTOML_LIBRARY)
  55. endif()
  56. target_include_directories(nlp-automl
  57. PRIVATE include
  58. ${CMAKE_SOURCE_DIR}/core/include
  59. )
  60. target_link_libraries(nlp-automl
  61. core)
  62. if(CMAKE_HOST_WIN32)
  63. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  64. set(jsoncpp_install_dir ${INSTALL_DIR})
  65. add_dependencies(nlp-automl
  66. jsoncpp)
  67. target_include_directories(nlp-automl
  68. PRIVATE ${jsoncpp_install_dir}/include)
  69. target_link_libraries(nlp-automl
  70. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  71. set_target_properties(nlp-automl
  72. PROPERTIES
  73. COMPILE_OPTIONS "/bigobj")
  74. else()
  75. target_include_directories(nlp-automl
  76. PRIVATE /usr/include/jsoncpp)
  77. target_link_libraries(nlp-automl
  78. jsoncpp)
  79. endif()
  80. install(FILES ${nlp-automl_public_header}
  81. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/nlp-automl)
  82. install(FILES ${nlp-automl_public_header_model}
  83. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/nlp-automl/model)
  84. install(TARGETS nlp-automl
  85. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  86. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  87. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  88. )