CMakeLists.txt 4.7 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(eflo_public_header
  18. include/alibabacloud/eflo/EfloClient.h
  19. include/alibabacloud/eflo/EfloExport.h )
  20. set(eflo_public_header_model
  21. include/alibabacloud/eflo/model/CreateSubnetRequest.h
  22. include/alibabacloud/eflo/model/CreateSubnetResult.h
  23. include/alibabacloud/eflo/model/CreateVccRequest.h
  24. include/alibabacloud/eflo/model/CreateVccResult.h
  25. include/alibabacloud/eflo/model/CreateVpdRequest.h
  26. include/alibabacloud/eflo/model/CreateVpdResult.h
  27. include/alibabacloud/eflo/model/DeleteSubnetRequest.h
  28. include/alibabacloud/eflo/model/DeleteSubnetResult.h
  29. include/alibabacloud/eflo/model/DeleteVpdRequest.h
  30. include/alibabacloud/eflo/model/DeleteVpdResult.h
  31. include/alibabacloud/eflo/model/GetSubnetRequest.h
  32. include/alibabacloud/eflo/model/GetSubnetResult.h
  33. include/alibabacloud/eflo/model/GetVccRequest.h
  34. include/alibabacloud/eflo/model/GetVccResult.h
  35. include/alibabacloud/eflo/model/GetVpdRequest.h
  36. include/alibabacloud/eflo/model/GetVpdResult.h
  37. include/alibabacloud/eflo/model/InitializeVccRequest.h
  38. include/alibabacloud/eflo/model/InitializeVccResult.h
  39. include/alibabacloud/eflo/model/ListSubnetsRequest.h
  40. include/alibabacloud/eflo/model/ListSubnetsResult.h
  41. include/alibabacloud/eflo/model/ListVccsRequest.h
  42. include/alibabacloud/eflo/model/ListVccsResult.h
  43. include/alibabacloud/eflo/model/ListVpdsRequest.h
  44. include/alibabacloud/eflo/model/ListVpdsResult.h
  45. include/alibabacloud/eflo/model/UpdateSubnetRequest.h
  46. include/alibabacloud/eflo/model/UpdateSubnetResult.h
  47. include/alibabacloud/eflo/model/UpdateVccRequest.h
  48. include/alibabacloud/eflo/model/UpdateVccResult.h
  49. include/alibabacloud/eflo/model/UpdateVpdRequest.h
  50. include/alibabacloud/eflo/model/UpdateVpdResult.h )
  51. set(eflo_src
  52. src/EfloClient.cc
  53. src/model/CreateSubnetRequest.cc
  54. src/model/CreateSubnetResult.cc
  55. src/model/CreateVccRequest.cc
  56. src/model/CreateVccResult.cc
  57. src/model/CreateVpdRequest.cc
  58. src/model/CreateVpdResult.cc
  59. src/model/DeleteSubnetRequest.cc
  60. src/model/DeleteSubnetResult.cc
  61. src/model/DeleteVpdRequest.cc
  62. src/model/DeleteVpdResult.cc
  63. src/model/GetSubnetRequest.cc
  64. src/model/GetSubnetResult.cc
  65. src/model/GetVccRequest.cc
  66. src/model/GetVccResult.cc
  67. src/model/GetVpdRequest.cc
  68. src/model/GetVpdResult.cc
  69. src/model/InitializeVccRequest.cc
  70. src/model/InitializeVccResult.cc
  71. src/model/ListSubnetsRequest.cc
  72. src/model/ListSubnetsResult.cc
  73. src/model/ListVccsRequest.cc
  74. src/model/ListVccsResult.cc
  75. src/model/ListVpdsRequest.cc
  76. src/model/ListVpdsResult.cc
  77. src/model/UpdateSubnetRequest.cc
  78. src/model/UpdateSubnetResult.cc
  79. src/model/UpdateVccRequest.cc
  80. src/model/UpdateVccResult.cc
  81. src/model/UpdateVpdRequest.cc
  82. src/model/UpdateVpdResult.cc )
  83. add_library(eflo ${LIB_TYPE}
  84. ${eflo_public_header}
  85. ${eflo_public_header_model}
  86. ${eflo_src})
  87. set_target_properties(eflo
  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}eflo
  94. )
  95. if(${LIB_TYPE} STREQUAL "SHARED")
  96. set_target_properties(eflo
  97. PROPERTIES
  98. DEFINE_SYMBOL ALIBABACLOUD_EFLO_LIBRARY)
  99. endif()
  100. target_include_directories(eflo
  101. PRIVATE include
  102. ${CMAKE_SOURCE_DIR}/core/include
  103. )
  104. target_link_libraries(eflo
  105. core)
  106. if(CMAKE_HOST_WIN32)
  107. ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
  108. set(jsoncpp_install_dir ${INSTALL_DIR})
  109. add_dependencies(eflo
  110. jsoncpp)
  111. target_include_directories(eflo
  112. PRIVATE ${jsoncpp_install_dir}/include)
  113. target_link_libraries(eflo
  114. ${jsoncpp_install_dir}/lib/jsoncpp.lib)
  115. set_target_properties(eflo
  116. PROPERTIES
  117. COMPILE_OPTIONS "/bigobj")
  118. else()
  119. target_include_directories(eflo
  120. PRIVATE /usr/include/jsoncpp)
  121. target_link_libraries(eflo
  122. jsoncpp)
  123. endif()
  124. install(FILES ${eflo_public_header}
  125. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/eflo)
  126. install(FILES ${eflo_public_header_model}
  127. DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/eflo/model)
  128. install(TARGETS eflo
  129. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  130. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  131. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  132. )