CMakeLists.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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(amqp-open_public_header
  18. include/alibabacloud/amqp-open/Amqp_openClient.h
  19. include/alibabacloud/amqp-open/Amqp_openExport.h )
  20. set(amqp-open_public_header_model
  21. include/alibabacloud/amqp-open/model/CreateBindingRequest.h
  22. include/alibabacloud/amqp-open/model/CreateBindingResult.h
  23. include/alibabacloud/amqp-open/model/CreateExchangeRequest.h
  24. include/alibabacloud/amqp-open/model/CreateExchangeResult.h
  25. include/alibabacloud/amqp-open/model/CreateQueueRequest.h
  26. include/alibabacloud/amqp-open/model/CreateQueueResult.h
  27. include/alibabacloud/amqp-open/model/CreateVirtualHostRequest.h
  28. include/alibabacloud/amqp-open/model/CreateVirtualHostResult.h
  29. include/alibabacloud/amqp-open/model/DeleteBindingRequest.h
  30. include/alibabacloud/amqp-open/model/DeleteBindingResult.h
  31. include/alibabacloud/amqp-open/model/DeleteExchangeRequest.h
  32. include/alibabacloud/amqp-open/model/DeleteExchangeResult.h
  33. include/alibabacloud/amqp-open/model/DeleteQueueRequest.h
  34. include/alibabacloud/amqp-open/model/DeleteQueueResult.h
  35. include/alibabacloud/amqp-open/model/DeleteVirtualHostRequest.h
  36. include/alibabacloud/amqp-open/model/DeleteVirtualHostResult.h
  37. include/alibabacloud/amqp-open/model/ListBindingsRequest.h
  38. include/alibabacloud/amqp-open/model/ListBindingsResult.h
  39. include/alibabacloud/amqp-open/model/ListDownStreamBindingsRequest.h
  40. include/alibabacloud/amqp-open/model/ListDownStreamBindingsResult.h
  41. include/alibabacloud/amqp-open/model/ListExchangeUpStreamBindingsRequest.h
  42. include/alibabacloud/amqp-open/model/ListExchangeUpStreamBindingsResult.h
  43. include/alibabacloud/amqp-open/model/ListExchangesRequest.h
  44. include/alibabacloud/amqp-open/model/ListExchangesResult.h
  45. include/alibabacloud/amqp-open/model/ListInstancesRequest.h
  46. include/alibabacloud/amqp-open/model/ListInstancesResult.h
  47. include/alibabacloud/amqp-open/model/ListQueueUpStreamBindingsRequest.h
  48. include/alibabacloud/amqp-open/model/ListQueueUpStreamBindingsResult.h
  49. include/alibabacloud/amqp-open/model/ListQueuesRequest.h
  50. include/alibabacloud/amqp-open/model/ListQueuesResult.h
  51. include/alibabacloud/amqp-open/model/ListVirtualHostsRequest.h
  52. include/alibabacloud/amqp-open/model/ListVirtualHostsResult.h )
  53. set(amqp-open_src
  54. src/Amqp-openClient.cc
  55. src/model/CreateBindingRequest.cc
  56. src/model/CreateBindingResult.cc
  57. src/model/CreateExchangeRequest.cc
  58. src/model/CreateExchangeResult.cc
  59. src/model/CreateQueueRequest.cc
  60. src/model/CreateQueueResult.cc
  61. src/model/CreateVirtualHostRequest.cc
  62. src/model/CreateVirtualHostResult.cc
  63. src/model/DeleteBindingRequest.cc
  64. src/model/DeleteBindingResult.cc
  65. src/model/DeleteExchangeRequest.cc
  66. src/model/DeleteExchangeResult.cc
  67. src/model/DeleteQueueRequest.cc
  68. src/model/DeleteQueueResult.cc
  69. src/model/DeleteVirtualHostRequest.cc
  70. src/model/DeleteVirtualHostResult.cc
  71. src/model/ListBindingsRequest.cc
  72. src/model/ListBindingsResult.cc
  73. src/model/ListDownStreamBindingsRequest.cc
  74. src/model/ListDownStreamBindingsResult.cc
  75. src/model/ListExchangeUpStreamBindingsRequest.cc
  76. src/model/ListExchangeUpStreamBindingsResult.cc
  77. src/model/ListExchangesRequest.cc
  78. src/model/ListExchangesResult.cc
  79. src/model/ListInstancesRequest.cc
  80. src/model/ListInstancesResult.cc
  81. src/model/ListQueueUpStreamBindingsRequest.cc
  82. src/model/ListQueueUpStreamBindingsResult.cc
  83. src/model/ListQueuesRequest.cc
  84. src/model/ListQueuesResult.cc
  85. src/model/ListVirtualHostsRequest.cc
  86. src/model/ListVirtualHostsResult.cc )
  87. add_library(amqp-open ${LIB_TYPE}
  88. ${amqp-open_public_header}
  89. ${amqp-open_public_header_model}
  90. ${amqp-open_src})
  91. set_target_properties(amqp-open
  92. PROPERTIES
  93. LINKER_LANGUAGE CXX
  94. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  95. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  96. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  97. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}amqp-open
  98. )
  99. if(${LIB_TYPE} STREQUAL "SHARED")
  100. set_target_properties(amqp-open
  101. PROPERTIES
  102. DEFINE_SYMBOL ALIBABACLOUD_AMQP_OPEN_LIBRARY)
  103. endif()
  104. target_include_directories(amqp-open
  105. PRIVATE include
  106. ${CMAKE_SOURCE_DIR}/core/include
  107. )
  108. target_link_libraries(amqp-open
  109. core)
  110. if(CMAKE_HOST_WIN32)
  111. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  112. set(jsoncpp_install_dir ${INSTALL_DIR})
  113. add_dependencies(amqp-open
  114. jsoncpp)
  115. target_include_directories(amqp-open
  116. PRIVATE ${jsoncpp_install_dir}/include)
  117. target_link_libraries(amqp-open
  118. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  119. set_target_properties(amqp-open
  120. PROPERTIES
  121. COMPILE_OPTIONS "/bigobj")
  122. else()
  123. target_include_directories(amqp-open
  124. PRIVATE /usr/include/jsoncpp)
  125. target_link_libraries(amqp-open
  126. jsoncpp)
  127. endif()
  128. install(FILES ${amqp-open_public_header}
  129. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/amqp-open)
  130. install(FILES ${amqp-open_public_header_model}
  131. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/amqp-open/model)
  132. install(TARGETS amqp-open
  133. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  134. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  135. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  136. )