3rdPartyTargets.cmake 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Author:
  2. # Sven Czarnian <devel@svcz.de>
  3. # License:
  4. # GPLv3
  5. # Brief:
  6. # Creates the 3rd-party import targets
  7. # include the external project library
  8. INCLUDE(ExternalProject)
  9. # define the import target of libsodium
  10. ADD_LIBRARY(libsodium STATIC IMPORTED)
  11. IF (MSVC)
  12. SET_TARGET_PROPERTIES(libsodium PROPERTIES
  13. IMPORTED_IMPLIB_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libsodiumd.lib"
  14. IMPORTED_IMPLIB_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libsodium.lib"
  15. )
  16. TARGET_INCLUDE_DIRECTORIES(libsodium INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  17. ELSE ()
  18. MESSAGE(FATAL_ERROR "Unsupported compiler")
  19. ENDIF ()
  20. # define the import target of libzmq
  21. ADD_LIBRARY(libzmq STATIC IMPORTED)
  22. ADD_DEPENDENCIES(libzmq libsodium)
  23. IF (MSVC)
  24. SET_TARGET_PROPERTIES(libzmq PROPERTIES
  25. IMPORTED_IMPLIB_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libzmqd.lib"
  26. IMPORTED_IMPLIB_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libzmq.lib"
  27. )
  28. TARGET_INCLUDE_DIRECTORIES(libzmq INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  29. ELSE ()
  30. MESSAGE(FATAL_ERROR "Unsupported compiler")
  31. ENDIF ()
  32. # define the import target of cppzmq
  33. ADD_LIBRARY(cppzmq INTERFACE)
  34. TARGET_INCLUDE_DIRECTORIES(cppzmq INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  35. ADD_DEPENDENCIES(cppzmq libzmq)
  36. # define the import target of protobuf
  37. ADD_LIBRARY(protobuf STATIC IMPORTED)
  38. IF (MSVC)
  39. SET_TARGET_PROPERTIES(protobuf PROPERTIES
  40. IMPORTED_LOCATION_DEBUG "${CMAKE_INSTALL_PREFIX}/lib/libprotobufd.lib"
  41. IMPORTED_LOCATION_RELEASE "${CMAKE_INSTALL_PREFIX}/lib/libprotobuf.lib"
  42. )
  43. TARGET_INCLUDE_DIRECTORIES(protobuf INTERFACE "${CMAKE_INSTALL_PREFIX}/include")
  44. ELSE ()
  45. MESSAGE(FATAL_ERROR "Unsupported compiler")
  46. ENDIF ()