vcpkg/ports/fmt/portfile.cmake

64 lines
2.3 KiB
CMake
Raw Normal View History

2017-06-15 00:55:26 +02:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fmtlib/fmt
2020-11-30 13:42:58 -05:00
REF 7bdf0628b1276379886c7f6dda2cef2b3b374f0b # v7.1.3
SHA512 52ea8f9d2c0cb52ec3a740e38fcdfd6a0318566e3b599bd2e8d557168642d005c0a59bc213cff2641a88fed3bb771d15f46c39035ccd64809569af982aba47aa
2017-06-15 00:55:26 +02:00
HEAD_REF master
PATCHES fix-warning4189.patch
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
2016-11-10 22:04:45 -05:00
-DFMT_CMAKE_DIR=share/fmt
-DFMT_TEST=OFF
-DFMT_DOC=OFF
)
vcpkg_cmake_install()
2020-04-09 02:25:59 +00:00
file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
2016-11-10 22:04:45 -05:00
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
2020-04-09 02:25:59 +00:00
if(VCPKG_TARGET_IS_WINDOWS)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
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()
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
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()
endif()
endif()
2016-11-10 22:04:45 -05:00
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h
"defined(FMT_SHARED)"
"1"
)
2016-11-10 22:04:45 -05:00
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
2017-06-15 00:55:26 +02:00
vcpkg_cmake_config_fixup()
vcpkg_fixup_pkgconfig()
2016-11-22 15:51:35 -05:00
2020-04-09 02:25:59 +00:00
if(VCPKG_TARGET_IS_WINDOWS)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake
"lib/fmtd.dll"
"bin/fmtd.dll"
)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake
"lib/fmt.dll"
"bin/fmt.dll"
)
endif()
endif()
2016-11-10 22:04:45 -05:00
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# Handle post-build CMake instructions
vcpkg_copy_pdbs()
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})