CMakeLists.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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(arms_public_header
  18. include/alibabacloud/arms/ARMSClient.h
  19. include/alibabacloud/arms/ARMSExport.h )
  20. set(arms_public_header_model
  21. include/alibabacloud/arms/model/CreateAlertContactRequest.h
  22. include/alibabacloud/arms/model/CreateAlertContactResult.h
  23. include/alibabacloud/arms/model/CreateAlertContactGroupRequest.h
  24. include/alibabacloud/arms/model/CreateAlertContactGroupResult.h
  25. include/alibabacloud/arms/model/CreateRetcodeAppRequest.h
  26. include/alibabacloud/arms/model/CreateRetcodeAppResult.h
  27. include/alibabacloud/arms/model/DeleteRetcodeAppRequest.h
  28. include/alibabacloud/arms/model/DeleteRetcodeAppResult.h
  29. include/alibabacloud/arms/model/ImportAppAlertRulesRequest.h
  30. include/alibabacloud/arms/model/ImportAppAlertRulesResult.h
  31. include/alibabacloud/arms/model/ListRetcodeAppsRequest.h
  32. include/alibabacloud/arms/model/ListRetcodeAppsResult.h
  33. include/alibabacloud/arms/model/ListTraceAppsRequest.h
  34. include/alibabacloud/arms/model/ListTraceAppsResult.h
  35. include/alibabacloud/arms/model/QueryDatasetRequest.h
  36. include/alibabacloud/arms/model/QueryDatasetResult.h
  37. include/alibabacloud/arms/model/QueryMetricRequest.h
  38. include/alibabacloud/arms/model/QueryMetricResult.h
  39. include/alibabacloud/arms/model/SearchAlertContactRequest.h
  40. include/alibabacloud/arms/model/SearchAlertContactResult.h
  41. include/alibabacloud/arms/model/SearchAlertContactGroupRequest.h
  42. include/alibabacloud/arms/model/SearchAlertContactGroupResult.h
  43. include/alibabacloud/arms/model/SearchRetcodeAppByPageRequest.h
  44. include/alibabacloud/arms/model/SearchRetcodeAppByPageResult.h
  45. include/alibabacloud/arms/model/SearchTraceAppByNameRequest.h
  46. include/alibabacloud/arms/model/SearchTraceAppByNameResult.h
  47. include/alibabacloud/arms/model/SearchTraceAppByPageRequest.h
  48. include/alibabacloud/arms/model/SearchTraceAppByPageResult.h )
  49. set(arms_src
  50. src/ARMSClient.cc
  51. src/model/CreateAlertContactRequest.cc
  52. src/model/CreateAlertContactResult.cc
  53. src/model/CreateAlertContactGroupRequest.cc
  54. src/model/CreateAlertContactGroupResult.cc
  55. src/model/CreateRetcodeAppRequest.cc
  56. src/model/CreateRetcodeAppResult.cc
  57. src/model/DeleteRetcodeAppRequest.cc
  58. src/model/DeleteRetcodeAppResult.cc
  59. src/model/ImportAppAlertRulesRequest.cc
  60. src/model/ImportAppAlertRulesResult.cc
  61. src/model/ListRetcodeAppsRequest.cc
  62. src/model/ListRetcodeAppsResult.cc
  63. src/model/ListTraceAppsRequest.cc
  64. src/model/ListTraceAppsResult.cc
  65. src/model/QueryDatasetRequest.cc
  66. src/model/QueryDatasetResult.cc
  67. src/model/QueryMetricRequest.cc
  68. src/model/QueryMetricResult.cc
  69. src/model/SearchAlertContactRequest.cc
  70. src/model/SearchAlertContactResult.cc
  71. src/model/SearchAlertContactGroupRequest.cc
  72. src/model/SearchAlertContactGroupResult.cc
  73. src/model/SearchRetcodeAppByPageRequest.cc
  74. src/model/SearchRetcodeAppByPageResult.cc
  75. src/model/SearchTraceAppByNameRequest.cc
  76. src/model/SearchTraceAppByNameResult.cc
  77. src/model/SearchTraceAppByPageRequest.cc
  78. src/model/SearchTraceAppByPageResult.cc )
  79. add_library(arms ${LIB_TYPE}
  80. ${arms_public_header}
  81. ${arms_public_header_model}
  82. ${arms_src})
  83. set_target_properties(arms
  84. PROPERTIES
  85. LINKER_LANGUAGE CXX
  86. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  87. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  88. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  89. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}arms
  90. )
  91. if(${LIB_TYPE} STREQUAL "SHARED")
  92. set_target_properties(arms
  93. PROPERTIES
  94. DEFINE_SYMBOL ALIBABACLOUD_ARMS_LIBRARY)
  95. endif()
  96. target_include_directories(arms
  97. PRIVATE include
  98. ${CMAKE_SOURCE_DIR}/core/include
  99. )
  100. target_link_libraries(arms
  101. core)
  102. if(CMAKE_HOST_WIN32)
  103. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  104. set(jsoncpp_install_dir ${INSTALL_DIR})
  105. add_dependencies(arms
  106. jsoncpp)
  107. target_include_directories(arms
  108. PRIVATE ${jsoncpp_install_dir}/include)
  109. target_link_libraries(arms
  110. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  111. set_target_properties(arms
  112. PROPERTIES
  113. COMPILE_OPTIONS "/bigobj")
  114. else()
  115. target_include_directories(arms
  116. PRIVATE /usr/include/jsoncpp)
  117. target_link_libraries(arms
  118. jsoncpp)
  119. endif()
  120. install(FILES ${arms_public_header}
  121. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/arms)
  122. install(FILES ${arms_public_header_model}
  123. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/arms/model)
  124. install(TARGETS arms
  125. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  126. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  127. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  128. )