Pārlūkot izejas kodu

generate and build the protobuf files and link against protobuf

Sven Czarnian 3 gadi atpakaļ
vecāks
revīzija
24f2ab45e3
1 mainītis faili ar 17 papildinājumiem un 0 dzēšanām
  1. 17 0
      src/CMakeLists.txt

+ 17 - 0
src/CMakeLists.txt

@@ -7,6 +7,18 @@
 # Brief:
 # Brief:
 #   Creates the plug-in which is used by Euroscope
 #   Creates the plug-in which is used by Euroscope
 
 
+# define the Google Protobuf-files
+SET(PROTO_FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/Aircraft.proto
+    ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/AircraftReport.proto
+    ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/AircraftSchedule.proto
+    ${CMAKE_CURRENT_SOURCE_DIR}/com/protobuf/BaseTypes.proto
+)
+
+# generate the Protobuf C++ files
+SET(PROTO_SOURCE_FILES "")
+ProtobufCompile("${PROTO_FILES}" PROTO_SOURCE_FILES)
+
 SET(SOURCE_FILES
 SET(SOURCE_FILES
     ArrivalMANagerMain.cpp
     ArrivalMANagerMain.cpp
     PlugIn.cpp
     PlugIn.cpp
@@ -49,6 +61,8 @@ ADD_LIBRARY(
         ${SOURCE_FILES_RES}
         ${SOURCE_FILES_RES}
         ${SOURCE_CONFIG_FILES}
         ${SOURCE_CONFIG_FILES}
         ${SOURCE_FILES}
         ${SOURCE_FILES}
+        ${PROTO_SOURCE_FILES}
+        ${PROTO_FILES}
         ${INCLUDE_CONFIG_FILES}
         ${INCLUDE_CONFIG_FILES}
         ${INCLUDE_HELPER_FILES}
         ${INCLUDE_HELPER_FILES}
         ${INCLUDE_TYPES_FILES}
         ${INCLUDE_TYPES_FILES}
@@ -57,6 +71,7 @@ ADD_LIBRARY(
 # define the dependencies
 # define the dependencies
 TARGET_INCLUDE_DIRECTORIES(ArrivalMANager INTERFACE EuroScope)
 TARGET_INCLUDE_DIRECTORIES(ArrivalMANager INTERFACE EuroScope)
 TARGET_LINK_LIBRARIES(ArrivalMANager EuroScope GSL Shlwapi.lib)
 TARGET_LINK_LIBRARIES(ArrivalMANager EuroScope GSL Shlwapi.lib)
+TARGET_LINK_LIBRARIES(ArrivalMANager protobuf)
 
 
 # configure the debugger and update the linker flags
 # configure the debugger and update the linker flags
 IF(MSVC)
 IF(MSVC)
@@ -71,6 +86,8 @@ IF(MSVC)
     )
     )
 ENDIF()
 ENDIF()
 
 
+SOURCE_GROUP("Generated Files" FILES ${PROTO_SOURCE_FILES})
+SOURCE_GROUP("Protocol Files" FILES ${PROTO_FILES})
 SOURCE_GROUP("Source Files" FILES ${SOURCE_FILES})
 SOURCE_GROUP("Source Files" FILES ${SOURCE_FILES})
 SOURCE_GROUP("Source Files\\config" FILES ${SOURCE_CONFIG_FILES})
 SOURCE_GROUP("Source Files\\config" FILES ${SOURCE_CONFIG_FILES})
 SOURCE_GROUP("Source Files\\res" FILES ${SOURCE_FILES_RES})
 SOURCE_GROUP("Source Files\\res" FILES ${SOURCE_FILES_RES})