CMakeLists.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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(governance_public_header
  18. include/alibabacloud/governance/GovernanceClient.h
  19. include/alibabacloud/governance/GovernanceExport.h )
  20. set(governance_public_header_model
  21. include/alibabacloud/governance/model/BatchEnrollAccountsRequest.h
  22. include/alibabacloud/governance/model/BatchEnrollAccountsResult.h
  23. include/alibabacloud/governance/model/CreateAccountFactoryBaselineRequest.h
  24. include/alibabacloud/governance/model/CreateAccountFactoryBaselineResult.h
  25. include/alibabacloud/governance/model/DeleteAccountFactoryBaselineRequest.h
  26. include/alibabacloud/governance/model/DeleteAccountFactoryBaselineResult.h
  27. include/alibabacloud/governance/model/EnrollAccountRequest.h
  28. include/alibabacloud/governance/model/EnrollAccountResult.h
  29. include/alibabacloud/governance/model/GetAccountFactoryBaselineRequest.h
  30. include/alibabacloud/governance/model/GetAccountFactoryBaselineResult.h
  31. include/alibabacloud/governance/model/GetEnrolledAccountRequest.h
  32. include/alibabacloud/governance/model/GetEnrolledAccountResult.h
  33. include/alibabacloud/governance/model/ListAccountFactoryBaselineItemsRequest.h
  34. include/alibabacloud/governance/model/ListAccountFactoryBaselineItemsResult.h
  35. include/alibabacloud/governance/model/ListAccountFactoryBaselinesRequest.h
  36. include/alibabacloud/governance/model/ListAccountFactoryBaselinesResult.h
  37. include/alibabacloud/governance/model/ListEnrolledAccountsRequest.h
  38. include/alibabacloud/governance/model/ListEnrolledAccountsResult.h
  39. include/alibabacloud/governance/model/ListEvaluationMetadataRequest.h
  40. include/alibabacloud/governance/model/ListEvaluationMetadataResult.h
  41. include/alibabacloud/governance/model/ListEvaluationMetricDetailsRequest.h
  42. include/alibabacloud/governance/model/ListEvaluationMetricDetailsResult.h
  43. include/alibabacloud/governance/model/ListEvaluationResultsRequest.h
  44. include/alibabacloud/governance/model/ListEvaluationResultsResult.h
  45. include/alibabacloud/governance/model/ListEvaluationScoreHistoryRequest.h
  46. include/alibabacloud/governance/model/ListEvaluationScoreHistoryResult.h
  47. include/alibabacloud/governance/model/RunEvaluationRequest.h
  48. include/alibabacloud/governance/model/RunEvaluationResult.h
  49. include/alibabacloud/governance/model/UpdateAccountFactoryBaselineRequest.h
  50. include/alibabacloud/governance/model/UpdateAccountFactoryBaselineResult.h )
  51. set(governance_src
  52. src/GovernanceClient.cc
  53. src/model/BatchEnrollAccountsRequest.cc
  54. src/model/BatchEnrollAccountsResult.cc
  55. src/model/CreateAccountFactoryBaselineRequest.cc
  56. src/model/CreateAccountFactoryBaselineResult.cc
  57. src/model/DeleteAccountFactoryBaselineRequest.cc
  58. src/model/DeleteAccountFactoryBaselineResult.cc
  59. src/model/EnrollAccountRequest.cc
  60. src/model/EnrollAccountResult.cc
  61. src/model/GetAccountFactoryBaselineRequest.cc
  62. src/model/GetAccountFactoryBaselineResult.cc
  63. src/model/GetEnrolledAccountRequest.cc
  64. src/model/GetEnrolledAccountResult.cc
  65. src/model/ListAccountFactoryBaselineItemsRequest.cc
  66. src/model/ListAccountFactoryBaselineItemsResult.cc
  67. src/model/ListAccountFactoryBaselinesRequest.cc
  68. src/model/ListAccountFactoryBaselinesResult.cc
  69. src/model/ListEnrolledAccountsRequest.cc
  70. src/model/ListEnrolledAccountsResult.cc
  71. src/model/ListEvaluationMetadataRequest.cc
  72. src/model/ListEvaluationMetadataResult.cc
  73. src/model/ListEvaluationMetricDetailsRequest.cc
  74. src/model/ListEvaluationMetricDetailsResult.cc
  75. src/model/ListEvaluationResultsRequest.cc
  76. src/model/ListEvaluationResultsResult.cc
  77. src/model/ListEvaluationScoreHistoryRequest.cc
  78. src/model/ListEvaluationScoreHistoryResult.cc
  79. src/model/RunEvaluationRequest.cc
  80. src/model/RunEvaluationResult.cc
  81. src/model/UpdateAccountFactoryBaselineRequest.cc
  82. src/model/UpdateAccountFactoryBaselineResult.cc )
  83. add_library(governance ${LIB_TYPE}
  84. ${governance_public_header}
  85. ${governance_public_header_model}
  86. ${governance_src})
  87. set_target_properties(governance
  88. PROPERTIES
  89. LINKER_LANGUAGE CXX
  90. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  91. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  92. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  93. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}governance
  94. )
  95. if(${LIB_TYPE} STREQUAL "SHARED")
  96. set_target_properties(governance
  97. PROPERTIES
  98. DEFINE_SYMBOL ALIBABACLOUD_GOVERNANCE_LIBRARY)
  99. endif()
  100. target_include_directories(governance
  101. PRIVATE include
  102. ${CMAKE_SOURCE_DIR}/core/include
  103. )
  104. target_link_libraries(governance
  105. core)
  106. if(CMAKE_HOST_WIN32)
  107. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  108. set(jsoncpp_install_dir ${INSTALL_DIR})
  109. add_dependencies(governance
  110. jsoncpp)
  111. target_include_directories(governance
  112. PRIVATE ${jsoncpp_install_dir}/include)
  113. target_link_libraries(governance
  114. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  115. set_target_properties(governance
  116. PROPERTIES
  117. COMPILE_OPTIONS "/bigobj")
  118. else()
  119. target_include_directories(governance
  120. PRIVATE /usr/include/jsoncpp)
  121. target_link_libraries(governance
  122. jsoncpp)
  123. endif()
  124. install(FILES ${governance_public_header}
  125. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/governance)
  126. install(FILES ${governance_public_header_model}
  127. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/governance/model)
  128. install(TARGETS governance
  129. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  130. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  131. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  132. )