Add BUILD_RTI conditionals for RTI/DDS dependent libraries

Systematic fix for BUILD_RTI conditional compilation:
- Lts/Common: Wrap all DDS-dependent libraries in IF(BUILD_RTI)
  - LtsAppManager, LtsCoordTrans, LtsCoordinate, LtsLogin
  - LtsMultiMonitor, LtsPluginManager, LtsPrinting
  - LtsProjectionWorkstation, LtsScriptTimeline, LtsSession
  - LtsTimelineClassic, LtsUtilsCore, LtsUtilsGui, LtsUtilsGuiDds
- Lts/DDS: Add BUILD_RTI guards to Core, DDSConnector, DdsUnitTests, FTC, FTS
- Lts/Plugins: Add BUILD_RTI guards to FilterManagement, OperatorManagement, SituationReplayManagement
- Lts/Proxies: Add BUILD_RTI guards to Buildings, CombatNetRadio, ComponentMonitor, GuezNasat, TrainingAreaBase, TrainingAreaBaseOC
- Lts/Services: Add BUILD_RTI guards to all 30+ service modules
- Z/nglwidgets: Add BUILD_RTI guards, fix Poppler Qt6 headers

Qt6 compatibility fixes:
- LtsCoordTrans: QOverload signal signature, QChar constructor
- LtsMultiMonitor: setMargin→setContentsMargins, remove deprecated HighQualityAntialiasing
- nglwidgets: Poppler Qt5→Qt6 header migration
- Add FindPopplerQt6.cmake for Qt6 Poppler detection

Part of Qt5→Qt6 migration with RTI DDS support.
This commit is contained in:
torsten committed 2026-08-19 00:12:28 +02:00
1 parent 514ded2739
commit cf6d77c030
78 files changed
+265 -114

No files matched your search

