2017-06-15 06:55:26 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO fmtlib/fmt
|
2020-04-09 10:25:59 +08:00
|
|
|
REF 9bdd1596cef1b57b9556f8bef32dc4a32322ef3e#version 6.2.0
|
|
|
|
SHA512 3639b4984a88fc5495c6cb1a0a09bb0a13f5dc05286f5a2b15e60dfda780bcc1fe213497006cc27247c3c358be27d8af4dd995db2b3de0f6a5a1288dc1058585
|
2017-06-15 06:55:26 +08:00
|
|
|
HEAD_REF master
|
2020-01-07 06:46:57 +08:00
|
|
|
PATCHES fix-warning4189.patch
|
2016-09-22 00:45:16 +08:00
|
|
|
)
|
|
|
|
vcpkg_configure_cmake(
|
2016-09-29 08:05:56 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-02-04 00:16:13 +08:00
|
|
|
PREFER_NINJA
|
2016-09-22 00:45:16 +08:00
|
|
|
OPTIONS
|
2016-11-11 11:04:45 +08:00
|
|
|
-DFMT_CMAKE_DIR=share/fmt
|
2016-09-22 00:45:16 +08:00
|
|
|
-DFMT_TEST=OFF
|
2016-09-30 02:17:57 +08:00
|
|
|
-DFMT_DOC=OFF
|
2016-09-22 00:45:16 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2020-04-09 10:25:59 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2016-11-11 11:04:45 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2020-04-09 10:25:59 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2019-08-28 01:52:40 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
2020-03-03 01:35:36 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll)
|
|
|
|
endif()
|
2019-08-28 01:52:40 +08:00
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
2020-03-03 01:35:36 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/fmt.dll")
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll)
|
|
|
|
endif()
|
2019-08-28 01:52:40 +08:00
|
|
|
endif()
|
2019-05-21 01:24:51 +08:00
|
|
|
endif()
|
2016-11-11 11:04:45 +08:00
|
|
|
|
2017-02-10 09:23:15 +08:00
|
|
|
# Force FMT_SHARED to 1
|
2018-05-23 02:44:33 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/core.h FMT_CORE_H)
|
|
|
|
string(REPLACE "defined(FMT_SHARED)" "1" FMT_CORE_H "${FMT_CORE_H}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/core.h "${FMT_CORE_H}")
|
2016-11-11 11:04:45 +08:00
|
|
|
endif()
|
2016-09-22 00:45:16 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2017-06-15 06:55:26 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_cmake_targets()
|
2020-06-03 13:37:50 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2016-11-23 04:51:35 +08:00
|
|
|
|
2020-04-09 10:25:59 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2019-08-28 01:52:40 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE)
|
|
|
|
string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE})
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}")
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE)
|
|
|
|
string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE})
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake "${FMT_RELEASE_MODULE}")
|
|
|
|
endif()
|
2019-05-21 01:24:51 +08:00
|
|
|
endif()
|
2016-11-11 11:04:45 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2016-09-22 00:45:16 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|