3rdPartyTargets.cmake 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 libcurl
  10. ADD_LIBRARY(libcurl STATIC IMPORTED)
  11. IF (MSVC)
  12. SET_TARGET_PROPERTIES(libcurl PROPERTIES
  13. IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libcurl-d.lib"
  14. IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libcurl.lib"
  15. )
  16. TARGET_LINK_LIBRARIES(libcurl INTERFACE Ws2_32 Iphlpapi Crypt32)
  17. TARGET_INCLUDE_DIRECTORIES(libcurl INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  18. ELSE ()
  19. MESSAGE(FATAL_ERROR "Unsupported compiler")
  20. ENDIF ()
  21. # define the import target of GeographicLib
  22. ADD_LIBRARY(GeographicLib STATIC IMPORTED)
  23. IF (MSVC)
  24. SET_TARGET_PROPERTIES(GeographicLib PROPERTIES
  25. IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/Geographic_d.lib"
  26. IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/Geographic.lib"
  27. )
  28. TARGET_INCLUDE_DIRECTORIES(GeographicLib INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  29. ELSE ()
  30. MESSAGE(FATAL_ERROR "Unsupported compiler")
  31. ENDIF ()
  32. # define the import target of libsodium
  33. ADD_LIBRARY(libsodium STATIC IMPORTED)
  34. IF (MSVC)
  35. SET_TARGET_PROPERTIES(libsodium PROPERTIES
  36. IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libsodiumd.lib"
  37. IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libsodium.lib"
  38. )
  39. TARGET_LINK_LIBRARIES(libsodium INTERFACE Ws2_32 Iphlpapi)
  40. TARGET_INCLUDE_DIRECTORIES(libsodium INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  41. ELSE ()
  42. MESSAGE(FATAL_ERROR "Unsupported compiler")
  43. ENDIF ()
  44. # define the import target of libcurl
  45. ADD_LIBRARY(jsoncpp STATIC IMPORTED)
  46. IF (MSVC)
  47. SET_TARGET_PROPERTIES(jsoncpp PROPERTIES
  48. IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/jsoncpp_d.lib"
  49. IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/jsoncpp.lib"
  50. )
  51. TARGET_INCLUDE_DIRECTORIES(jsoncpp INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  52. ELSE ()
  53. MESSAGE(FATAL_ERROR "Unsupported compiler")
  54. ENDIF ()
  55. # define the import target of libzmq
  56. ADD_LIBRARY(libzmq STATIC IMPORTED)
  57. ADD_DEPENDENCIES(libzmq libsodium)
  58. IF (MSVC)
  59. SET_TARGET_PROPERTIES(libzmq PROPERTIES
  60. IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libzmqd.lib"
  61. IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libzmq.lib"
  62. )
  63. TARGET_INCLUDE_DIRECTORIES(libzmq INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  64. TARGET_LINK_LIBRARIES(libzmq INTERFACE libsodium)
  65. TARGET_COMPILE_OPTIONS(libzmq INTERFACE /DZMQ_STATIC)
  66. ELSE ()
  67. MESSAGE(FATAL_ERROR "Unsupported compiler")
  68. ENDIF ()
  69. # define the import target of cppzmq
  70. ADD_LIBRARY(cppzmq INTERFACE)
  71. TARGET_INCLUDE_DIRECTORIES(cppzmq INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  72. TARGET_LINK_LIBRARIES(cppzmq INTERFACE libzmq)
  73. ADD_DEPENDENCIES(cppzmq libzmq)
  74. # define the import target of GSL
  75. ADD_LIBRARY(GSL INTERFACE)
  76. TARGET_INCLUDE_DIRECTORIES(GSL INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  77. # define the import target of Eigen
  78. ADD_LIBRARY(Eigen INTERFACE)
  79. TARGET_INCLUDE_DIRECTORIES(Eigen INTERFACE "${CMAKE_SOURCE_DIR}/external/include/eigen3")
  80. # define the import target of protobuf
  81. ADD_LIBRARY(protobuf STATIC IMPORTED)
  82. IF (MSVC)
  83. SET_TARGET_PROPERTIES(protobuf PROPERTIES
  84. IMPORTED_LOCATION_DEBUG "${CMAKE_SOURCE_DIR}/external/lib/libprotobufd.lib"
  85. IMPORTED_LOCATION_RELEASE "${CMAKE_SOURCE_DIR}/external/lib/libprotobuf.lib"
  86. )
  87. TARGET_INCLUDE_DIRECTORIES(protobuf INTERFACE "${CMAKE_SOURCE_DIR}/external/include")
  88. ELSE ()
  89. MESSAGE(FATAL_ERROR "Unsupported compiler")
  90. ENDIF ()