vcpkg/ports/prometheus-cpp/portfile.cmake
Gregor Jasny 33f1f0a34d
[prometheus-cpp] Update to version 0.12.1 (#16057)
* [prometheus-cpp] Update to version 0.12.1

* update version

Co-authored-by: Jonliu1993 <13720414433@163.com>
2021-02-11 00:30:31 -08:00

42 lines
1.1 KiB
CMake

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jupp0r/prometheus-cpp
REF 38130aee330377d6289a076628dbe450d59ef3e9 # v0.12.1
SHA512 9daf12f482ba947e28ce0411cb75234865542e2c850d1173de98f2929c3eb8d02c7f38630d060829273ef57da0eee9ce3f3cb21b05abe1da7e64307253d57bba
HEAD_REF master
)
macro(feature FEATURENAME OPTIONNAME)
if("${FEATURENAME}" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS -D${OPTIONNAME}=TRUE)
else()
list(APPEND FEATURE_OPTIONS -D${OPTIONNAME}=FALSE)
endif()
endmacro()
feature(compression ENABLE_COMPRESSION)
feature(pull ENABLE_PULL)
feature(push ENABLE_PUSH)
feature(tests ENABLE_TESTING)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DUSE_THIRDPARTY_LIBRARIES=OFF # use vcpkg packages
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/prometheus-cpp)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)