Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/CMakeLists.txt
T
torstenandCopilot bafed3705f Qt6 migration: LtsWidgets API fixes, LtsWebSocket logger init, RTI Docker install
- LtsWidgets: Fixed Qt6 API compatibility issues
  - QWheelEvent::delta() → angleDelta().y()
  - QStyleOption::init() → initFrom()
  - QComboBox activated signal signature change
  - QTextCodec removal (UTF-8 default in Qt6)
  - Missing widget includes added

- LtsWebSocket: Fixed m_logger reference initialization
  - Added NGLLoggerBootstrap includes
  - Proper initialization in constructor initializer lists

- CMake: Added BUILD_LTSWEBSOCKET option for temporary exclusion

- Docker: RTI Connext permanent installation script added
  - ci/install-rti-in-docker.sh for persistent RTI setup
  - Removes need for volume mounting RTI into container

- BUILD options: FilterManagement, RTI, Codification, Grantlee, LtsWebSocket
  can be disabled for partial builds during migration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-19 14:04:26 +02:00

161 lines
3.8 KiB
CMake
Executable File

#
# $Id$
# $HeadURL$
# $Author$
#
FIND_PACKAGE(RTI)
# Grantlee5 is Qt5-based and optional for Qt6 migration
IF(BUILD_GRANTLEE)
FIND_PACKAGE(Grantlee5 REQUIRED COMPONENTS Templates)
ENDIF()
NGL_ADD_LIBRARY2(ALL codegen_base SHARED
codegen_export.h
SqlGenerator.cpp
SqlGenerator.h
StructBuilder.cpp
StructBuilder.h
XmlReader.cpp
XmlReader.h
)
NGL_TARGET_LINK_LIBRARIES(codegen_base
PRIVATE
Qt6::Xml
NGLLogger
ngltools
PUBLIC
Qt6::Core
)
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_base
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
)
# If RTI target is available, propagate its include dirs/compile defs
if (TARGET RTI::nddscpp2)
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_base
PUBLIC
$<TARGET_PROPERTY:RTI::nddscpp2,INTERFACE_INCLUDE_DIRECTORIES>
)
NGL_TARGET_COMPILE_DEFINITIONS(codegen_base
PUBLIC
$<TARGET_PROPERTY:RTI::nddscpp2,INTERFACE_COMPILE_DEFINITIONS>
RTI_DDS_AVAILABLE
)
message(STATUS "RTI found; building codegen_base with RTI support")
else()
message(STATUS "RTI not found; building codegen_base without RTI support")
endif()
NGL_INSTALL_TARGET(codegen_base)
# Grantlee5 is Qt5-based and optional for Qt6 migration
IF(BUILD_GRANTLEE AND TARGET Grantlee5::Templates)
NGL_ADD_LIBRARY(ALL codegen_grantlee STATIC
CppTopicGeneratorGrantlee.cpp
CppTopicGeneratorGrantlee.h
DaoGeneratorGrantlee.cpp
DaoGeneratorGrantlee.h
DatabaseGeneratorGrantlee.cpp
DatabaseGeneratorGrantlee.h
GeneratorGrantleeBase.cpp
GeneratorGrantleeBase.h
GrantleeWrappers.cpp
GrantleeWrappers.h
svc.idl.grantlee
svc_enums.idl.grantlee
svc_translation.cpp.grantlee
svc_translation.h.grantlee
svc_dao.cpp.grantlee
svc_dao.h.grantlee
svc_db.h.grantlee
svc_db_impl.h.grantlee
svc_db_impl.cpp.grantlee
svc_dtc.h.grantlee
svc_dtc_impl.cpp.grantlee
svc_dtc_impl.h.grantlee
svc_dts.h.grantlee
svc_dts_impl.cpp.grantlee
svc_dts_impl.h.grantlee
svc_ftc.h.grantlee
svc_ftc_impl.cpp.grantlee
svc_ftc_impl.h.grantlee
svc_fts.h.grantlee
svc_fts_impl.cpp.grantlee
svc_fts_impl.h.grantlee
svc_json.cpp.grantlee
svc_json.h.grantlee
svc_topic_type_plugin.cpp.grantlee
svc_topic_type_plugin.h.grantlee
svc_record_replay_plugin.cpp.grantlee
svc_record_replay_plugin.h.grantlee
codegen_simple.py
)
NGL_TARGET_LINK_LIBRARIES(codegen_grantlee
PRIVATE
Grantlee5::Templates
NGLLogger
ProjectConfig
PUBLIC
codegen_base
)
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_grantlee
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
)
# Smoke-test: parse all .grantlee templates in this directory to detect parse/render regressions
find_package(Qt6 COMPONENTS Core QUIET)
if (Qt6_FOUND)
set(QTCORE_TARGET Qt6::Core)
else()
find_package(Qt6 COMPONENTS Core REQUIRED)
set(QTCORE_TARGET Qt6::Core)
endif()
add_executable(grantlee_parser_smoke tests/GrantleeParserSmoke.cpp)
target_link_libraries(grantlee_parser_smoke PRIVATE Grantlee5::Templates ${QTCORE_TARGET})
add_test(NAME GrantleeParserSmoke COMMAND grantlee_parser_smoke ${CMAKE_CURRENT_SOURCE_DIR})
NGL_ADD_EXECUTABLE(ALL ngl_codegen
main_grantlee.cpp
)
NGL_TARGET_LINK_LIBRARIES(ngl_codegen
codegen_grantlee
LtsCommandLineParser
nglcoreapplication
Qt6::Core
)
NGL_WRAP_UI(codegen_gui_uics
main_grantlee_gui.ui
)
NGL_ADD_EXECUTABLE(WS AAR SV NO_TRANSLATION codegen_gui
${codegen_gui_uics}
main_grantlee_gui.cpp
main_grantlee_gui.ui
)
NGL_TARGET_LINK_LIBRARIES(codegen_gui
codegen_grantlee
LtsCommandLineParser
nglapplication
Qt6::Widgets
Grantlee5::Templates
)
ELSE()
message(STATUS "BUILD_GRANTLEE disabled or Grantlee not found; skipping codegen_grantlee, ngl_codegen, and codegen_gui targets")
ENDIF()