2017-06-15 06:55:26 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO fmtlib/fmt
|
2022-10-10 23:40:13 +08:00
|
|
|
REF 9.1.0
|
|
|
|
SHA512 a18442042722dd48e20714ec034a12fcc0576c9af7be5188586970e2edf47529825bdc99af366b1d5891630c8dbf6f63bfa9f012e77ab3d3ed80d1a118e3b2be
|
2017-06-15 06:55:26 +08:00
|
|
|
HEAD_REF master
|
2021-04-08 04:28:15 +08:00
|
|
|
PATCHES
|
|
|
|
fix-write-batch.patch
|
2022-07-06 06:58:12 +08:00
|
|
|
fix-format-conflict.patch
|
2016-09-22 00:45:16 +08:00
|
|
|
)
|
2021-03-19 06:06:03 +08:00
|
|
|
|
2021-03-01 05:17:19 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-09-08 02:55:54 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
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
|
|
|
)
|
|
|
|
|
2021-03-01 05:17:19 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-09-08 02:55:54 +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")
|
2021-09-08 02:55:54 +08:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll")
|
2020-03-03 01:35:36 +08:00
|
|
|
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")
|
2021-09-08 02:55:54 +08:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/fmt.dll" "${CURRENT_PACKAGES_DIR}/bin/fmt.dll")
|
2020-03-03 01:35:36 +08:00
|
|
|
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
|
|
|
|
2020-08-07 08:09:10 +08:00
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h
|
|
|
|
"defined(FMT_SHARED)"
|
|
|
|
"1"
|
|
|
|
)
|
2016-11-11 11:04:45 +08:00
|
|
|
endif()
|
2021-09-08 02:55:54 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2017-06-15 06:55:26 +08:00
|
|
|
|
2021-03-01 05:17:19 +08:00
|
|
|
vcpkg_cmake_config_fixup()
|
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")
|
2020-08-07 08:09:10 +08:00
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake
|
|
|
|
"lib/fmtd.dll"
|
|
|
|
"bin/fmtd.dll"
|
|
|
|
)
|
2019-08-28 01:52:40 +08:00
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
2020-09-05 11:11:41 +08:00
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake
|
2020-08-07 08:09:10 +08:00
|
|
|
"lib/fmt.dll"
|
|
|
|
"bin/fmt.dll"
|
|
|
|
)
|
2019-08-28 01:52:40 +08:00
|
|
|
endif()
|
2019-05-21 01:24:51 +08:00
|
|
|
endif()
|
2021-09-08 02:55:54 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2016-09-22 00:45:16 +08:00
|
|
|
|
2020-10-09 11:53:25 +08:00
|
|
|
# Handle post-build CMake instructions
|
2016-09-22 00:45:16 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-09-08 02:55:54 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|