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-02-17 08:16:29 +08:00
|
|
|
REF 1.3.58
|
|
|
|
SHA512 755fe3fd9d507a43fb03c1530a979f5a5a2848588ccab39509987043b3d274f27a7b163bf078a006123450ee881fd4a092cd703246f6f669810f47c186c2b0b8
|
2017-09-29 12:34:08 +08:00
|
|
|
HEAD_REF master
|
2016-11-28 19:15:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/drop_git.patch
|
2017-02-04 11:18:04 +08:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/disable_warning_as_error.patch
|
2016-11-28 19:15:42 +08:00
|
|
|
)
|
|
|
|
|
2016-12-07 05:58:04 +08:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL static)
|
2016-11-30 23:06:00 +08:00
|
|
|
set(FORCE_SHARED_CRT OFF)
|
2016-12-01 10:27:27 +08:00
|
|
|
else()
|
|
|
|
set(FORCE_SHARED_CRT ON)
|
2016-11-30 23:03:49 +08:00
|
|
|
endif()
|
|
|
|
|
2016-11-28 19:15:42 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-02-24 10:36:47 +08:00
|
|
|
PREFER_NINJA
|
2016-11-30 23:03:49 +08:00
|
|
|
OPTIONS
|
|
|
|
-DENABLE_TESTING=OFF
|
|
|
|
-DFORCE_SHARED_CRT=${FORCE_SHARED_CRT}
|
2016-11-28 19:15:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2017-09-29 12:34:08 +08:00
|
|
|
file(GLOB CMAKE_FILES ${CURRENT_PACKAGES_DIR}/lib/cmake/*)
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/share)
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(GLOB AWS_TARGETS "${CURRENT_PACKAGES_DIR}/share/aws-cpp-sdk-*/aws-cpp-sdk-*targets.cmake")
|
|
|
|
foreach(AWS_TARGETS ${AWS_TARGETS})
|
|
|
|
file(READ ${AWS_TARGETS} _contents)
|
|
|
|
string(REGEX REPLACE
|
|
|
|
"get_filename_component\\(_IMPORT_PREFIX \"\\\${CMAKE_CURRENT_LIST_FILE}\" PATH\\)(\nget_filename_component\\(_IMPORT_PREFIX \"\\\${_IMPORT_PREFIX}\" PATH\\))*"
|
|
|
|
"get_filename_component(_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
|
|
|
|
_contents "${_contents}")
|
|
|
|
file(WRITE ${AWS_TARGETS} "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
file(GLOB AWS_TARGETS_RELEASE "${CURRENT_PACKAGES_DIR}/share/aws-cpp-sdk-*/aws-cpp-sdk-*targets-release.cmake")
|
|
|
|
foreach(AWS_TARGETS_RELEASE ${AWS_TARGETS_RELEASE})
|
|
|
|
file(READ ${AWS_TARGETS_RELEASE} _contents)
|
|
|
|
string(REGEX REPLACE
|
|
|
|
"bin\\/([A-Za-z0-9_.-]+lib)"
|
|
|
|
"lib/\\1"
|
|
|
|
_contents "${_contents}")
|
|
|
|
file(WRITE ${AWS_TARGETS_RELEASE} "${_contents}")
|
|
|
|
endforeach()
|
|
|
|
|
2016-11-28 23:03:26 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/include
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/cmake
|
|
|
|
${CURRENT_PACKAGES_DIR}/lib/pkgconfig
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/cmake
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig
|
|
|
|
${CURRENT_PACKAGES_DIR}/nuget
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/nuget)
|
|
|
|
|
2016-12-07 05:58:04 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2016-11-29 11:04:32 +08:00
|
|
|
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*.lib)
|
|
|
|
file(GLOB DEBUG_LIB_FILES ${CURRENT_PACKAGES_DIR}/debug/bin/*.lib)
|
|
|
|
file(COPY ${LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
|
|
|
|
file(COPY ${DEBUG_LIB_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
|
|
|
|
file(REMOVE ${LIB_FILES} ${DEBUG_LIB_FILES})
|
2016-12-01 10:23:35 +08:00
|
|
|
|
2017-02-04 11:18:04 +08:00
|
|
|
file(APPEND ${CURRENT_PACKAGES_DIR}/include/aws/core/SDKConfig.h "#define USE_IMPORT_EXPORT")
|
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)
|