From 24f2ab45e35672b3b3e0699d2866d5ef4e3cd510 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Sat, 14 Aug 2021 15:02:59 +0200 Subject: [PATCH] generate and build the protobuf files and link against protobuf --- src/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 81ca819..147347f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,6 +7,18 @@ # Brief: # 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 ArrivalMANagerMain.cpp PlugIn.cpp @@ -49,6 +61,8 @@ ADD_LIBRARY( ${SOURCE_FILES_RES} ${SOURCE_CONFIG_FILES} ${SOURCE_FILES} + ${PROTO_SOURCE_FILES} + ${PROTO_FILES} ${INCLUDE_CONFIG_FILES} ${INCLUDE_HELPER_FILES} ${INCLUDE_TYPES_FILES} @@ -57,6 +71,7 @@ ADD_LIBRARY( # define the dependencies TARGET_INCLUDE_DIRECTORIES(ArrivalMANager INTERFACE EuroScope) TARGET_LINK_LIBRARIES(ArrivalMANager EuroScope GSL Shlwapi.lib) +TARGET_LINK_LIBRARIES(ArrivalMANager protobuf) # configure the debugger and update the linker flags IF(MSVC) @@ -71,6 +86,8 @@ IF(MSVC) ) 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\\config" FILES ${SOURCE_CONFIG_FILES}) SOURCE_GROUP("Source Files\\res" FILES ${SOURCE_FILES_RES})