CMakeLists.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Author:
  2. # Sven Czarnian <devel@svcz.de>
  3. # Copyright:
  4. # 2021 Sven Czarnian
  5. # License:
  6. # GNU General Public License (GPLv3)
  7. # Brief:
  8. # Creates the plug-in which is used by Euroscope
  9. ADD_DEFINITIONS(-DCURL_STATICLIB)
  10. # define the Google Protobuf-files
  11. SET(PROTO_FILES
  12. ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/Aircraft.proto
  13. ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/AircraftReport.proto
  14. ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/AircraftSchedule.proto
  15. ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/BaseTypes.proto
  16. ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/Communication.proto
  17. )
  18. # generate the Protobuf C++ files
  19. SET(PROTO_SOURCE_FILES "")
  20. INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
  21. ProtobufCompile("${PROTO_FILES}" PROTO_SOURCE_FILES)
  22. SET(SOURCE_FILES
  23. ArrivalMANagerMain.cpp
  24. PlugIn.cpp
  25. PlugIn.h
  26. RadarScreen.cpp
  27. RadarScreen.h
  28. stdafx.cpp
  29. stdafx.h
  30. )
  31. SET(SOURCE_COM_FILES
  32. com/Backend.cpp
  33. com/ZmqContext.cpp
  34. com/ZmqContext.h
  35. )
  36. SET(SOURCE_CONFIG_FILES
  37. config/CommunicationFileFormat.cpp
  38. config/FileFormat.cpp
  39. config/IdentifierFileFormat.cpp
  40. )
  41. SET(SOURCE_TYPES_FILES
  42. types/ArrivalWaypoint.cpp
  43. types/GeoCoordinate.cpp
  44. )
  45. SET(SOURCE_FILES_RES
  46. ${CMAKE_BINARY_DIR}/ArrivalMANager.rc
  47. ${CMAKE_SOURCE_DIR}/res/resource.h
  48. ${CMAKE_SOURCE_DIR}/res/targetver.h
  49. )
  50. SET(INCLUDE_COM_FILES
  51. ${CMAKE_SOURCE_DIR}/include/aman/com/Backend.h
  52. )
  53. SET(INCLUDE_CONFIG_FILES
  54. ${CMAKE_SOURCE_DIR}/include/aman/config/CommunicationFileFormat.h
  55. ${CMAKE_SOURCE_DIR}/include/aman/config/FileFormat.h
  56. ${CMAKE_SOURCE_DIR}/include/aman/config/IdentifierFileFormat.h
  57. )
  58. SET(INCLUDE_HELPER_FILES
  59. ${CMAKE_SOURCE_DIR}/include/aman/helper/Math.h
  60. ${CMAKE_SOURCE_DIR}/include/aman/helper/String.h
  61. ${CMAKE_SOURCE_DIR}/include/aman/helper/UtcTime.h
  62. )
  63. SET(INCLUDE_TYPES_FILES
  64. ${CMAKE_SOURCE_DIR}/include/aman/types/AltitudeWindData.h
  65. ${CMAKE_SOURCE_DIR}/include/aman/types/ArrivalWaypoint.h
  66. ${CMAKE_SOURCE_DIR}/include/aman/types/Communication.h
  67. ${CMAKE_SOURCE_DIR}/include/aman/types/GeoCoordinate.h
  68. ${CMAKE_SOURCE_DIR}/include/aman/types/Quantity.hpp
  69. )
  70. # define the plug in
  71. ADD_LIBRARY(
  72. ArrivalMANager SHARED
  73. ${SOURCE_FILES_RES}
  74. ${SOURCE_COM_FILES}
  75. ${SOURCE_CONFIG_FILES}
  76. ${SOURCE_TYPES_FILES}
  77. ${SOURCE_FILES}
  78. ${PROTO_SOURCE_FILES}
  79. ${PROTO_FILES}
  80. ${INCLUDE_COM_FILES}
  81. ${INCLUDE_CONFIG_FILES}
  82. ${INCLUDE_HELPER_FILES}
  83. ${INCLUDE_TYPES_FILES}
  84. )
  85. # define the dependencies
  86. TARGET_INCLUDE_DIRECTORIES(ArrivalMANager INTERFACE EuroScope)
  87. TARGET_LINK_LIBRARIES(ArrivalMANager EuroScope libcurl GSL Shlwapi)
  88. TARGET_LINK_LIBRARIES(ArrivalMANager cppzmq protobuf jsoncpp GeographicLib)
  89. # configure the debugger and update the linker flags
  90. IF(MSVC)
  91. SET_TARGET_PROPERTIES(ArrivalMANager
  92. PROPERTIES
  93. VS_DEBUGGER_COMMAND ${EuroScope_EXECUTABLE}
  94. VS_DEBUGGER_WORKING_DIRECTORY ${EuroScope_DIR}
  95. )
  96. SET_TARGET_PROPERTIES(ArrivalMANager
  97. PROPERTIES
  98. LINK_FLAGS /SUBSYSTEM:WINDOWS
  99. )
  100. ENDIF()
  101. SOURCE_GROUP("Generated Files" FILES ${PROTO_SOURCE_FILES})
  102. SOURCE_GROUP("Protocol Files" FILES ${PROTO_FILES})
  103. SOURCE_GROUP("Source Files" FILES ${SOURCE_FILES})
  104. SOURCE_GROUP("Source Files\\com" FILES ${SOURCE_COM_FILES})
  105. SOURCE_GROUP("Source Files\\config" FILES ${SOURCE_CONFIG_FILES})
  106. SOURCE_GROUP("Source Files\\types" FILES ${SOURCE_TYPES_FILES})
  107. SOURCE_GROUP("Source Files\\res" FILES ${SOURCE_FILES_RES})
  108. SOURCE_GROUP("Header Files\\com" FILES ${INCLUDE_COM_FILES})
  109. SOURCE_GROUP("Header Files\\config" FILES ${INCLUDE_CONFIG_FILES})
  110. SOURCE_GROUP("Header Files\\helper" FILES ${INCLUDE_HELPER_FILES})
  111. SOURCE_GROUP("Header Files\\types" FILES ${INCLUDE_TYPES_FILES})