3rdPartyTargets.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 GSL
  37. ADD_LIBRARY(GSL INTERFACE)
  38. TARGET_INCLUDE_DIRECTORIES(GSL INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  39. # define the import target of protobuf
  40. ADD_LIBRARY(protobuf STATIC IMPORTED)
  41. IF (MSVC)
  42. SET_TARGET_PROPERTIES(protobuf PROPERTIES
  43. IMPORTED_LOCATION_DEBUG "${CMAKE_INSTALL_PREFIX}/lib/libprotobufd.lib"
  44. IMPORTED_LOCATION_RELEASE "${CMAKE_INSTALL_PREFIX}/lib/libprotobuf.lib"
  45. )
  46. TARGET_INCLUDE_DIRECTORIES(protobuf INTERFACE "${CMAKE_INSTALL_PREFIX}/include")
  47. ELSE ()
  48. MESSAGE(FATAL_ERROR "Unsupported compiler")
  49. ENDIF ()