# Author: # Sven Czarnian # License: # GPLv3 # Brief: # Creates the 3rd-party import targets # include the external project library INCLUDE(ExternalProject) # define the import target of libcurl ADD_LIBRARY(libcurl STATIC IMPORTED) IF (MSVC) SET_TARGET_PROPERTIES(libcurl PROPERTIES IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libcurl-d.lib" IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libcurl.lib" ) TARGET_LINK_LIBRARIES(libcurl INTERFACE Ws2_32 Iphlpapi Crypt32) TARGET_INCLUDE_DIRECTORIES(libcurl INTERFACE "${CMAKE_SOURCE_DIR}/external/include") ELSE () MESSAGE(FATAL_ERROR "Unsupported compiler") ENDIF () # define the import target of GeographicLib ADD_LIBRARY(GeographicLib STATIC IMPORTED) IF (MSVC) SET_TARGET_PROPERTIES(GeographicLib PROPERTIES IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/Geographic_d.lib" IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/Geographic.lib" ) TARGET_INCLUDE_DIRECTORIES(GeographicLib INTERFACE "${CMAKE_SOURCE_DIR}/external/include") ELSE () MESSAGE(FATAL_ERROR "Unsupported compiler") ENDIF () # define the import target of libsodium ADD_LIBRARY(libsodium STATIC IMPORTED) IF (MSVC) SET_TARGET_PROPERTIES(libsodium PROPERTIES 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") ENDIF () # define the import target of libcurl ADD_LIBRARY(jsoncpp STATIC IMPORTED) IF (MSVC) SET_TARGET_PROPERTIES(jsoncpp PROPERTIES IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/jsoncpp_d.lib" IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/jsoncpp.lib" ) TARGET_INCLUDE_DIRECTORIES(jsoncpp INTERFACE "${CMAKE_SOURCE_DIR}/external/include") ELSE () MESSAGE(FATAL_ERROR "Unsupported compiler") ENDIF () # define the import target of libzmq ADD_LIBRARY(libzmq STATIC IMPORTED) ADD_DEPENDENCIES(libzmq libsodium) IF (MSVC) SET_TARGET_PROPERTIES(libzmq PROPERTIES IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libzmqd.lib" 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 () # 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 ADD_LIBRARY(GSL INTERFACE) TARGET_INCLUDE_DIRECTORIES(GSL INTERFACE "${CMAKE_SOURCE_DIR}/external/include") # define the import target of Eigen ADD_LIBRARY(Eigen INTERFACE) TARGET_INCLUDE_DIRECTORIES(Eigen INTERFACE "${CMAKE_SOURCE_DIR}/external/include/eigen3") # define the import target of protobuf ADD_LIBRARY(protobuf STATIC IMPORTED) IF (MSVC) SET_TARGET_PROPERTIES(protobuf PROPERTIES IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libprotobufd.lib" IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libprotobuf.lib" ) TARGET_INCLUDE_DIRECTORIES(protobuf INTERFACE "${CMAKE_SOURCE_DIR}/external/include") ELSE () MESSAGE(FATAL_ERROR "Unsupported compiler") ENDIF ()