Last active
July 8, 2019 13:51
-
-
Save yshui/f203c379f501cecf4923000bcecc804c to your computer and use it in GitHub Desktop.
meson cmake bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project('test', 'cpp') | |
prometheus_cpp = dependency('prometheus-cpp', method: 'cmake', modules: ['prometheus-cpp::core'], static: false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this here: /usr/lib/cmake/prometheus-cpp/prometheus-cpp-config.cmake | |
set(PACKAGE_PREFIX_DIR "/usr") | |
include(CMakeFindDependencyMacro) | |
set(prometheus-cpp_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include") | |
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) | |
find_dependency(Threads) | |
unset(CMAKE_THREAD_PREFER_PTHREAD) | |
set(CMAKE_IMPORT_FILE_VERSION 1) | |
set(_IMPORT_PREFIX "/usr") | |
add_library(prometheus-cpp::core STATIC IMPORTED) | |
set_target_properties(prometheus-cpp::core PROPERTIES | |
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" | |
INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:\$<\$<AND:\$<BOOL:UNIX>,\$<NOT:\$<BOOL:APPLE>>>:rt>>" | |
) | |
set_property(TARGET prometheus-cpp::core APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) | |
set_target_properties(prometheus-cpp::core PROPERTIES | |
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" | |
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libprometheus-cpp-core.a" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment