Migration of Legatus codebase to Qt6 with RTI Connext DDS 7.7 integration is partially complete. Core DDS targets build successfully, but ProjectDataManagement module blocks full ddsfts compilation due to IDL definition conflicts.

This commit is contained in:
torsten committed 2026-09-07 19:30:39 +02:00
1 parent 758ae0f53f
commit ba1d9e2c04
256 files changed
+1170 -610

No files matched your search

@@ -31,9 +31,13 @@
SET(_rti_gcc_arch "")
# Check if RTI_DIR is not set OR is empty (cached empty string from previous failed detection)
IF(NOT RTI_DIR OR RTI_DIR STREQUAL "")
SET(_arch "unknown")
IF(WIN32)
SET(_RTI_DIR $ENV{DDS_PATH})
# First check RTI_INSTALL_DIR CMake variable (set by parent CMakeLists.txt)
IF(RTI_INSTALL_DIR AND EXISTS "${RTI_INSTALL_DIR}")
SET(_RTI_DIR "${RTI_INSTALL_DIR}")
ELSE()
SET(_arch "unknown")
IF(WIN32)
SET(_RTI_DIR $ENV{DDS_PATH})
IF(NOT _RTI_DIR)
GET_FILENAME_COMPONENT(_rti_root_path "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Real-Time Innovations\\RTI Connext DDS Pro 5.2.3;Location]" ABSOLUTE)
SET(_RTI_DIR "${_rti_root_path}")
@@ -65,12 +69,13 @@ IF(NOT RTI_DIR OR RTI_DIR STREQUAL "")
SET(_RTI_DIR $ENV{DDS_PATH})
IF(NOT _RTI_DIR)
# Try local external directory first (check multiple levels for different repo structures)
IF(EXISTS "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
SET(_RTI_DIR "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
# Check container path first (/workspace/external), then host-relative paths
IF(EXISTS "${CMAKE_SOURCE_DIR}/external/rti_connext_dds-7.7.0")
SET(_RTI_DIR "${CMAKE_SOURCE_DIR}/external/rti_connext_dds-7.7.0")
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/../external/rti_connext_dds-7.7.0")
SET(_RTI_DIR "${CMAKE_SOURCE_DIR}/../external/rti_connext_dds-7.7.0")
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/external/rti_connext_dds-7.7.0")
SET(_RTI_DIR "${CMAKE_SOURCE_DIR}/external/rti_connext_dds-7.7.0")
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
SET(_RTI_DIR "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
ELSE()
SET(_RTI_DIR "/opt/RTI")
ENDIF()
@@ -111,8 +116,40 @@ IF(NOT RTI_DIR OR RTI_DIR STREQUAL "")
ENDIF()
SET(_arch "${_rti_gcc_arch}")
ENDIF()
ENDIF()
SET(RTI_DIR "${_RTI_DIR}" CACHE STRING "RTI base path" FORCE)
MESSAGE(STATUS "Trying to use RTI from ${RTI_DIR} with arch ${_arch}")
ELSE()
# RTI_DIR was provided externally - auto-detect architecture
SET(_rti_gcc_arch "x64Linux3gcc4.8.2")
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0.0)
# Prefer newer gcc-based RTI builds; try a sequence then fall back to any x64Linux4gcc* dir found under RTI lib
SET(_preferred_archs "x64Linux4gcc8.5.0;x64Linux4gcc7.3.0;x64Linux3gcc5.4.0")
SET(_found_arch "")
foreach(_cand IN LISTS _preferred_archs)
if(EXISTS "${RTI_DIR}/lib/${_cand}")
SET(_found_arch "${_cand}")
break()
endif()
endforeach()
if(_found_arch STREQUAL "")
# fallback: pick any x64Linux* directory under lib
file(GLOB _rti_arch_dirs RELATIVE "${RTI_DIR}/lib" "${RTI_DIR}/lib/x64Linux*")
list(LENGTH _rti_arch_dirs _rti_arch_dirs_len)
if(_rti_arch_dirs_len GREATER 0)
list(GET _rti_arch_dirs 0 _found_arch)
endif()
endif()
if(NOT _found_arch STREQUAL "")
SET(_rti_gcc_arch "${_found_arch}")
else()
# final fallbacks
SET(_rti_gcc_arch "x64Linux4gcc7.3.0")
endif()
ENDIF()
ENDIF()
MESSAGE(STATUS "Using externally provided RTI from ${RTI_DIR} with arch ${_rti_gcc_arch}")
ENDIF()
IF(WIN32)
SET(_rti_include_hint "${RTI_DIR}/include/")
@@ -151,7 +188,8 @@ IF(NOT RTI_INCLUDE_DIR)
MESSAGE(WARNING "RTI not found - disabling BUILD_RTI. Set DDS_PATH to RTI installation to enable RTI features.")
return()
else()
FIND_PATH(RTI_INCLUDE_DIR ndds/ndds_cpp.h HINTS ${_rti_include_hint})
# Use PATHS instead of HINTS for more reliable path resolution
FIND_PATH(RTI_INCLUDE_DIR ndds/ndds_cpp.h PATHS ${_rti_include_hint} NO_DEFAULT_PATH)
IF(RTI_INCLUDE_DIR)
SET(RTI_INCLUDE_DIRS "${RTI_INCLUDE_DIR}" "${RTI_INCLUDE_DIR}/ndds" "${RTI_INCLUDE_DIR}/ndds/hpp" CACHE STRING "RTI include directories" FORCE)
MARK_AS_ADVANCED(RTI_INCLUDE_DIRS)
@@ -175,19 +213,19 @@ IF(NOT RTI_VERSION_MAJOR)
SET(RTI_VERSION_MAJOR ${_rti_version_major} CACHE STRING "RTI version" FORCE)
ENDIF()
INCLUDE(FindLibraryWithDebug)
INCLUDE(FindPackageHandleStandardArgs)
# Set policy for imported target library requirements
if(POLICY CMP0111)
cmake_policy(SET CMP0111 NEW)
endif()
SET(_RTI_LIBS nddscore nddsc nddscpp2 rtiroutingservice)
SET(_libs "")
SET(_lib_vars "")
# Build list of library search paths including arch-specific subdirs
set(_rti_lib_search_paths "${RTI_DIR}/lib")
if(EXISTS "${RTI_DIR}/lib/${_rti_gcc_arch}")
list(APPEND _rti_lib_search_paths "${RTI_DIR}/lib/${_rti_gcc_arch}")
endif()
set(_rti_lib_search_paths "${RTI_DIR}/lib" "${RTI_DIR}/lib/${_rti_gcc_arch}")
# Also scan for any arch subdirs under lib/
file(GLOB _rti_arch_dirs "${RTI_DIR}/lib/*")
foreach(_arch_dir IN LISTS _rti_arch_dirs)
@@ -198,11 +236,32 @@ endforeach()
FOREACH(_lib ${_RTI_LIBS})
SET(_libname "RTI_${_lib}_LIBRARY")
IF (NOT ${_libname})
FIND_LIBRARY_WITH_DEBUG("${_libname}"
WIN32_DEBUG_POSTFIX d
NAMES ${_lib}
HINTS ${_rti_lib_search_paths})
SET(_libname_release "RTI_${_lib}_LIBRARY_RELEASE")
SET(_libname_debug "RTI_${_lib}_LIBRARY_DEBUG")
# Build explicit search paths for this library
set(_lib_search_paths
"${RTI_DIR}/lib/${_rti_gcc_arch}"
"${RTI_DIR}/lib"
)
# Find release library (no suffix)
FIND_LIBRARY(${_libname_release}
NAMES ${_lib}
PATHS ${_lib_search_paths}
NO_DEFAULT_PATH)
# Find debug library (d suffix on Linux)
FIND_LIBRARY(${_libname_debug}
NAMES ${_lib}d
PATHS ${_lib_search_paths}
NO_DEFAULT_PATH)
# Set combined library variable
IF(${_libname_release})
SET(${_libname} "${${_libname_release}}" CACHE STRING "RTI ${_lib} library" FORCE)
ELSEIF(${_libname_debug})
SET(${_libname} "${${_libname_debug}}" CACHE STRING "RTI ${_lib} library" FORCE)
ENDIF()
SET(_tgt_name RTI::${_lib})
@@ -222,21 +281,38 @@ FOREACH(_lib ${_RTI_LIBS})
ENDIF()
ENDIF()
IF(${_libname}_RELEASE)
SET_PROPERTY(TARGET ${_tgt_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
# Set library locations - use release for both configs if debug not found
IF(${_libname}_RELEASE AND ${_libname}_DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION_RELEASE "${${_libname}_RELEASE}")
ENDIF()
IF(${_libname}_DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION_DEBUG "${${_libname}_DEBUG}")
ENDIF()
IF(NOT ${_libname}_RELEASE AND NOT ${_libname}_DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION "${${_libname}}")
# Set default IMPORTED_LOCATION for non-configured builds
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION "${${_libname}_RELEASE}")
ELSEIF(${_libname}_RELEASE)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION_RELEASE "${${_libname}_RELEASE}")
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION_DEBUG "${${_libname}_RELEASE}")
# Set default IMPORTED_LOCATION for non-configured builds
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION "${${_libname}_RELEASE}")
ELSEIF(${_libname}_DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION_RELEASE "${${_libname}_DEBUG}")
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION_DEBUG "${${_libname}_DEBUG}")
# Set default IMPORTED_LOCATION for non-configured builds
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY IMPORTED_LOCATION "${${_libname}_DEBUG}")
ELSE()
# No library found - skip creating this target
MESSAGE(WARNING "RTI library ${_lib} not found in ${RTI_DIR}")
SET(${_libname} "" CACHE STRING "RTI ${_lib} library (not found)" FORCE)
CONTINUE()
ENDIF()
ENDIF()
LIST(APPEND _libs "${${_libname}}")
LIST(APPEND _lib_vars "${_libname}")
# rtiroutingservice is optional - only add required libs to _lib_vars for FIND_PACKAGE_HANDLE_STANDARD_ARGS
IF(NOT "${_lib}" STREQUAL "rtiroutingservice")
LIST(APPEND _lib_vars "${_libname}")
ENDIF()
ENDFOREACH()
IF(TARGET RTI::nddscore AND UNIX)
@@ -217,23 +217,67 @@ ENDMACRO()
MACRO(CODEGEN_IDL_SVC srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc.idl.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_enums.idl.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_json.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_json.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_translation.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_translation.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl")
SET_PROPERTY(GLOBAL APPEND PROPERTY CODEGEN_IDL_FILES "${out_files}")
SET_SOURCE_FILES_PROPERTIES(${out_files} PROPERTIES HEADER_FILE_ONLY TRUE)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_json.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_json.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_translation.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_translation.h")
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files ${ARGN})
IF(BUILD_GRANTLEE)
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc.idl.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_enums.idl.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_json.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_json.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_translation.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_translation.h.grantlee"
)
SET(idl_out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl")
SET_PROPERTY(GLOBAL APPEND PROPERTY CODEGEN_IDL_FILES "${idl_out_files}")
SET_SOURCE_FILES_PROPERTIES(${idl_out_files} PROPERTIES HEADER_FILE_ONLY TRUE)
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files ${ARGN})
ELSE()
# BUILD_GRANTLEE disabled: use pre-generated files if they exist
MESSAGE(STATUS "BUILD_GRANTLEE disabled: checking for pre-generated files for ${svcNameOut}")
# Check if pre-generated .idl files exist in source directory
SET(source_idl "${CMAKE_CURRENT_SOURCE_DIR}/${svcNameOut}.idl")
SET(source_idl_enums "${CMAKE_CURRENT_SOURCE_DIR}/${svcNameOut}_enums.idl")
IF(EXISTS ${source_idl} AND EXISTS ${source_idl_enums})
MESSAGE(STATUS "Found pre-generated IDL files for ${svcNameOut}")
# Copy pre-generated files to build directory
ADD_CUSTOM_COMMAND(OUTPUT ${out_files}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${source_idl} ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${source_idl_enums} ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_json.cpp
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_json.h
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_translation.cpp
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_translation.h
DEPENDS ${source_idl} ${source_idl_enums}
COMMENT "Copying pre-generated IDL files for ${svcNameOut}"
)
SET_PROPERTY(GLOBAL APPEND PROPERTY CODEGEN_IDL_FILES "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl" "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl")
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl PROPERTIES HEADER_FILE_ONLY TRUE)
LIST(APPEND ${srcList} ${out_files})
ELSE()
MESSAGE(WARNING "BUILD_GRANTLEE disabled but no pre-generated IDL files found for ${svcNameOut}. Skipping service.")
# Create empty stub files to satisfy CMake
ADD_CUSTOM_COMMAND(OUTPUT ${out_files}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_json.cpp
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_json.h
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_translation.cpp
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_translation.h
COMMENT "Creating stub files for ${svcNameOut} (no pre-generated IDL)"
)
SET_PROPERTY(GLOBAL APPEND PROPERTY CODEGEN_IDL_FILES "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl" "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl")
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_enums.idl PROPERTIES HEADER_FILE_ONLY TRUE)
LIST(APPEND ${srcList} ${out_files})
ENDIF()
ENDIF()
CODEGEN_HANDLE_SVC_XML(${srcList} ${xmlFile_in})
ENDMACRO()
@@ -291,75 +335,112 @@ MACRO(CODEGEN_CLIENT_TOPICS_IFC srcList xmlFile_in)
IF(NOT _CST_PARTS)
SET(_CST_PARTS "DTC" "FTC")
ENDIF()
SET(in_files "")
SET(out_files "")
FOREACH(part ${_CST_PARTS})
IF(part STREQUAL "DTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dtc.h.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc.h"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc.h")
# When BUILD_GRANTLEE=OFF, use pre-generated files from source directory
IF(NOT BUILD_GRANTLEE)
FOREACH(part ${_CST_PARTS})
IF(part STREQUAL "DTC")
SET(generated_file "${CMAKE_CURRENT_SOURCE_DIR}/${svcNameOut}_dtc.h")
IF(EXISTS "${generated_file}")
LIST(APPEND ${srcList} "${generated_file}")
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${generated_file}")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Pre-generated file ${generated_file} not found. BUILD_GRANTLEE=OFF requires pre-generated files.")
ENDIF()
ELSEIF(part STREQUAL "FTC")
SET(generated_file "${CMAKE_CURRENT_SOURCE_DIR}/${svcNameOut}_ftc.h")
IF(EXISTS "${generated_file}")
LIST(APPEND ${srcList} "${generated_file}")
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${generated_file}")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Pre-generated file ${generated_file} not found. BUILD_GRANTLEE=OFF requires pre-generated files.")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Unkown part argument for CODEGEN_SERVER_TOPICS (${part})")
ENDIF()
ELSEIF(part STREQUAL "FTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_ftc.h.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc.h"
)
ELSE()
MESSAGE(FATAL_ERROR "Unkown part argument for CODEGEN_SERVER_TOPICS (${part})")
ENDIF()
ENDFOREACH()
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
ENDFOREACH()
ELSE()
# Original codegen logic with Grantlee
SET(in_files "")
SET(out_files "")
FOREACH(part ${_CST_PARTS})
IF(part STREQUAL "DTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dtc.h.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc.h"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc.h")
ENDIF()
ELSEIF(part STREQUAL "FTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_ftc.h.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc.h"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc.h")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Unkown part argument for CODEGEN_SERVER_TOPICS (${part})")
ENDIF()
ENDFOREACH()
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
ENDIF()
ENDMACRO()
MACRO(CODEGEN_CLIENT_TOPICS_IMPL srcList xmlFile_in)
SET(options)
SET(oneValueArgs)
SET(multiValueArgs PARTS)
CMAKE_PARSE_ARGUMENTS(_CST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# Skip code generation when BUILD_GRANTLEE=OFF - use pre-generated files instead
IF(BUILD_GRANTLEE)
SET(options)
SET(oneValueArgs)
SET(multiValueArgs PARTS)
CMAKE_PARSE_ARGUMENTS(_CST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
IF(NOT _CST_PARTS)
SET(_CST_PARTS "DTC" "FTC")
ENDIF()
SET(in_files "")
SET(out_files "")
FOREACH(part ${_CST_PARTS})
IF(part STREQUAL "DTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dtc_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dtc_impl.cpp.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_impl.cpp"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_impl.h")
ENDIF()
ELSEIF(part STREQUAL "FTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_ftc_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_ftc_impl.cpp.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_impl.cpp"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_impl.h")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Unkown part argument for CODEGEN_SERVER_TOPICS (${part})")
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
IF(NOT _CST_PARTS)
SET(_CST_PARTS "DTC" "FTC")
ENDIF()
ENDFOREACH()
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
SET(in_files "")
SET(out_files "")
FOREACH(part ${_CST_PARTS})
IF(part STREQUAL "DTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dtc_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dtc_impl.cpp.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_impl.cpp"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_impl.h")
ENDIF()
ELSEIF(part STREQUAL "FTC")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_ftc_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_ftc_impl.cpp.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_impl.cpp"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_impl.h")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "Unkown part argument for CODEGEN_SERVER_TOPICS (${part})")
ENDIF()
ENDFOREACH()
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
ENDIF()
ENDMACRO()
MACRO(CODEGEN_SERVER_TOPICS srcList xmlFile_in)
@@ -7,20 +7,24 @@
if(NOT TARGET ddsgen)
add_library(ddsgen UNKNOWN IMPORTED)
set_target_properties(ddsgen PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
# Qt6 Migration: Removed INTERFACE_POSITION_INDEPENDENT_CODE - conflicts with Qt6 reduce_relocations
# set_target_properties(ddsgen PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT TARGET ddsdtc)
add_library(ddsdtc UNKNOWN IMPORTED)
set_target_properties(ddsdtc PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
# Qt6 Migration: Removed INTERFACE_POSITION_INDEPENDENT_CODE - conflicts with Qt6 reduce_relocations
# set_target_properties(ddsdtc PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT TARGET ddsfts)
add_library(ddsfts UNKNOWN IMPORTED)
set_target_properties(ddsfts PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
# Qt6 Migration: Removed INTERFACE_POSITION_INDEPENDENT_CODE - conflicts with Qt6 reduce_relocations
# set_target_properties(ddsfts PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT TARGET ddsQoS)
add_library(ddsQoS UNKNOWN IMPORTED)
set_target_properties(ddsQoS PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
# Qt6 Migration: Removed INTERFACE_POSITION_INDEPENDENT_CODE - conflicts with Qt6 reduce_relocations
# set_target_properties(ddsQoS PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()