mirror of
https://github.com/oxen-io/oxen-mq.git
synced 2023-12-13 21:00:31 +01:00
Move -isystem hack inside if-found
This was breaking if we didn't find libzmq (or didn't find recent enough) because the target didn't exist.
This commit is contained in:
parent
e5a8d09127
commit
e072e68d84
1 changed files with 10 additions and 9 deletions
|
@ -47,17 +47,18 @@ if(TARGET libzmq)
|
|||
elseif(BUILD_SHARED_LIBS)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(libzmq libzmq>=4.3 IMPORTED_TARGET)
|
||||
# Debian sid includes a -isystem in the mit-krb package that, starting with pkg-config 0.29.2,
|
||||
# breaks cmake's pkgconfig module because it stupidly thinks "-isystem" is a path, so if we find
|
||||
# -isystem in the include dirs then hack it out.
|
||||
get_property(zmq_inc TARGET PkgConfig::libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
list(FIND zmq_inc "-isystem" broken_isystem)
|
||||
if(NOT broken_isystem EQUAL -1)
|
||||
list(REMOVE_AT zmq_inc ${broken_isystem})
|
||||
set_property(TARGET PkgConfig::libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${zmq_inc})
|
||||
endif()
|
||||
|
||||
if(libzmq_FOUND)
|
||||
# Debian sid includes a -isystem in the mit-krb package that, starting with pkg-config 0.29.2,
|
||||
# breaks cmake's pkgconfig module because it stupidly thinks "-isystem" is a path, so if we find
|
||||
# -isystem in the include dirs then hack it out.
|
||||
get_property(zmq_inc TARGET PkgConfig::libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
list(FIND zmq_inc "-isystem" broken_isystem)
|
||||
if(NOT broken_isystem EQUAL -1)
|
||||
list(REMOVE_AT zmq_inc ${broken_isystem})
|
||||
set_property(TARGET PkgConfig::libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${zmq_inc})
|
||||
endif()
|
||||
|
||||
target_link_libraries(lokimq PUBLIC PkgConfig::libzmq)
|
||||
else()
|
||||
set(lokimq_build_static_libzmq ON)
|
||||
|
|
Loading…
Reference in a new issue