mirror of https://github.com/oxen-io/oxen-mq.git
cmake work-around for cmake < 3.21
PkgConfig::xyz won't exist before 3.21 if xyz doesn't require any flags (which is common for a system-installed header-only library like oxenc). (CMake bug 22180)
This commit is contained in:
parent
77c4840273
commit
bbdf4af98f
|
@ -76,7 +76,10 @@ elseif(BUILD_SHARED_LIBS)
|
|||
pkg_check_modules(oxenc liboxenc IMPORTED_TARGET)
|
||||
|
||||
if(oxenc_FOUND)
|
||||
target_link_libraries(oxenmq PUBLIC PkgConfig::oxenc)
|
||||
# Work around cmake bug 22180 (PkgConfig::tgt not set if no flags needed)
|
||||
if(TARGET PkgConfig::oxenc OR CMAKE_VERSION VERSION_GREATER_EQUAL "3.21")
|
||||
target_link_libraries(oxenmq PUBLIC PkgConfig::oxenc)
|
||||
endif()
|
||||
else()
|
||||
add_subdirectory(oxen-encoding)
|
||||
target_link_libraries(oxenmq PUBLIC oxenc)
|
||||
|
|
Loading…
Reference in New Issue