add dependent libraries

This commit is contained in:
Sven Czarnian
2021-08-16 16:46:50 +02:00
parent 5a5825e1e4
commit 804213317c

View File

@@ -15,6 +15,7 @@ IF (MSVC)
IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libsodiumd.lib"
IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libsodium.lib"
)
TARGET_LINK_LIBRARIES(libsodium INTERFACE Ws2_32 Iphlpapi)
TARGET_INCLUDE_DIRECTORIES(libsodium INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
ELSE ()
MESSAGE(FATAL_ERROR "Unsupported compiler")
@@ -29,6 +30,8 @@ IF (MSVC)
IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libzmq.lib"
)
TARGET_INCLUDE_DIRECTORIES(libzmq INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
TARGET_LINK_LIBRARIES(libzmq INTERFACE libsodium)
TARGET_COMPILE_OPTIONS(libzmq INTERFACE /DZMQ_STATIC)
ELSE ()
MESSAGE(FATAL_ERROR "Unsupported compiler")
ENDIF ()
@@ -36,6 +39,7 @@ ENDIF ()
# define the import target of cppzmq
ADD_LIBRARY(cppzmq INTERFACE)
TARGET_INCLUDE_DIRECTORIES(cppzmq INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
TARGET_LINK_LIBRARIES(cppzmq INTERFACE libzmq)
ADD_DEPENDENCIES(cppzmq libzmq)
# define the import target of GSL