Skip to content

Instantly share code, notes, and snippets.

@yshui
Last active July 8, 2019 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yshui/f203c379f501cecf4923000bcecc804c to your computer and use it in GitHub Desktop.
Save yshui/f203c379f501cecf4923000bcecc804c to your computer and use it in GitHub Desktop.
meson cmake bug
project('test', 'cpp')
prometheus_cpp = dependency('prometheus-cpp', method: 'cmake', modules: ['prometheus-cpp::core'], static: false)
# 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