272 lines
6.8 KiB
CMake
Executable File
272 lines
6.8 KiB
CMake
Executable File
#
|
|
# $Id$
|
|
# $HeadURL$
|
|
# $Author$
|
|
#
|
|
|
|
# Uncomment if necessary
|
|
#ADD_SUBDIRECTORY(UnitTests)
|
|
#ADD_SUBDIRECTORY(ModuleTests)
|
|
|
|
INCLUDE(MacroRTIDDSGen)
|
|
INCLUDE(MacroCodeGenIdl)
|
|
|
|
ADD_SUBDIRECTORY(Plugins)
|
|
|
|
SET(xml_FILE tab_service.xml)
|
|
|
|
#
|
|
# --- Library tabTelegrams --------------------------------------------------------------------------------
|
|
#
|
|
# Prefer Qt6 when available, fall back to Qt5
|
|
find_package(Qt6 COMPONENTS Core Sql Network QUIET)
|
|
if (Qt6_FOUND)
|
|
set(_QT_CORE_TARGET Qt6::Core)
|
|
set(_QT_SQL_TARGET Qt6::Sql)
|
|
set(_QT_NETWORK_TARGET Qt6::Network)
|
|
else()
|
|
find_package(Qt5 COMPONENTS Core Sql Network QUIET)
|
|
set(_QT_CORE_TARGET Qt5::Core)
|
|
set(_QT_SQL_TARGET Qt5::Sql)
|
|
set(_QT_NETWORK_TARGET Qt5::Network)
|
|
endif()
|
|
|
|
SET(SRCS_telegrams
|
|
training_area_telegrams.cpp
|
|
training_area_telegrams.h
|
|
)
|
|
NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams})
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/..
|
|
)
|
|
NGL_TARGET_LINK_LIBRARIES(tabTelegrams
|
|
PUBLIC
|
|
${_QT_CORE_TARGET}
|
|
)
|
|
|
|
# install on RPM build and copy for local builds so that LogView automatically finds the training_area_telegrams.h file
|
|
if (BUILD_RPM)
|
|
add_custom_target(training_area_telegrams.h_bin) # empty target so that LogView still builds on RPM build
|
|
NGL_INSTALL(AAR SV FILES training_area_telegrams.h DESTINATION bin)
|
|
else()
|
|
add_custom_command(
|
|
OUTPUT ${CMAKE_BINARY_DIR}/bin/training_area_telegrams.h
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/training_area_telegrams.h ${CMAKE_BINARY_DIR}/bin/training_area_telegrams.h
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/training_area_telegrams.h
|
|
COMMENT "[Local build] Copy training_area_telegrams.h for LogView into bin/"
|
|
)
|
|
add_custom_target(training_area_telegrams.h_bin DEPENDS ${CMAKE_BINARY_DIR}/bin/training_area_telegrams.h)
|
|
endif()
|
|
|
|
#
|
|
# --- Library svcTabCommon --------------------------------------------------------------------------------
|
|
#
|
|
SET(SRCS_common
|
|
logger.cpp
|
|
logger.h
|
|
tab_export.h
|
|
)
|
|
|
|
# Generate tab_enums.idl / tab.idl
|
|
CODEGEN_IDL_SVC(SRCS_common ${xml_FILE})
|
|
# Generate tab_db_impl.cpp/.h, tab_db.h
|
|
CODEGEN_DATABASE(SRCS_common ${xml_FILE})
|
|
|
|
# Generate *.cpp/*.hpp from idl
|
|
RTIDDSGEN(SRCS_common tab_enums.idl)
|
|
RTIDDSGEN(SRCS_common tab.idl)
|
|
|
|
# Generate tab_dt[s,c]_types.h, tab_ft[s,c]_types.h
|
|
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
|
# generate tab_[d|f]tc.h
|
|
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
|
|
|
NGL_ADD_LIBRARY(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabCommon
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
${CMAKE_CURRENT_BINARY_DIR}/../
|
|
)
|
|
NGL_TARGET_LINK_LIBRARIES(svcTabCommon
|
|
PRIVATE
|
|
RTI::nddscpp2
|
|
PUBLIC
|
|
Qt5::Core
|
|
Qt5::Sql
|
|
ddscore
|
|
NGLLogger
|
|
ngldb
|
|
svcPdmCommon
|
|
LtsUtilsCoreHeaderOnly
|
|
)
|
|
NGL_INSTALL_TARGET(svcTabCommon)
|
|
|
|
#
|
|
# --- Library svcTabClient --------------------------------------------------------------------------------
|
|
#
|
|
SET(SRCS_client
|
|
tab_export.h
|
|
)
|
|
# generate tab_[d|f]tc_impl.[cpp|h]
|
|
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
|
|
|
NGL_ADD_LIBRARY(AAR SV WS HLA svcTabClient SHARED ${SRCS_client})
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabClient
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
${CMAKE_CURRENT_BINARY_DIR}/../
|
|
)
|
|
|
|
NGL_TARGET_LINK_LIBRARIES(svcTabClient
|
|
PRIVATE
|
|
RTI::nddscpp2
|
|
ddsconnector
|
|
PUBLIC
|
|
svcTabCommon
|
|
ddsftc
|
|
)
|
|
NGL_INSTALL_TARGET(svcTabClient)
|
|
|
|
#
|
|
# --- Library svcTabServer --------------------------------------------------------------------------------
|
|
#
|
|
SET(SRCS_server
|
|
tx_mixin.cpp
|
|
tx_mixin.h
|
|
)
|
|
# generate tab_[d|f]ts.h, tab_[d|f]ts_impl.[cpp|h]
|
|
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
|
|
|
NGL_ADD_LIBRARY(AAR HLA SV svcTabServer SHARED ${SRCS_server}) # NGL_ADD_LIBRARY2 won't work here - no time for investigations
|
|
if(BUILD_SV OR BUILD_HLA)
|
|
GENERATE_EXPORT_HEADER(svcTabServer) # FIXME: quick workaround
|
|
endif()
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabServer
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
${CMAKE_CURRENT_BINARY_DIR}/../
|
|
)
|
|
|
|
NGL_TARGET_LINK_LIBRARIES(svcTabServer
|
|
PRIVATE
|
|
RTI::nddscpp2
|
|
ddsconnector
|
|
ddsfts
|
|
PUBLIC
|
|
svcTabCommon
|
|
ngldb
|
|
)
|
|
NGL_INSTALL_TARGET(svcTabServer)
|
|
|
|
#
|
|
# --- Topic Type Plugin --------------------------------------------------------------
|
|
#
|
|
CREATE_TOPIC_TYPE_PLUGIN(${xml_FILE})
|
|
|
|
#
|
|
# --- RecordReplayPlugin --------------------------------------------------------------
|
|
#
|
|
CREATE_RECORD_REPLAY_PLUGIN_SHARED(${xml_FILE})
|
|
IF (TARGET tabRecordReplayPlugin)
|
|
TARGET_SOURCES(tabRecordReplayPlugin
|
|
PRIVATE
|
|
tab_record_replay_plugin_custom.cpp
|
|
tab_record_replay_plugin_custom.h
|
|
)
|
|
ENDIF()
|
|
|
|
#
|
|
# --- Executable svcTrainingAreaBase (sTAB) -------------------------------------------------
|
|
#
|
|
SET(SRCS_exe
|
|
dds_handler.cpp
|
|
dds_handler.h
|
|
exm_handler.cpp
|
|
exm_handler.h
|
|
ism_handler.cpp
|
|
ism_handler.h
|
|
main.cpp
|
|
main_handler.cpp
|
|
main_handler.h
|
|
pdm_handler.cpp
|
|
pdm_handler.h
|
|
ppm_handler.cpp
|
|
ppm_handler.h
|
|
position_handler.cpp
|
|
position_handler.h
|
|
recv_from_dds_aes.cpp
|
|
recv_from_dds_aes.h
|
|
recv_from_dds_fts.cpp
|
|
recv_from_dds_fts.h
|
|
recv_from_tab.h
|
|
send_to_dds.cpp
|
|
send_to_dds.h
|
|
send_to_tab.h
|
|
settings.cpp
|
|
settings.h
|
|
tab_export.h
|
|
tab_plugin_interface.h
|
|
|
|
WebSocketInterface/data_manager.cpp
|
|
WebSocketInterface/data_manager.h
|
|
WebSocketInterface/json_keys.h
|
|
WebSocketInterface/websocket_interface_handler.cpp
|
|
WebSocketInterface/websocket_interface_handler.h
|
|
WebSocketInterface/Messages/client_message.cpp
|
|
WebSocketInterface/Messages/client_message.h
|
|
WebSocketInterface/Messages/reply_message.cpp
|
|
WebSocketInterface/Messages/reply_message.h
|
|
# tx_mixin.cpp
|
|
# tx_mixin.h
|
|
|
|
log4cxx_tab.props
|
|
${xml_FILE}
|
|
)
|
|
|
|
# Generate tab.sql, tab.xml
|
|
CODEGEN_SQL(SRCS_exe ${xml_FILE})
|
|
|
|
NGL_ADD_SVC_ICON(SRCS_exe)
|
|
NGL_ADD_EXECUTABLE(AAR SV svcTrainingAreaBase ${SRCS_exe})
|
|
NGL_TARGET_LINK_LIBRARIES(svcTrainingAreaBase
|
|
Qt5::Core
|
|
Qt5::Network
|
|
LtsCoordTrans
|
|
LtsWebSocketServer
|
|
LtsCommandLineParser
|
|
LtsPluginLoader
|
|
LtsUtilsCoreHeaderOnly
|
|
LtsUtilsCore
|
|
svcTabCommon
|
|
svcTabServer
|
|
svcNomClient
|
|
svcAesClient
|
|
svcOpmClient
|
|
svcCoreClient
|
|
svcAsmClient
|
|
svcExmClient
|
|
svcIsmClient
|
|
svcPdmClient
|
|
svcPpmClient
|
|
ddsconnector
|
|
nglsettings
|
|
ProjectConfig
|
|
NGLLogger
|
|
nglcoreapplication
|
|
ngltools
|
|
tabTelegrams
|
|
)
|
|
NGL_INSTALL_TARGET(svcTrainingAreaBase)
|
|
NGL_INSTALL(AAR SV FILES log4cxx_tab.props DESTINATION bin)
|
|
NGL_ADD_TARGET_LINK(svcTrainingAreaBase sTAB)
|
|
|
|
# clientPluginInterface
|
|
ADD_LIBRARY(tabPluginInterface INTERFACE)
|
|
TARGET_SOURCES(tabPluginInterface INTERFACE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/tab_plugin_interface.h
|
|
${CMAKE_CURRENT_SOURCE_DIR}/training_area_telegrams.h
|
|
)
|
|
TARGET_INCLUDE_DIRECTORIES(tabPluginInterface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/../)
|
|
TARGET_LINK_LIBRARIES(tabPluginInterface INTERFACE Qt5::Core svcPdmCommon)
|