mirror of https://github.com/oxen-io/oxen-mq.git
Fix use of parent oxenc::oxenc target
oxen-mq's export command errored when using a parent oxenc target in a submodule oxen-mq; add an intermediate IMPORTED target so that cmake knows it doesn't have to export the oxenc dependency as well.
This commit is contained in:
parent
c4b7aa9b23
commit
4671af3ca0
|
@ -69,8 +69,11 @@ find_package(Threads REQUIRED)
|
|||
target_link_libraries(oxenmq PRIVATE Threads::Threads)
|
||||
|
||||
|
||||
if(TARGET oxenc)
|
||||
target_link_libraries(oxenmq PUBLIC oxenc)
|
||||
if(TARGET oxenc::oxenc)
|
||||
add_library(_oxenmq_external_oxenc INTERFACE IMPORTED)
|
||||
target_link_libraries(_oxenmq_external_oxenc INTERFACE oxenc::oxenc)
|
||||
target_link_libraries(oxenmq INTERFACE _oxenmq_external_oxenc)
|
||||
message(STATUS "using pre-existing oxenc::oxenc target")
|
||||
elseif(BUILD_SHARED_LIBS)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(oxenc liboxenc IMPORTED_TARGET)
|
||||
|
@ -82,11 +85,11 @@ elseif(BUILD_SHARED_LIBS)
|
|||
endif()
|
||||
else()
|
||||
add_subdirectory(oxen-encoding)
|
||||
target_link_libraries(oxenmq PUBLIC oxenc)
|
||||
target_link_libraries(oxenmq PUBLIC oxenc::oxenc)
|
||||
endif()
|
||||
else()
|
||||
add_subdirectory(oxen-encoding)
|
||||
target_link_libraries(oxenmq PUBLIC oxenc)
|
||||
target_link_libraries(oxenmq PUBLIC oxenc::oxenc)
|
||||
endif()
|
||||
|
||||
# libzmq is nearly impossible to link statically from a system-installed static library: it depends
|
||||
|
|
Loading…
Reference in New Issue