cmake workarround for quark in older cmake where pkg config produces non existing targets

pull/1865/head
Jeff 2 years ago
parent 6f46fe7e0c
commit 6629e8c881

@ -183,8 +183,15 @@ option(FORCE_OXENC_SUBMODULE "force using oxen-encoding submodule" OFF)
if(NOT FORCE_OXENC_SUBMODULE)
pkg_check_modules(OXENC liboxenc>=1.0.1 IMPORTED_TARGET)
endif()
if(OXENC_FOUND)
add_library(oxenc::oxenc ALIAS PkgConfig::OXENC)
if(NOT TARGET PkgConfig::OXENC AND CMAKE_VERSION VERSION_LESS "3.21")
# Work around cmake bug 22180 (PkgConfig::OXENC not set if no flags needed):
add_library(_empty_oxenc INTERFACE)
add_library(oxenc::oxenc ALIAS _empty_oxenc)
else()
add_library(oxenc::oxenc ALIAS PkgConfig::OXENC)
endif()
message(STATUS "Found system liboxenc ${OXENC_VERSION}")
else()
message(STATUS "using oxen-encoding submodule")

Loading…
Cancel
Save