2016-11-28 19:15:42 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-09-29 12:34:08 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO aws/aws-sdk-cpp
|
2018-05-02 06:55:59 +08:00
|
|
|
REF 1.4.40
|
|
|
|
SHA512 1c97820fa6239a8907c7c053bdfb3f3091121c6928c2c25a86a0263c26231bf08c1928d16e86c863d9cedfd6faf6f6f65234a22188dd14e61a2d452445c33b59
|
2017-09-29 12:34:08 +08:00
|
|
|
HEAD_REF master
|
2016-11-28 19:15:42 +08:00
|
|
|
)
|
|
|
|
|
2018-03-25 04:08:06 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" FORCE_SHARED_CRT)
|
2016-11-28 19:15:42 +08:00
|
|
|
|
2018-03-25 04:08:06 +08:00
|
|
|
set(BUILD_ONLY core)
|
|
|
|
|
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/compute_build_only.cmake)
|
|
|
|
|
2018-04-06 09:46:09 +08:00
|
|
|
if(CMAKE_HOST_WIN32)
|
|
|
|
string(REPLACE ";" "\\\\\\;" BUILD_ONLY "${BUILD_ONLY}")
|
|
|
|
else()
|
|
|
|
string(REPLACE ";" "\\\\\\\\\\\;" BUILD_ONLY "${BUILD_ONLY}")
|
|
|
|
endif()
|
2016-11-30 23:03:49 +08:00
|
|
|
|
2016-11-28 19:15:42 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-03-25 04:08:06 +08:00
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DENABLE_UNITY_BUILD=ON
|
|
|
|
-DENABLE_TESTING=OFF
|
|
|
|
-DFORCE_SHARED_CRT=${FORCE_SHARED_CRT}
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE
|
|
|
|
"-DBUILD_ONLY=${BUILD_ONLY}"
|
2016-11-28 19:15:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2018-03-25 04:08:06 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share)
|
2017-09-29 12:34:08 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2018-03-25 04:08:06 +08:00
|
|
|
file(GLOB_RECURSE AWS_TARGETS "${CURRENT_PACKAGES_DIR}/share/*/*-targets-*.cmake")
|
|
|
|
foreach(AWS_TARGET IN LISTS AWS_TARGETS)
|
|
|
|
file(READ ${AWS_TARGET} _contents)
|
2017-09-29 12:34:08 +08:00
|
|
|
string(REGEX REPLACE
|
2018-03-25 04:08:06 +08:00
|
|
|
"bin\\/([A-Za-z0-9_.-]+\\.lib)"
|
|
|
|
"lib/\\1"
|
2017-09-29 12:34:08 +08:00
|
|
|
_contents "${_contents}")
|
2018-03-25 04:08:06 +08:00
|
|
|
file(WRITE ${AWS_TARGET} "${_contents}")
|
2017-09-29 12:34:08 +08:00
|
|
|
endforeach()
|
|
|
|
|
2018-03-25 04:08:06 +08:00
|
|
|
file(GLOB AWS_CONFIGS "${CURRENT_PACKAGES_DIR}/share/*/aws-cpp-sdk-*-config.cmake")
|
|
|
|
list(FILTER AWS_CONFIGS EXCLUDE REGEX "aws-cpp-sdk-core-config\\.cmake\$")
|
|
|
|
foreach(AWS_CONFIG IN LISTS AWS_CONFIGS)
|
|
|
|
file(READ "${AWS_CONFIG}" _contents)
|
|
|
|
file(WRITE "${AWS_CONFIG}" "include(CMakeFindDependencyMacro)\nfind_dependency(aws-cpp-sdk-core)\n${_contents}")
|
2017-09-29 12:34:08 +08:00
|
|
|
endforeach()
|
|
|
|
|
2018-03-25 04:08:06 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/include
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/share
|
|
|
|
${CURRENT_PACKAGES_DIR}/share/AWSSDK
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/pkgconfig
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig
|
|
|
|
${CURRENT_PACKAGES_DIR}/nuget
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/nuget
|
|
|
|
)
|
2016-11-28 23:03:26 +08:00
|
|
|
|
2016-12-07 05:58:04 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2018-03-25 04:08:06 +08:00
|
|
|
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib)
|
|
|
|
if(LIB_FILES)
|
|
|
|
file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
|
|
|
file(REMOVE ${LIB_FILES})
|
|
|
|
endif()
|
|
|
|
file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib)
|
|
|
|
if(DEBUG_LIB_FILES)
|
|
|
|
file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
file(REMOVE ${DEBUG_LIB_FILES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(APPEND ${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h "#ifndef USE_IMPORT_EXPORT\n#define USE_IMPORT_EXPORT\n#endif")
|
2016-11-29 11:04:32 +08:00
|
|
|
endif()
|
2016-11-28 23:03:26 +08:00
|
|
|
|
2016-11-28 19:15:42 +08:00
|
|
|
# Handle copyright
|
2017-09-26 06:10:21 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/aws-sdk-cpp RENAME copyright)
|