CMakeLists.txt 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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(dbfs_public_header
  18. include/alibabacloud/dbfs/DBFSClient.h
  19. include/alibabacloud/dbfs/DBFSExport.h )
  20. set(dbfs_public_header_model
  21. include/alibabacloud/dbfs/model/AddTagsBatchRequest.h
  22. include/alibabacloud/dbfs/model/AddTagsBatchResult.h
  23. include/alibabacloud/dbfs/model/ApplyAutoSnapshotPolicyRequest.h
  24. include/alibabacloud/dbfs/model/ApplyAutoSnapshotPolicyResult.h
  25. include/alibabacloud/dbfs/model/AttachDbfsRequest.h
  26. include/alibabacloud/dbfs/model/AttachDbfsResult.h
  27. include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyRequest.h
  28. include/alibabacloud/dbfs/model/CancelAutoSnapshotPolicyResult.h
  29. include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyRequest.h
  30. include/alibabacloud/dbfs/model/CreateAutoSnapshotPolicyResult.h
  31. include/alibabacloud/dbfs/model/CreateDbfsRequest.h
  32. include/alibabacloud/dbfs/model/CreateDbfsResult.h
  33. include/alibabacloud/dbfs/model/CreateServiceLinkedRoleRequest.h
  34. include/alibabacloud/dbfs/model/CreateServiceLinkedRoleResult.h
  35. include/alibabacloud/dbfs/model/CreateSnapshotRequest.h
  36. include/alibabacloud/dbfs/model/CreateSnapshotResult.h
  37. include/alibabacloud/dbfs/model/DeleteAutoSnapshotPolicyRequest.h
  38. include/alibabacloud/dbfs/model/DeleteAutoSnapshotPolicyResult.h
  39. include/alibabacloud/dbfs/model/DeleteDbfsRequest.h
  40. include/alibabacloud/dbfs/model/DeleteDbfsResult.h
  41. include/alibabacloud/dbfs/model/DeleteSnapshotRequest.h
  42. include/alibabacloud/dbfs/model/DeleteSnapshotResult.h
  43. include/alibabacloud/dbfs/model/DeleteTagsBatchRequest.h
  44. include/alibabacloud/dbfs/model/DeleteTagsBatchResult.h
  45. include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsRequest.h
  46. include/alibabacloud/dbfs/model/DescribeDbfsSpecificationsResult.h
  47. include/alibabacloud/dbfs/model/DescribeInstanceTypesRequest.h
  48. include/alibabacloud/dbfs/model/DescribeInstanceTypesResult.h
  49. include/alibabacloud/dbfs/model/DetachDbfsRequest.h
  50. include/alibabacloud/dbfs/model/DetachDbfsResult.h
  51. include/alibabacloud/dbfs/model/GetAutoSnapshotPolicyRequest.h
  52. include/alibabacloud/dbfs/model/GetAutoSnapshotPolicyResult.h
  53. include/alibabacloud/dbfs/model/GetDbfsRequest.h
  54. include/alibabacloud/dbfs/model/GetDbfsResult.h
  55. include/alibabacloud/dbfs/model/GetServiceLinkedRoleRequest.h
  56. include/alibabacloud/dbfs/model/GetServiceLinkedRoleResult.h
  57. include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h
  58. include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h
  59. include/alibabacloud/dbfs/model/ListAutoSnapshotPoliciesRequest.h
  60. include/alibabacloud/dbfs/model/ListAutoSnapshotPoliciesResult.h
  61. include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsRequest.h
  62. include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsResult.h
  63. include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyUnappliedDbfsRequest.h
  64. include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyUnappliedDbfsResult.h
  65. include/alibabacloud/dbfs/model/ListDbfsRequest.h
  66. include/alibabacloud/dbfs/model/ListDbfsResult.h
  67. include/alibabacloud/dbfs/model/ListDbfsAttachableEcsInstancesRequest.h
  68. include/alibabacloud/dbfs/model/ListDbfsAttachableEcsInstancesResult.h
  69. include/alibabacloud/dbfs/model/ListDbfsAttachedEcsInstancesRequest.h
  70. include/alibabacloud/dbfs/model/ListDbfsAttachedEcsInstancesResult.h
  71. include/alibabacloud/dbfs/model/ListSnapshotRequest.h
  72. include/alibabacloud/dbfs/model/ListSnapshotResult.h
  73. include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.h
  74. include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h
  75. include/alibabacloud/dbfs/model/ListTagKeysRequest.h
  76. include/alibabacloud/dbfs/model/ListTagKeysResult.h
  77. include/alibabacloud/dbfs/model/ListTagValuesRequest.h
  78. include/alibabacloud/dbfs/model/ListTagValuesResult.h
  79. include/alibabacloud/dbfs/model/ModifyAutoSnapshotPolicyRequest.h
  80. include/alibabacloud/dbfs/model/ModifyAutoSnapshotPolicyResult.h
  81. include/alibabacloud/dbfs/model/ModifySnapshotAttributeRequest.h
  82. include/alibabacloud/dbfs/model/ModifySnapshotAttributeResult.h
  83. include/alibabacloud/dbfs/model/RenameDbfsRequest.h
  84. include/alibabacloud/dbfs/model/RenameDbfsResult.h
  85. include/alibabacloud/dbfs/model/ResizeDbfsRequest.h
  86. include/alibabacloud/dbfs/model/ResizeDbfsResult.h
  87. include/alibabacloud/dbfs/model/TagDbfsRequest.h
  88. include/alibabacloud/dbfs/model/TagDbfsResult.h
  89. include/alibabacloud/dbfs/model/UpdateDbfsRequest.h
  90. include/alibabacloud/dbfs/model/UpdateDbfsResult.h )
  91. set(dbfs_src
  92. src/DBFSClient.cc
  93. src/model/AddTagsBatchRequest.cc
  94. src/model/AddTagsBatchResult.cc
  95. src/model/ApplyAutoSnapshotPolicyRequest.cc
  96. src/model/ApplyAutoSnapshotPolicyResult.cc
  97. src/model/AttachDbfsRequest.cc
  98. src/model/AttachDbfsResult.cc
  99. src/model/CancelAutoSnapshotPolicyRequest.cc
  100. src/model/CancelAutoSnapshotPolicyResult.cc
  101. src/model/CreateAutoSnapshotPolicyRequest.cc
  102. src/model/CreateAutoSnapshotPolicyResult.cc
  103. src/model/CreateDbfsRequest.cc
  104. src/model/CreateDbfsResult.cc
  105. src/model/CreateServiceLinkedRoleRequest.cc
  106. src/model/CreateServiceLinkedRoleResult.cc
  107. src/model/CreateSnapshotRequest.cc
  108. src/model/CreateSnapshotResult.cc
  109. src/model/DeleteAutoSnapshotPolicyRequest.cc
  110. src/model/DeleteAutoSnapshotPolicyResult.cc
  111. src/model/DeleteDbfsRequest.cc
  112. src/model/DeleteDbfsResult.cc
  113. src/model/DeleteSnapshotRequest.cc
  114. src/model/DeleteSnapshotResult.cc
  115. src/model/DeleteTagsBatchRequest.cc
  116. src/model/DeleteTagsBatchResult.cc
  117. src/model/DescribeDbfsSpecificationsRequest.cc
  118. src/model/DescribeDbfsSpecificationsResult.cc
  119. src/model/DescribeInstanceTypesRequest.cc
  120. src/model/DescribeInstanceTypesResult.cc
  121. src/model/DetachDbfsRequest.cc
  122. src/model/DetachDbfsResult.cc
  123. src/model/GetAutoSnapshotPolicyRequest.cc
  124. src/model/GetAutoSnapshotPolicyResult.cc
  125. src/model/GetDbfsRequest.cc
  126. src/model/GetDbfsResult.cc
  127. src/model/GetServiceLinkedRoleRequest.cc
  128. src/model/GetServiceLinkedRoleResult.cc
  129. src/model/GetSnapshotLinkRequest.cc
  130. src/model/GetSnapshotLinkResult.cc
  131. src/model/ListAutoSnapshotPoliciesRequest.cc
  132. src/model/ListAutoSnapshotPoliciesResult.cc
  133. src/model/ListAutoSnapshotPolicyAppliedDbfsRequest.cc
  134. src/model/ListAutoSnapshotPolicyAppliedDbfsResult.cc
  135. src/model/ListAutoSnapshotPolicyUnappliedDbfsRequest.cc
  136. src/model/ListAutoSnapshotPolicyUnappliedDbfsResult.cc
  137. src/model/ListDbfsRequest.cc
  138. src/model/ListDbfsResult.cc
  139. src/model/ListDbfsAttachableEcsInstancesRequest.cc
  140. src/model/ListDbfsAttachableEcsInstancesResult.cc
  141. src/model/ListDbfsAttachedEcsInstancesRequest.cc
  142. src/model/ListDbfsAttachedEcsInstancesResult.cc
  143. src/model/ListSnapshotRequest.cc
  144. src/model/ListSnapshotResult.cc
  145. src/model/ListSnapshotLinksRequest.cc
  146. src/model/ListSnapshotLinksResult.cc
  147. src/model/ListTagKeysRequest.cc
  148. src/model/ListTagKeysResult.cc
  149. src/model/ListTagValuesRequest.cc
  150. src/model/ListTagValuesResult.cc
  151. src/model/ModifyAutoSnapshotPolicyRequest.cc
  152. src/model/ModifyAutoSnapshotPolicyResult.cc
  153. src/model/ModifySnapshotAttributeRequest.cc
  154. src/model/ModifySnapshotAttributeResult.cc
  155. src/model/RenameDbfsRequest.cc
  156. src/model/RenameDbfsResult.cc
  157. src/model/ResizeDbfsRequest.cc
  158. src/model/ResizeDbfsResult.cc
  159. src/model/TagDbfsRequest.cc
  160. src/model/TagDbfsResult.cc
  161. src/model/UpdateDbfsRequest.cc
  162. src/model/UpdateDbfsResult.cc )
  163. add_library(dbfs ${LIB_TYPE}
  164. ${dbfs_public_header}
  165. ${dbfs_public_header_model}
  166. ${dbfs_src})
  167. set_target_properties(dbfs
  168. PROPERTIES
  169. LINKER_LANGUAGE CXX
  170. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  171. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  172. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  173. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}dbfs
  174. )
  175. if(${LIB_TYPE} STREQUAL "SHARED")
  176. set_target_properties(dbfs
  177. PROPERTIES
  178. DEFINE_SYMBOL ALIBABACLOUD_DBFS_LIBRARY)
  179. endif()
  180. target_include_directories(dbfs
  181. PRIVATE include
  182. ${CMAKE_SOURCE_DIR}/core/include
  183. )
  184. target_link_libraries(dbfs
  185. core)
  186. if(CMAKE_HOST_WIN32)
  187. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  188. set(jsoncpp_install_dir ${INSTALL_DIR})
  189. add_dependencies(dbfs
  190. jsoncpp)
  191. target_include_directories(dbfs
  192. PRIVATE ${jsoncpp_install_dir}/include)
  193. target_link_libraries(dbfs
  194. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  195. set_target_properties(dbfs
  196. PROPERTIES
  197. COMPILE_OPTIONS "/bigobj")
  198. else()
  199. target_include_directories(dbfs
  200. PRIVATE /usr/include/jsoncpp)
  201. target_link_libraries(dbfs
  202. jsoncpp)
  203. endif()
  204. install(FILES ${dbfs_public_header}
  205. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/dbfs)
  206. install(FILES ${dbfs_public_header_model}
  207. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/dbfs/model)
  208. install(TARGETS dbfs
  209. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  210. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  211. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  212. )