@@ -11,106 +11,93 @@
if(POPPLER_QT5_INCLUDE_DIR AND POPPLER_QT5_LIBRARY)
# FindPopplerQt6.cmake - Find Poppler Qt6 bindings
# Sets: POPPLER_QT6_INCLUDE_DIR, POPPLER_QT6_LIBRARY, PopplerQt6::Poppler target
set(POPPLER_QT5_FOUND TRUE)
if(POPPLER_QT6_INCLUDE_DIR AND POPPLER_QT6_LIBRARY)
set(POPPLER_QT6_FOUND TRUE)
else()
set(_poppler_version_bad FALSE)
else(POPPLER_QT5_INCLUDE_DIR AND POPPLER_QT5_LIBRARY)
set(_poppler_version_bad FALSE)
if(NOT WIN32)
include(FindPkgConfig)
# Prefer poppler-qt6 if available, fall back to poppler-qt6
pkg_check_modules(_pc_poppler poppler-qt6)
if(_pc_poppler_FOUND)
set(_pc_poppler_pkgname poppler-qt6)
else()
if(NOT WIN32)
include(FindPkgConfig)
# Prefer poppler-qt6
pkg_check_modules(_pc_poppler poppler-qt6)
if(_pc_poppler_FOUND)
set(_pc_poppler_pkgname poppler-qt6)
if(NOT "${_pc_poppler_VERSION}" VERSION_GREATER 0.24.0)
set(_poppler_version_bad TRUE)
endif()
endif()
endif()
if(_pc_poppler_FOUND)
if(NOT "${_pc_poppler_VERSION}" VERSION_GREATER 0.24.0)
set(_poppler_version_bad TRUE)
endif(NOT "${_pc_poppler_VERSION}" VERSION_GREATER 0.24.0)
endif(_pc_poppler_FOUND)
endif(NOT WIN32)
if(NOT _poppler_version_bad)
set(POPPLER_QT5_FOUND FALSE)
if(NOT _poppler_version_bad)
set(POPPLER_QT6_FOUND FALSE)
# try library name discovered by pkg-config (poppler-qt6 or poppler-qt6)
# Attempt to use pkg-config-provided absolute library path variable if available
if(_pc_poppler_FOUND)
# construct the variable name pkgcfg_lib__pc_poppler_<pkgname>
set(_pkg_var "pkgcfg_lib__pc_poppler_${_pc_poppler_pkgname}")
message(STATUS "FindPoppler: pkg-config found ${_pc_poppler_pkgname}, var ${_pkg_var} defined? ${${_pkg_var}}")
if(DEFINED ${_pkg_var})
set(POPPLER_QT5_LIBRARY ${${_pkg_var}})
message(STATUS "FindPoppler: using pkgcfg path ${POPPLER_QT5_LIBRARY}")
# Try library name discovered by pkg-config
if(_pc_poppler_FOUND)
set(_pkg_var "pkgcfg_lib__pc_poppler_${_pc_poppler_pkgname}")
message(STATUS "FindPoppler: pkg-config found ${_pc_poppler_pkgname}, var ${_pkg_var} defined? ${${_pkg_var}}")
if(DEFINED ${_pkg_var})
set(POPPLER_QT6_LIBRARY ${${_pkg_var}})
message(STATUS "FindPoppler: using pkgcfg path ${POPPLER_QT6_LIBRARY}")
endif()
endif()
endif()
if(NOT POPPLER_QT5_LIBRARY)
find_library(POPPLER_QT5_LIBRARY ${_pc_poppler_pkgname}
HINTS ${_pc_poppler_LIBRARY_DIRS}
)
endif()
# fallback: try common library names if pkg-config hints didn't help
if(NOT POPPLER_QT5_LIBRARY)
find_library(POPPLER_QT5_LIBRARY NAMES poppler-qt6 poppler-qt6)
endif()
# extra fallback paths commonly used on Debian/Ubuntu
if(NOT POPPLER_QT5_LIBRARY)
find_library(POPPLER_QT5_LIBRARY NAMES poppler-qt6 poppler-qt6 PATHS /usr/lib/x86_64-linux-gnu /usr/lib /usr/local/lib)
endif()
# check for headers for both qt5 and qt6 layouts
find_path(POPPLER_QT5_INCLUDE_DIR poppler-qt6.h poppler-qt6.h
HINTS ${_pc_poppler_INCLUDE_DIRS}
PATH_SUFFIXES poppler/qt5 poppler/qt6
)
find_path(POPPLER_QT5_INCLUDE_DIR_core qt5/poppler-qt6.h qt6/poppler-qt6.h
HINTS ${_pc_poppler_INCLUDE_DIRS}
PATH_SUFFIXES poppler
)
if(POPPLER_QT5_LIBRARY AND POPPLER_QT5_INCLUDE_DIR AND POPPLER_QT5_INCLUDE_DIR_core)
list(APPEND POPPLER_QT5_INCLUDE_DIR "${POPPLER_QT5_INCLUDE_DIR_core}")
set(POPPLER_QT5_FOUND TRUE)
# Expose a modern imported target for consumers
if(NOT TARGET PopplerQt6::Poppler)
add_library(PopplerQt6::Poppler UNKNOWN IMPORTED)
set_target_properties(PopplerQt6::Poppler PROPERTIES
IMPORTED_LOCATION "${POPPLER_QT5_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${POPPLER_QT5_INCLUDE_DIR}"
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY ${_pc_poppler_pkgname}
HINTS ${_pc_poppler_LIBRARY_DIRS}
)
endif()
# Also cache the library path so other CMakeLists can link directly
set(POPPLER_QT5_LIBRARY "${POPPLER_QT5_LIBRARY}" CACHE FILEPATH "Path to poppler-qt library")
set(POPPLER_QT5_INCLUDE_DIR "${POPPLER_QT5_INCLUDE_DIR}" CACHE PATH "Poppler include dirs")
endif(POPPLER_QT5_LIBRARY AND POPPLER_QT5_INCLUDE_DIR AND POPPLER_QT5_INCLUDE_DIR_core)
endif(NOT _poppler_version_bad)
# Fallback: try common library names
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY NAMES poppler-qt6 poppler-qt6)
endif()
# Extra fallback paths
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY NAMES poppler-qt6 poppler-qt6
PATHS /usr/lib/x86_64-linux-gnu /usr/lib /usr/local/lib)
endif()
if(POPPLER_QT5_LIBRARY AND POPPLER_QT5_INCLUDE_DIR)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PopplerQt6 DEFAULT_MSG
POPPLER_QT5_LIBRARY
POPPLER_QT5_INCLUDE_DIR)
else()
# Poppler Qt bindings not found — create placeholder target/variables so projects using FIND_PACKAGE(PopplerQt6 REQUIRED)
# do not fail at configure time. Real functionality will require installing poppler-qt6 or updating code.
message(WARNING "Poppler Qt bindings not found (poppler-qt6 or poppler-qt6). Creating placeholder PopplerQt6::Poppler target to allow configure.")
set(POPPLER_QT5_LIBRARY "" CACHE STRING "Placeholder poppler library" FORCE)
set(POPPLER_QT5_INCLUDE_DIR "" CACHE STRING "Placeholder poppler include dir" FORCE)
if(NOT TARGET PopplerQt6::Poppler)
add_library(PopplerQt6::Poppler UNKNOWN IMPORTED)
set_property(TARGET PopplerQt6::Poppler PROPERTY INTERFACE_INCLUDE_DIRECTORIES "")
# Check for headers (Qt6 layout: poppler/qt6/poppler-qt6.h)
find_path(POPPLER_QT6_INCLUDE_DIR poppler/qt6/poppler-qt6.h
HINTS ${_pc_poppler_INCLUDE_DIRS}
PATH_SUFFIXES poppler
)
if(POPPLER_QT6_LIBRARY AND POPPLER_QT6_INCLUDE_DIR)
set(POPPLER_QT6_FOUND TRUE)
# Expose a modern imported target for consumers
if(NOT TARGET PopplerQt6::Poppler)
add_library(PopplerQt6::Poppler UNKNOWN IMPORTED)
set_target_properties(PopplerQt6::Poppler PROPERTIES
IMPORTED_LOCATION "${POPPLER_QT6_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${POPPLER_QT6_INCLUDE_DIR}"
)
endif()
# Cache the variables
set(POPPLER_QT6_LIBRARY "${POPPLER_QT6_LIBRARY}" CACHE FILEPATH "Path to poppler-qt6 library")
set(POPPLER_QT6_INCLUDE_DIR "${POPPLER_QT6_INCLUDE_DIR}" CACHE PATH "Poppler-Qt6 include dirs")
endif()
endif()
if(POPPLER_QT6_LIBRARY AND POPPLER_QT6_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PopplerQt6 DEFAULT_MSG
POPPLER_QT6_LIBRARY
POPPLER_QT6_INCLUDE_DIR)
else()
message(WARNING "Poppler Qt6 bindings not found. Creating placeholder PopplerQt6::Poppler target.")
set(POPPLER_QT6_LIBRARY "" CACHE STRING "Placeholder poppler library" FORCE)
set(POPPLER_QT6_INCLUDE_DIR "" CACHE STRING "Placeholder poppler include dir" FORCE)
if(NOT TARGET PopplerQt6::Poppler)
add_library(PopplerQt6::Poppler UNKNOWN IMPORTED)
set_property(TARGET PopplerQt6::Poppler PROPERTY INTERFACE_INCLUDE_DIRECTORIES "")
endif()
set(POPPLER_QT6_FOUND TRUE CACHE INTERNAL "Poppler placeholder present")
endif()
set(POPPLER_QT5_FOUND TRUE CACHE INTERNAL "Poppler placeholder present")
endif()
endif(POPPLER_QT5_INCLUDE_DIR AND POPPLER_QT5_LIBRARY)