CMakeLists.txt 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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(hitsdb_public_header
  18. include/alibabacloud/hitsdb/HitsdbClient.h
  19. include/alibabacloud/hitsdb/HitsdbExport.h )
  20. set(hitsdb_public_header_model
  21. include/alibabacloud/hitsdb/model/CreateLdpsComputeGroupRequest.h
  22. include/alibabacloud/hitsdb/model/CreateLdpsComputeGroupResult.h
  23. include/alibabacloud/hitsdb/model/CreateLdpsNamespaceRequest.h
  24. include/alibabacloud/hitsdb/model/CreateLdpsNamespaceResult.h
  25. include/alibabacloud/hitsdb/model/CreateLindormInstanceRequest.h
  26. include/alibabacloud/hitsdb/model/CreateLindormInstanceResult.h
  27. include/alibabacloud/hitsdb/model/DeleteLdpsComputeGroupRequest.h
  28. include/alibabacloud/hitsdb/model/DeleteLdpsComputeGroupResult.h
  29. include/alibabacloud/hitsdb/model/DescribeRegionsRequest.h
  30. include/alibabacloud/hitsdb/model/DescribeRegionsResult.h
  31. include/alibabacloud/hitsdb/model/GetEngineDefaultAuthRequest.h
  32. include/alibabacloud/hitsdb/model/GetEngineDefaultAuthResult.h
  33. include/alibabacloud/hitsdb/model/GetInstanceIpWhiteListRequest.h
  34. include/alibabacloud/hitsdb/model/GetInstanceIpWhiteListResult.h
  35. include/alibabacloud/hitsdb/model/GetInstanceSecurityGroupsRequest.h
  36. include/alibabacloud/hitsdb/model/GetInstanceSecurityGroupsResult.h
  37. include/alibabacloud/hitsdb/model/GetLdpsComputeGroupRequest.h
  38. include/alibabacloud/hitsdb/model/GetLdpsComputeGroupResult.h
  39. include/alibabacloud/hitsdb/model/GetLdpsNamespacedQuotaRequest.h
  40. include/alibabacloud/hitsdb/model/GetLdpsNamespacedQuotaResult.h
  41. include/alibabacloud/hitsdb/model/GetLdpsResourceCostRequest.h
  42. include/alibabacloud/hitsdb/model/GetLdpsResourceCostResult.h
  43. include/alibabacloud/hitsdb/model/GetLindormInstanceRequest.h
  44. include/alibabacloud/hitsdb/model/GetLindormInstanceResult.h
  45. include/alibabacloud/hitsdb/model/GetLindormInstanceEngineListRequest.h
  46. include/alibabacloud/hitsdb/model/GetLindormInstanceEngineListResult.h
  47. include/alibabacloud/hitsdb/model/GetLindormInstanceListRequest.h
  48. include/alibabacloud/hitsdb/model/GetLindormInstanceListResult.h
  49. include/alibabacloud/hitsdb/model/ListLdpsComputeGroupsRequest.h
  50. include/alibabacloud/hitsdb/model/ListLdpsComputeGroupsResult.h
  51. include/alibabacloud/hitsdb/model/ListTagResourcesRequest.h
  52. include/alibabacloud/hitsdb/model/ListTagResourcesResult.h
  53. include/alibabacloud/hitsdb/model/ModifyInstancePayTypeRequest.h
  54. include/alibabacloud/hitsdb/model/ModifyInstancePayTypeResult.h
  55. include/alibabacloud/hitsdb/model/ReleaseLindormInstanceRequest.h
  56. include/alibabacloud/hitsdb/model/ReleaseLindormInstanceResult.h
  57. include/alibabacloud/hitsdb/model/RenewLindormInstanceRequest.h
  58. include/alibabacloud/hitsdb/model/RenewLindormInstanceResult.h
  59. include/alibabacloud/hitsdb/model/RestartLdpsComputeGroupRequest.h
  60. include/alibabacloud/hitsdb/model/RestartLdpsComputeGroupResult.h
  61. include/alibabacloud/hitsdb/model/SwitchLSQLV3MySQLServiceRequest.h
  62. include/alibabacloud/hitsdb/model/SwitchLSQLV3MySQLServiceResult.h
  63. include/alibabacloud/hitsdb/model/TagResourcesRequest.h
  64. include/alibabacloud/hitsdb/model/TagResourcesResult.h
  65. include/alibabacloud/hitsdb/model/UntagResourcesRequest.h
  66. include/alibabacloud/hitsdb/model/UntagResourcesResult.h
  67. include/alibabacloud/hitsdb/model/UpdateInstanceIpWhiteListRequest.h
  68. include/alibabacloud/hitsdb/model/UpdateInstanceIpWhiteListResult.h
  69. include/alibabacloud/hitsdb/model/UpdateInstanceSecurityGroupsRequest.h
  70. include/alibabacloud/hitsdb/model/UpdateInstanceSecurityGroupsResult.h
  71. include/alibabacloud/hitsdb/model/UpdateLdpsComputeGroupRequest.h
  72. include/alibabacloud/hitsdb/model/UpdateLdpsComputeGroupResult.h
  73. include/alibabacloud/hitsdb/model/UpgradeLindormInstanceRequest.h
  74. include/alibabacloud/hitsdb/model/UpgradeLindormInstanceResult.h )
  75. set(hitsdb_src
  76. src/HitsdbClient.cc
  77. src/model/CreateLdpsComputeGroupRequest.cc
  78. src/model/CreateLdpsComputeGroupResult.cc
  79. src/model/CreateLdpsNamespaceRequest.cc
  80. src/model/CreateLdpsNamespaceResult.cc
  81. src/model/CreateLindormInstanceRequest.cc
  82. src/model/CreateLindormInstanceResult.cc
  83. src/model/DeleteLdpsComputeGroupRequest.cc
  84. src/model/DeleteLdpsComputeGroupResult.cc
  85. src/model/DescribeRegionsRequest.cc
  86. src/model/DescribeRegionsResult.cc
  87. src/model/GetEngineDefaultAuthRequest.cc
  88. src/model/GetEngineDefaultAuthResult.cc
  89. src/model/GetInstanceIpWhiteListRequest.cc
  90. src/model/GetInstanceIpWhiteListResult.cc
  91. src/model/GetInstanceSecurityGroupsRequest.cc
  92. src/model/GetInstanceSecurityGroupsResult.cc
  93. src/model/GetLdpsComputeGroupRequest.cc
  94. src/model/GetLdpsComputeGroupResult.cc
  95. src/model/GetLdpsNamespacedQuotaRequest.cc
  96. src/model/GetLdpsNamespacedQuotaResult.cc
  97. src/model/GetLdpsResourceCostRequest.cc
  98. src/model/GetLdpsResourceCostResult.cc
  99. src/model/GetLindormInstanceRequest.cc
  100. src/model/GetLindormInstanceResult.cc
  101. src/model/GetLindormInstanceEngineListRequest.cc
  102. src/model/GetLindormInstanceEngineListResult.cc
  103. src/model/GetLindormInstanceListRequest.cc
  104. src/model/GetLindormInstanceListResult.cc
  105. src/model/ListLdpsComputeGroupsRequest.cc
  106. src/model/ListLdpsComputeGroupsResult.cc
  107. src/model/ListTagResourcesRequest.cc
  108. src/model/ListTagResourcesResult.cc
  109. src/model/ModifyInstancePayTypeRequest.cc
  110. src/model/ModifyInstancePayTypeResult.cc
  111. src/model/ReleaseLindormInstanceRequest.cc
  112. src/model/ReleaseLindormInstanceResult.cc
  113. src/model/RenewLindormInstanceRequest.cc
  114. src/model/RenewLindormInstanceResult.cc
  115. src/model/RestartLdpsComputeGroupRequest.cc
  116. src/model/RestartLdpsComputeGroupResult.cc
  117. src/model/SwitchLSQLV3MySQLServiceRequest.cc
  118. src/model/SwitchLSQLV3MySQLServiceResult.cc
  119. src/model/TagResourcesRequest.cc
  120. src/model/TagResourcesResult.cc
  121. src/model/UntagResourcesRequest.cc
  122. src/model/UntagResourcesResult.cc
  123. src/model/UpdateInstanceIpWhiteListRequest.cc
  124. src/model/UpdateInstanceIpWhiteListResult.cc
  125. src/model/UpdateInstanceSecurityGroupsRequest.cc
  126. src/model/UpdateInstanceSecurityGroupsResult.cc
  127. src/model/UpdateLdpsComputeGroupRequest.cc
  128. src/model/UpdateLdpsComputeGroupResult.cc
  129. src/model/UpgradeLindormInstanceRequest.cc
  130. src/model/UpgradeLindormInstanceResult.cc )
  131. add_library(hitsdb ${LIB_TYPE}
  132. ${hitsdb_public_header}
  133. ${hitsdb_public_header_model}
  134. ${hitsdb_src})
  135. set_target_properties(hitsdb
  136. PROPERTIES
  137. LINKER_LANGUAGE CXX
  138. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  139. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  140. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  141. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}hitsdb
  142. )
  143. if(${LIB_TYPE} STREQUAL "SHARED")
  144. set_target_properties(hitsdb
  145. PROPERTIES
  146. DEFINE_SYMBOL ALIBABACLOUD_HITSDB_LIBRARY)
  147. endif()
  148. target_include_directories(hitsdb
  149. PRIVATE include
  150. ${CMAKE_SOURCE_DIR}/core/include
  151. )
  152. target_link_libraries(hitsdb
  153. core)
  154. if(CMAKE_HOST_WIN32)
  155. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  156. set(jsoncpp_install_dir ${INSTALL_DIR})
  157. add_dependencies(hitsdb
  158. jsoncpp)
  159. target_include_directories(hitsdb
  160. PRIVATE ${jsoncpp_install_dir}/include)
  161. target_link_libraries(hitsdb
  162. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  163. set_target_properties(hitsdb
  164. PROPERTIES
  165. COMPILE_OPTIONS "/bigobj")
  166. else()
  167. target_include_directories(hitsdb
  168. PRIVATE /usr/include/jsoncpp)
  169. target_link_libraries(hitsdb
  170. jsoncpp)
  171. endif()
  172. install(FILES ${hitsdb_public_header}
  173. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/hitsdb)
  174. install(FILES ${hitsdb_public_header_model}
  175. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/hitsdb/model)
  176. install(TARGETS hitsdb
  177. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  178. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  179. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  180. )