2016-10-27 10:44:28 +08:00
|
|
|
#header-only library
|
2016-10-12 05:06:50 +08:00
|
|
|
include(vcpkg_common_functions)
|
2017-05-20 19:01:31 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO gabime/spdlog
|
2018-02-22 23:54:18 +08:00
|
|
|
REF v0.16.3
|
|
|
|
SHA512 6e08473825cf97dfb10b0e919b77996c1023bbfb583d851e961ec4a95094e4afffd1fc6f6e7e728ce8c2c69c9fb280c59f8d6494b50224bdf8cc68914ffd21e8
|
2017-05-20 19:01:31 +08:00
|
|
|
HEAD_REF master
|
2016-10-12 05:06:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-02-25 23:57:03 +08:00
|
|
|
PREFER_NINJA
|
2017-02-25 23:52:57 +08:00
|
|
|
OPTIONS
|
|
|
|
-DSPDLOG_BUILD_TESTING=OFF
|
2016-10-12 05:06:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2017-05-20 19:01:31 +08:00
|
|
|
# Move cmake files, ensuring they will be 3 directories up the import prefix
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/spdlog)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/spdlog/ ${CURRENT_PACKAGES_DIR}/share/spdlog/cmake)
|
2016-10-12 05:06:50 +08:00
|
|
|
|
2017-05-20 19:01:31 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)
|
2016-10-12 05:06:50 +08:00
|
|
|
|
2017-02-25 23:52:57 +08:00
|
|
|
# use vcpkg-provided fmt library
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/spdlog/fmt/bundled)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h SPDLOG_TWEAKME_CONTENTS)
|
2017-05-20 19:01:31 +08:00
|
|
|
string(REPLACE "// #define SPDLOG_FMT_EXTERNAL" "#define SPDLOG_FMT_EXTERNAL" SPDLOG_TWEAKME_CONTENTS "${SPDLOG_TWEAKME_CONTENTS}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/spdlog/tweakme.h "${SPDLOG_TWEAKME_CONTENTS}")
|
2017-02-25 23:52:57 +08:00
|
|
|
|
2016-10-12 05:06:50 +08:00
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/spdlog)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/spdlog/LICENSE ${CURRENT_PACKAGES_DIR}/share/spdlog/copyright)
|