CMakeLists.txt 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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(eipanycast_public_header
  18. include/alibabacloud/eipanycast/EipanycastClient.h
  19. include/alibabacloud/eipanycast/EipanycastExport.h )
  20. set(eipanycast_public_header_model
  21. include/alibabacloud/eipanycast/model/AllocateAnycastEipAddressRequest.h
  22. include/alibabacloud/eipanycast/model/AllocateAnycastEipAddressResult.h
  23. include/alibabacloud/eipanycast/model/AssociateAnycastEipAddressRequest.h
  24. include/alibabacloud/eipanycast/model/AssociateAnycastEipAddressResult.h
  25. include/alibabacloud/eipanycast/model/DescribeAnycastEipAddressRequest.h
  26. include/alibabacloud/eipanycast/model/DescribeAnycastEipAddressResult.h
  27. include/alibabacloud/eipanycast/model/DescribeAnycastPopLocationsRequest.h
  28. include/alibabacloud/eipanycast/model/DescribeAnycastPopLocationsResult.h
  29. include/alibabacloud/eipanycast/model/DescribeAnycastServerRegionsRequest.h
  30. include/alibabacloud/eipanycast/model/DescribeAnycastServerRegionsResult.h
  31. include/alibabacloud/eipanycast/model/ListAnycastEipAddressesRequest.h
  32. include/alibabacloud/eipanycast/model/ListAnycastEipAddressesResult.h
  33. include/alibabacloud/eipanycast/model/ModifyAnycastEipAddressAttributeRequest.h
  34. include/alibabacloud/eipanycast/model/ModifyAnycastEipAddressAttributeResult.h
  35. include/alibabacloud/eipanycast/model/ModifyAnycastEipAddressSpecRequest.h
  36. include/alibabacloud/eipanycast/model/ModifyAnycastEipAddressSpecResult.h
  37. include/alibabacloud/eipanycast/model/ReleaseAnycastEipAddressRequest.h
  38. include/alibabacloud/eipanycast/model/ReleaseAnycastEipAddressResult.h
  39. include/alibabacloud/eipanycast/model/UnassociateAnycastEipAddressRequest.h
  40. include/alibabacloud/eipanycast/model/UnassociateAnycastEipAddressResult.h
  41. include/alibabacloud/eipanycast/model/UpdateAnycastEipAddressAssociationsRequest.h
  42. include/alibabacloud/eipanycast/model/UpdateAnycastEipAddressAssociationsResult.h )
  43. set(eipanycast_src
  44. src/EipanycastClient.cc
  45. src/model/AllocateAnycastEipAddressRequest.cc
  46. src/model/AllocateAnycastEipAddressResult.cc
  47. src/model/AssociateAnycastEipAddressRequest.cc
  48. src/model/AssociateAnycastEipAddressResult.cc
  49. src/model/DescribeAnycastEipAddressRequest.cc
  50. src/model/DescribeAnycastEipAddressResult.cc
  51. src/model/DescribeAnycastPopLocationsRequest.cc
  52. src/model/DescribeAnycastPopLocationsResult.cc
  53. src/model/DescribeAnycastServerRegionsRequest.cc
  54. src/model/DescribeAnycastServerRegionsResult.cc
  55. src/model/ListAnycastEipAddressesRequest.cc
  56. src/model/ListAnycastEipAddressesResult.cc
  57. src/model/ModifyAnycastEipAddressAttributeRequest.cc
  58. src/model/ModifyAnycastEipAddressAttributeResult.cc
  59. src/model/ModifyAnycastEipAddressSpecRequest.cc
  60. src/model/ModifyAnycastEipAddressSpecResult.cc
  61. src/model/ReleaseAnycastEipAddressRequest.cc
  62. src/model/ReleaseAnycastEipAddressResult.cc
  63. src/model/UnassociateAnycastEipAddressRequest.cc
  64. src/model/UnassociateAnycastEipAddressResult.cc
  65. src/model/UpdateAnycastEipAddressAssociationsRequest.cc
  66. src/model/UpdateAnycastEipAddressAssociationsResult.cc )
  67. add_library(eipanycast ${LIB_TYPE}
  68. ${eipanycast_public_header}
  69. ${eipanycast_public_header_model}
  70. ${eipanycast_src})
  71. set_target_properties(eipanycast
  72. PROPERTIES
  73. LINKER_LANGUAGE CXX
  74. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  75. LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  76. RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  77. OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}eipanycast
  78. )
  79. if(${LIB_TYPE} STREQUAL "SHARED")
  80. set_target_properties(eipanycast
  81. PROPERTIES
  82. DEFINE_SYMBOL ALIBABACLOUD_EIPANYCAST_LIBRARY)
  83. endif()
  84. target_include_directories(eipanycast
  85. PRIVATE include
  86. ${CMAKE_SOURCE_DIR}/core/include
  87. )
  88. target_link_libraries(eipanycast
  89. core)
  90. if(CMAKE_HOST_WIN32)
  91. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  92. set(jsoncpp_install_dir ${INSTALL_DIR})
  93. add_dependencies(eipanycast
  94. jsoncpp)
  95. target_include_directories(eipanycast
  96. PRIVATE ${jsoncpp_install_dir}/include)
  97. target_link_libraries(eipanycast
  98. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  99. set_target_properties(eipanycast
  100. PROPERTIES
  101. COMPILE_OPTIONS "/bigobj")
  102. else()
  103. target_include_directories(eipanycast
  104. PRIVATE /usr/include/jsoncpp)
  105. target_link_libraries(eipanycast
  106. jsoncpp)
  107. endif()
  108. install(FILES ${eipanycast_public_header}
  109. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/eipanycast)
  110. install(FILES ${eipanycast_public_header_model}
  111. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/eipanycast/model)
  112. install(TARGETS eipanycast
  113. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  114. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  115. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  116. )