CMakeLists.txt 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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(computenest_public_header
  18. include/alibabacloud/computenest/ComputeNestClient.h
  19. include/alibabacloud/computenest/ComputeNestExport.h )
  20. set(computenest_public_header_model
  21. include/alibabacloud/computenest/model/ChangeResourceGroupRequest.h
  22. include/alibabacloud/computenest/model/ChangeResourceGroupResult.h
  23. include/alibabacloud/computenest/model/ContinueDeployServiceInstanceRequest.h
  24. include/alibabacloud/computenest/model/ContinueDeployServiceInstanceResult.h
  25. include/alibabacloud/computenest/model/CreateServiceInstanceRequest.h
  26. include/alibabacloud/computenest/model/CreateServiceInstanceResult.h
  27. include/alibabacloud/computenest/model/DeleteServiceInstancesRequest.h
  28. include/alibabacloud/computenest/model/DeleteServiceInstancesResult.h
  29. include/alibabacloud/computenest/model/GetServiceInstanceRequest.h
  30. include/alibabacloud/computenest/model/GetServiceInstanceResult.h
  31. include/alibabacloud/computenest/model/GetServiceTemplateParameterConstraintsRequest.h
  32. include/alibabacloud/computenest/model/GetServiceTemplateParameterConstraintsResult.h
  33. include/alibabacloud/computenest/model/ListServiceInstanceLogsRequest.h
  34. include/alibabacloud/computenest/model/ListServiceInstanceLogsResult.h
  35. include/alibabacloud/computenest/model/ListServiceInstanceResourcesRequest.h
  36. include/alibabacloud/computenest/model/ListServiceInstanceResourcesResult.h
  37. include/alibabacloud/computenest/model/ListServiceInstancesRequest.h
  38. include/alibabacloud/computenest/model/ListServiceInstancesResult.h
  39. include/alibabacloud/computenest/model/RestartServiceInstanceRequest.h
  40. include/alibabacloud/computenest/model/RestartServiceInstanceResult.h
  41. include/alibabacloud/computenest/model/StartServiceInstanceRequest.h
  42. include/alibabacloud/computenest/model/StartServiceInstanceResult.h
  43. include/alibabacloud/computenest/model/StopServiceInstanceRequest.h
  44. include/alibabacloud/computenest/model/StopServiceInstanceResult.h )
  45. set(computenest_src
  46. src/ComputeNestClient.cc
  47. src/model/ChangeResourceGroupRequest.cc
  48. src/model/ChangeResourceGroupResult.cc
  49. src/model/ContinueDeployServiceInstanceRequest.cc
  50. src/model/ContinueDeployServiceInstanceResult.cc
  51. src/model/CreateServiceInstanceRequest.cc
  52. src/model/CreateServiceInstanceResult.cc
  53. src/model/DeleteServiceInstancesRequest.cc
  54. src/model/DeleteServiceInstancesResult.cc
  55. src/model/GetServiceInstanceRequest.cc
  56. src/model/GetServiceInstanceResult.cc
  57. src/model/GetServiceTemplateParameterConstraintsRequest.cc
  58. src/model/GetServiceTemplateParameterConstraintsResult.cc
  59. src/model/ListServiceInstanceLogsRequest.cc
  60. src/model/ListServiceInstanceLogsResult.cc
  61. src/model/ListServiceInstanceResourcesRequest.cc
  62. src/model/ListServiceInstanceResourcesResult.cc
  63. src/model/ListServiceInstancesRequest.cc
  64. src/model/ListServiceInstancesResult.cc
  65. src/model/RestartServiceInstanceRequest.cc
  66. src/model/RestartServiceInstanceResult.cc
  67. src/model/StartServiceInstanceRequest.cc
  68. src/model/StartServiceInstanceResult.cc
  69. src/model/StopServiceInstanceRequest.cc
  70. src/model/StopServiceInstanceResult.cc )
  71. add_library(computenest ${LIB_TYPE}
  72. ${computenest_public_header}
  73. ${computenest_public_header_model}
  74. ${computenest_src})
  75. set_target_properties(computenest
  76. PROPERTIES
  77. LINKER_LANGUAGE CXX
  78. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  79. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  80. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  81. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}computenest
  82. )
  83. if(${LIB_TYPE} STREQUAL "SHARED")
  84. set_target_properties(computenest
  85. PROPERTIES
  86. DEFINE_SYMBOL ALIBABACLOUD_COMPUTENEST_LIBRARY)
  87. endif()
  88. target_include_directories(computenest
  89. PRIVATE include
  90. ${CMAKE_SOURCE_DIR}/core/include
  91. )
  92. target_link_libraries(computenest
  93. core)
  94. if(CMAKE_HOST_WIN32)
  95. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  96. set(jsoncpp_install_dir ${INSTALL_DIR})
  97. add_dependencies(computenest
  98. jsoncpp)
  99. target_include_directories(computenest
  100. PRIVATE ${jsoncpp_install_dir}/include)
  101. target_link_libraries(computenest
  102. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  103. set_target_properties(computenest
  104. PROPERTIES
  105. COMPILE_OPTIONS "/bigobj")
  106. else()
  107. target_include_directories(computenest
  108. PRIVATE /usr/include/jsoncpp)
  109. target_link_libraries(computenest
  110. jsoncpp)
  111. endif()
  112. install(FILES ${computenest_public_header}
  113. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/computenest)
  114. install(FILES ${computenest_public_header_model}
  115. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/computenest/model)
  116. install(TARGETS computenest
  117. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  118. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  119. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  120. )