2016-11-11 11:04:45 +08:00
|
|
|
#if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
# message(STATUS "Warning: Dynamic building not supported yet. Building static.")
|
|
|
|
# set(VCPKG_LIBRARY_LINKAGE static)
|
|
|
|
#endif()
|
2016-09-22 00:45:16 +08:00
|
|
|
include(vcpkg_common_functions)
|
2016-11-22 03:39:50 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/fmt-3.0.1)
|
2016-09-22 00:45:16 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2016-11-22 03:39:50 +08:00
|
|
|
URLS "https://github.com/fmtlib/fmt/archive/3.0.1.tar.gz"
|
|
|
|
FILENAME "fmt-3.0.1.tar.gz"
|
|
|
|
SHA512 daf5dfb2fe63eb611983fa248bd2182c6202cf1c4f0fc236f357040fce8e87ad531cdf59090306bb313ea333d546e516f467b385e05094e696d0ca091310aad6
|
2016-09-22 00:45:16 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
|
|
|
|
|
|
|
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-11-23 04:51:35 +08:00
|
|
|
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
|
2016-09-22 00:45:16 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2016-09-29 08:05:56 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.rst DESTINATION ${CURRENT_PACKAGES_DIR}/share/fmt RENAME copyright)
|
2016-11-11 11:04:45 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmt.dll)
|
|
|
|
|
2017-02-10 09:23:15 +08:00
|
|
|
# Force FMT_SHARED to 1
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/format.h FMT_FORMAT_H)
|
|
|
|
string(REPLACE "defined(FMT_SHARED)" "1" FMT_FORMAT_H "${FMT_FORMAT_H}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/format.h "${FMT_FORMAT_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-01-11 08:02:53 +08:00
|
|
|
#file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/format.cc)
|
|
|
|
#file(REMOVE ${CURRENT_PACKAGES_DIR}/include/fmt/ostream.cc)
|
2016-11-11 11:04:45 +08:00
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/fmt/fmt-targets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE)
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" FMT_DEBUG_MODULE "${FMT_DEBUG_MODULE}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}")
|
2016-11-23 04:51:35 +08:00
|
|
|
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE)
|
|
|
|
string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE})
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}")
|
|
|
|
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}")
|
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()
|