2016-10-11 20:45:43 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-05-28 20:28:34 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/double-conversion
|
2017-08-06 07:10:48 +08:00
|
|
|
REF v3.0.0
|
|
|
|
SHA512 5057af6e72f2aaace56ebdd9a0ddfa34318cbdfeabec5c361b60e6c92f160c8999c046c50f8c6f8d590eb8e97aa70bb6e97ba8148f0dc95dbc42f204fcdc1abf
|
2017-05-28 20:28:34 +08:00
|
|
|
HEAD_REF master
|
2016-10-11 20:45:43 +08:00
|
|
|
)
|
2017-05-23 17:31:09 +08:00
|
|
|
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PATCHES ${CMAKE_CURRENT_LIST_DIR}/001-fix-arm.patch
|
|
|
|
)
|
|
|
|
|
2017-05-28 20:28:34 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-08-06 07:10:48 +08:00
|
|
|
PREFER_NINJA
|
2017-05-28 20:28:34 +08:00
|
|
|
OPTIONS
|
2017-08-06 07:10:48 +08:00
|
|
|
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=True
|
2017-05-28 20:28:34 +08:00
|
|
|
)
|
|
|
|
|
2016-11-02 05:37:15 +08:00
|
|
|
vcpkg_install_cmake()
|
2017-05-28 20:28:34 +08:00
|
|
|
|
2017-08-06 07:10:48 +08:00
|
|
|
# Rename exported target files into something vcpkg_fixup_cmake_targets expects
|
2018-03-22 02:34:24 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/double-conversion)
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/double-conversion)
|
|
|
|
endif()
|
2017-10-31 17:14:39 +08:00
|
|
|
if(NOT VCPKG_USE_HEAD_VERSION)
|
2018-03-12 14:41:51 +08:00
|
|
|
if(EXISTS ${CURRENT_PACKAGES_DIR}/CMake)
|
2018-03-20 06:35:55 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/CMake/double-conversionLibraryDepends-debug.cmake
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/CMake/double-conversionTargets-debug.cmake)
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/CMake/double-conversionLibraryDepends-release.cmake
|
|
|
|
${CURRENT_PACKAGES_DIR}/CMake/double-conversionTargets-release.cmake)
|
|
|
|
endif()
|
2018-03-12 14:41:51 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/CMake/double-conversionLibraryDepends.cmake
|
|
|
|
${CURRENT_PACKAGES_DIR}/CMake/double-conversionTargets.cmake)
|
|
|
|
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/CMake/double-conversionTargets.cmake TARGETS_FILE)
|
|
|
|
string(REPLACE "double-conversionLibraryDepends" "double-conversionTargets" TARGETS_FILE "${TARGETS_FILE}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/CMake/double-conversionTargets.cmake "${TARGETS_FILE}")
|
|
|
|
|
|
|
|
# Remove hardcoded paths from config file
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/CMake/double-conversionConfig.cmake CONFIG_FILE)
|
|
|
|
string(REPLACE "${CURRENT_PACKAGES_DIR}/lib/cmake/double-conversion/double-conversionLibraryDepends.cmake"
|
|
|
|
"\${double-conversion_CMAKE_DIR}/double-conversionTargets.cmake" CONFIG_FILE "${CONFIG_FILE}")
|
|
|
|
string(REPLACE "${CURRENT_PACKAGES_DIR}"
|
|
|
|
"\${double-conversion_CMAKE_DIR}/../.." CONFIG_FILE "${CONFIG_FILE}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/CMake/double-conversionConfig.cmake "${CONFIG_FILE}")
|
|
|
|
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH CMake)
|
|
|
|
endif()
|
2017-11-03 02:42:32 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2017-10-31 17:14:39 +08:00
|
|
|
endif()
|
2016-10-11 20:45:43 +08:00
|
|
|
|
2017-05-28 20:28:34 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2016-10-11 20:45:43 +08:00
|
|
|
|
|
|
|
# Include files should not be duplicated into the /debug/include directory.
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
# Handle copyright
|
2016-10-13 05:03:45 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/double-conversion)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/double-conversion/LICENSE ${CURRENT_PACKAGES_DIR}/share/double-conversion/copyright)
|