Compare commits

...
Author SHA1 Message Date
berrux-dev d130c55be5 Fix Qt6 resource compilation so LogView icons are embedded at runtime
- QT5_ADD_RESOURCES was a no-op stub under Qt6, silently dropping .qrc
  files: LogView's :/image/* icons were never compiled into the binary.
  Map the stub onto qt6_add_resources() (outfiles-variable form, which
  appends the generated qrc_*.cpp to the source list). LogView is the
  only caller of the stub.
- nglwidgets' Qt6 branch only processed rme_light_style.qrc;
  nglresources.qrc (which provides :icons/16x16/* toolbar/window icons)
  was left as a raw file in the source list and never compiled
  (CMAKE_AUTORCC is off). Process both qrcs.
- LogView never loads libnglwidgets.so at runtime (--as-needed drops it:
  the code uses no nglwidgets symbols), so its :icons/16x16 resources
  were never registered for the app. Embed the 20 icons LogView actually
  uses directly into LogViewResources.qrc with explicit aliases (rcc
  rejects XML comments in .qrc and, without an alias, registers the full
  relative path as the resource name).
2026-11-03 13:31:02 +01:00
berrux-dev 0e2100f383 reset Jenkins file 2026-10-15 20:43:46 +02:00
berrux-dev 26f702b7a4 reset jenkins file 2026-10-15 20:40:29 +02:00
berrux-dev 37bd700564 Fixed make error 2026-10-15 12:21:52 +02:00
berrux-dev 684e05109d Add lcov code coverage to the release pipeline and Jenkins
- new_docker_build.sh: new --run-coverage mode (mutually exclusive with
  --run-jenkins-builder). Instruments the release-scope build with
  -O0 -g --coverage -fPIC -DNDEBUG (RELEASE flag override keeps -DNDEBUG
  and -fPIC so behavior and PIC match the green baseline), runs ctest,
  then collects the lcov report: capture --external -> extract on the
  four release dirs -> remove test sources -> summary -> genhtml, all
  with --ignore-errors mismatch,inconsistent,unused (GCC 15 + lcov 2.4).
  Report lands in --coverage-output-dir (default ./coverage-out):
  html/index.html, coverage.info, coverage_summary.txt.
- Dockerfile image gains lcov via APT_PACKAGES (genhtml ships in the
  same package).
- Jenkinsfile: RunCoverage parameter (default on) + per-OS Coverage
  stage running the driver on the agent and archiving
  coverage/<project>/<os>/**.
- release-16-10-2026.sh: same coverage step, gated by DRYRUN_COVERAGE
  (default ON, mirrors the Jenkins default).
- README: Step 6 (code coverage) and options/env reference entries.
- .gitignore: coverage-out/
2026-10-15 09:00:33 +02:00
berrux-dev 676ae05335 Rewrite the build README without excluded-module sections
Scope is now described only as what the release build contains
(TetraIF, Z/src, Lts/Common, TrainingAreaBase). All steps (image,
compile, tests, DEB packaging, Jenkins) kept and refreshed; the
license note is reduced to 'no license file is required'.
2026-10-14 20:40:05 +02:00
berrux-dev a17b431669 Trim stub header comments and redundant explanations
- Drop the 'Stub file ... BUILD_RTI=OFF / Auto-generated' headers from the
  tab_* and pdm_* stub files (RTI is gone on this branch; the names say it)
- Drop stub comments from MockCoordTrans.h and the coordTransTests placeholders
- Drop the DDS exclusion list comment from Lts/Common/CMakeLists.txt
- Shorten the staging and packages-out comments in new_docker_build.sh
2026-10-14 20:30:09 +02:00
berrux-dev 493893d2e6 Reduce make_rpm_ubuntu26.py line count (925 to 526) without changing behavior
- Merge build_single_deb and build_single_deb_nobuild into one build_deb()
- Add build_nobuild_package() factory for the 4 no-build packages
- Extract run(), prune_dirs() and write_deb_file() helpers
- Drop the unreachable release_scope copy branch (all call sites used the
  full-tree copy; the --release_scope CLI flag is kept)
- Trim pipeline_files to the 8 files that actually exist and are packaged
- Remove unused imports (configparser, getpass, re, datetime, Path, stat),
  unused vars (test_patterns, script_extensions) and a duplicated write block
2026-10-14 20:25:51 +02:00
berrux-dev 8976b5aedb Remove dead CMake configuration from the release validation scope
- Top-level CMakeLists.txt: drop RTI/Connext DDS config and placeholder targets,
  MIGRATE_MODULE guarded-subdir machinery (now unconditional add_subdirectory),
  BUILD_QAV, BUILD_PLUGINS_*, KDReports stub, ArcGIS option and FindRTI placeholder loop
- Lts/CMakeLists.txt: release scope now unconditional (Common + Proxies/TrainingAreaBase),
  codegen/DDS/test/docs blocks removed
- Lts/Common: drop DDS/RTI-gated plugin and utils test blocks
- Lts/Proxies/TrainingAreaBase: remove RTI codegen, svcTabClient/svcTabServer, RTI plugins,
  sTAB; keep stub-only svcTabCommon + tabTelegrams + tabPluginInterface
- TetraIF/PrtCnv: remove out-of-scope TetraTestServer/LastTest subdirs
- Z/src/nglcompression: remove nglcomp_test (pre-existing Qt6 failure, no longer registered)
- Delete 16 unused cmake/ helper modules and the tests/ scaffolding dir
- new_docker_build.sh: drop BUILD_ARCGIS and nglcomp_test from the release build
- README: update ctest baseline to 7/7 and remove license/exception mentions
2026-10-14 18:39:18 +02:00
berrux-dev 6e7b09cf6f Remove include/ entries and LogView files unused by the release-scope build
Audited the release-scope compilation (TetraIF, Z/src, Lts/Common +
TrainingAreaBase, BUILD_RTI=OFF) for every file under include/:

Removed (zero references from release-scope sources or CMake):
- service-stub header dirs (AlarmManagement, AreaEffectSimulation,
  AssetManagement, AudioVideoManagement, Core, ExerciseEventManagement,
  ExerciseManagement, GuezNasat, InfrastructureManagement, Lts,
  LtsProjectionWorkstation, LtsScriptTimeline, LtsSession,
  MarkerManagement, NotificationManagement, OperatorManagement,
  ParticipantManagement, ProjectDataManagement, ReportManagement,
  Services, SituationReplay, TopicEditorBase, Viewer)
- include/grantlee (codegen modules excluded from the release build)
- include/nglapplication (all headers duplicate Z/src/nglapplication)
- include/poppler (Qt5 header; the build includes poppler/qt6 from the
  system package)
- include/rti (142 Connext DDS headers; only consumers are behind
  BUILD_RTI, which is OFF for this branch)
- TetraIF/LogView zsksxd_tetraForLogView{,_guez}.cpp and
  zsksxd_tetraForLogView_guez.x (the build compiles the .x; the guez
  variant is referenced nowhere; LogView loads the .x from the app dir)

Kept (actively included): include/GeographicLib, include/LtsUtilsGuiDds,
include/NGLLogger.

Also drop the now-dangling include_directories for the removed dirs in
the top-level CMakeLists (include/Viewer/SituationMap) and
Lts/CMakeLists.txt (six stub dirs) - otherwise GCC warns
-Wmissing-include-dirs for every compile.

Verified with a full pipeline rebuild (scope-rebuild15): 0 warnings,
ctest baseline unchanged, all 5 DEBs produced.
2026-10-14 16:51:32 +02:00
berrux-dev 11501ff7bb Drop the rti_license.dat requirement from the release scope build
The release validation scope (TetraIF, Z/src, Lts/Common +
TrainingAreaBase) never consumes an RTI license: no CMake file or
build step reads RTI_LICENSE_FILE, and the only RTI Connext DDS
consumers are all behind BUILD_RTI (OFF for this branch, stubs
compiled instead). The license was pure plumbing:

- new_docker_build.sh: remove the require_file validation, the
  bind mount and the in-container RTI_LICENSE_FILE export
- jenkins-ci-rme: remove the RTI_LICENSE_FILE export and the
  Jenkinsfile workspace-layout comment
- README: document that no license file is needed

Verified with a full pipeline rebuild (scope-rebuild12) run while
rti_license.dat was absent: 0 warnings, ctest baseline unchanged,
all 5 DEBs produced, none of them containing the license.
2026-10-14 16:28:03 +02:00
berrux-dev 59f0c025e5 Add a step-by-step build and test README for the release scope
Document the full flow: prebuilt Docker image build, release-scope
compilation (mandatory CMake flags), running the unit tests (ctest
baseline plus direct execution of the test binaries), DEB package
production with the in-tree rpmbuild script, the Jenkins/CI entry
points, the options reference and troubleshooting notes.
2026-10-14 16:28:03 +02:00
berrux-dev cebc456bc1 Add unit tests for the TetraIF modules in a unit-test folder
New TetraIF/unit-test/ directory with one QtTest executable per
TetraIF release-scope module, wired into ctest and the DEB pipeline:

- coprtcnv_unit_test: central and radio telegram header fields,
  payload access, length checks, fragmentation/reassembly roundtrip,
  telegram-id string helpers
- logview_unit_test: IntegerCalculator arithmetic, operator priority,
  parentheses, error codes and variables (compiles the LogView class
  source directly; the class otherwise lives in the LogView
  executable)
- prtcnv_unit_test: PrtCnvMember state and fragmented-telegram
  handling (compiles the class source directly because PrtCnvLib is
  built with hidden visibility)

TetraIF/CMakeLists.txt adds the unit-test subdirectory and
new_docker_build.sh builds and ctest-runs the three new targets.
2026-10-14 16:28:03 +02:00
berrux-dev 2d1b12b5d8 Copy jenkins-ci-rme into the source tree and adapt it to this project
- Jenkinsfile: guez-only release pipeline; the prebuilt build image is
  built from the in-tree Dockerfile (via new_docker_build.sh
  --build-prebuilt-image) instead of a pre-pulled harbor image; the
  builder runs inside the container with the workspace mounted at
  /workspace; the post-publish cleanup stage was dropped so the DEBs
  stay under ${WORKSPACE}/rpms/... (the documented output location)
- jenkins_builder_ubuntu26.sh: uses the in-tree rpmbuild/
  make_rpm_ubuntu26.py instead of the outer-repo copy; same-file guard
  on the packages-out copy (host output dir == make_rpm output dir)
- jenkins_publisher_ubuntu26.sh: uploads rpms/${PROJECT}/${OS_VERSION}/
  directly - make_rpm_ubuntu26.py writes the DEBs there without a TDS
  subfolder
- release-16-10-2026.sh: local driver adapted to the current
  new_docker_build.sh interface (drops the no-longer-existing
  --use-prebuilt-image option, builds the image on demand, outputs to
  ${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/)
- make_rpm_ubuntu26.py: stage the new jenkins-ci-rme/ files (Jenkinsfile,
  builder, publisher) into the build-pipeline DEB (release-16-10-2026.sh
  was already listed)

Not copied (superseded): openSUSE builder/publisher, the old Dockerfile
recipes (replaced by the in-tree Dockerfile), Bitbucket notification
(jenkins_notifier.sh is not part of this project)
2026-10-14 16:28:03 +02:00
berrux-dev bf3fecf5c0 Use the Jenkins-style DEB output path and fix the copy to the packages-out mount
- Document --package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/"
  (Jenkins convention) in the usage examples
- The in-container copy step now copies to the real mount point
  /workspace/packages-out instead of ${PACKAGE_OUTPUT_DIR}, which is a host
  path that does not exist inside the container (the copy was a silent
  no-op; packages reached the host directly via make_rpm's
  --output_dir /workspace/rpms/... on the workspace mount)
- Skip the copy when the host output directory is the same directory as
  make_rpm's output dir (stat device:inode guard) - which is exactly the
  case for the Jenkins-style path above, where make_rpm already writes the
  packages in place
2026-10-14 16:28:03 +02:00
365 changed files with 1683 additions and 59552 deletions

No files matched your search

@@ -14,3 +14,4 @@ build/
build2/ build2/
.envrc .envrc
build4 build4
coverage-out/
+7 -353
View File
@@ -40,26 +40,9 @@ MESSAGE(STATUS "LTS Version: ${LTS_VERSION_MAJOR}.${LTS_VERSION_MINOR}.${LTS_VER
# Enable CTest integration for unit tests # Enable CTest integration for unit tests
include(CTest) include(CTest)
# Release scope: subdirectories are added unconditionally (no per-module migration builds)
function(NGL_ADD_SUBDIR_GUARDED subdir) function(NGL_ADD_SUBDIR_GUARDED subdir)
if(MIGRATE_MODULE STREQUAL "") add_subdirectory(${subdir})
add_subdirectory(${subdir})
else()
# normalize to forward slashes
string(REPLACE "\\" "/" _mig "${MIGRATE_MODULE}")
string(REPLACE "\\" "/" _sub "${subdir}")
# also compare basenames so MIGRATE_MODULE=Lts/DDS matches subdir 'DDS' when called from Lts
get_filename_component(_mig_base "${_mig}" NAME)
get_filename_component(_sub_base "${_sub}" NAME)
# If MIGRATE_MODULE either starts with the subdir, equals it, contains it as a path component,
# or the basename matches, include the subdir. This makes nested paths like
# 'Lts/Proxies/TrainingAreaBase' include both 'Lts' and its child 'Proxies'.
if(_mig MATCHES "^${_sub}(/|$)" OR _sub MATCHES "^${_mig}(/|$)" OR _mig MATCHES ".*/${_sub}(/|$)" OR _sub MATCHES ".*/${_mig}(/|$)" OR _mig_base STREQUAL _sub OR _sub_base STREQUAL _mig)
message(STATUS "Including subdir ${subdir} because MIGRATE_MODULE=${MIGRATE_MODULE}")
add_subdirectory(${subdir})
else()
message(STATUS "Skipping subdir ${subdir} because MIGRATE_MODULE=${MIGRATE_MODULE}")
endif()
endif()
endfunction() endfunction()
SET(LTS_VERSION_DATE "01.01.2018" CACHE STRING "The date when this software was compiled") SET(LTS_VERSION_DATE "01.01.2018" CACHE STRING "The date when this software was compiled")
@@ -95,51 +78,6 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/Lts/Viewer/SituationMap/Symbology")
include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/LtsDataView) include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/LtsDataView)
endif() endif()
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/TrainingAreaBase) include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/TrainingAreaBase)
# Release scope: exclude Services, DDS, and Plugins include paths
IF(NOT RELEASE_BUILD)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ProjectDataManagement)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Services)
include_directories(${CMAKE_SOURCE_DIR}/include/ProjectDataManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/InfrastructureManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/InfrastructureManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Plugins/InfrastructureManagement/Shared)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/AssetManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/AssetManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/AudioVideoManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/AudioVideoManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ExerciseEventManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/ExerciseEventManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ExerciseManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/ExerciseManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/FileManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/NotificationManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/NotificationManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ParticipantManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/ParticipantManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ReportManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/ReportManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/SituationReplay)
include_directories(${CMAKE_SOURCE_DIR}/include/SituationReplay)
# Evaluations' generated evl_db_structs.h includes <evl_enums.hpp> by bare name, and that
# header is consumed from OcBaseDownload as well, so its build dir must be visible tree-wide
# like the services above. There is no include/Evaluations stub tree, so only the build dir
# is added (same shape as FileManagement above, which has no stub tree either).
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Evaluations)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/GuezNasat)
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS)
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS/QosProfile)
# Generated DDS headers (BUILD_RTI=ON)
include_directories(${CMAKE_BINARY_DIR}/Lts)
# <Core/core.hpp> consumers (LtsCoordinate, AES/CES, HLA proxies) resolve the
# rtiddsgen-generated core.hpp from the DDS build dir (the qt5 include order);
# the OFF-era stub copies in include/Core/ have been removed.
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS)
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS/DDSConnector)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Messaging)
include_directories(${CMAKE_SOURCE_DIR}/include/OperatorManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/OperatorManagement)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Plugins)
ENDIF()
# Release scope: include path for ProjectDataManagement stub headers # Release scope: include path for ProjectDataManagement stub headers
IF(RELEASE_BUILD) IF(RELEASE_BUILD)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Services/ProjectDataManagement/stubs) include_directories(${CMAKE_SOURCE_DIR}/Lts/Services/ProjectDataManagement/stubs)
@@ -154,7 +92,6 @@ include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore)
# only that generated header, so appending it cannot shadow an existing include. # only that generated header, so appending it cannot shadow an existing include.
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings) include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings)
include_directories(${CMAKE_SOURCE_DIR}/Z/src/NGLLogger) include_directories(${CMAKE_SOURCE_DIR}/Z/src/NGLLogger)
include_directories(${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap)
SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON) SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_VISIBILITY_INLINES_HIDDEN ON) SET(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
@@ -171,78 +108,15 @@ IF(CMAKE_VERSION VERSION_GREATER 3.15.9)
ENDIF() ENDIF()
ENDIF() ENDIF()
# Qt6 Migration: Options to disable modules with missing dependencies (WebEngine, XmlPatterns, ArcGIS)
# These can be enabled once the required system dependencies are available in the build environment
OPTION(BUILD_PLUGINS_PLANEDITOR "Build PlanEditor plugin (requires Qt6 WebEngine + ArcGIS SDK)" OFF)
OPTION(BUILD_PLUGINS_ONLINEHELP "Build OnlineHelp plugin (requires Qt6 WebEngine)" OFF)
OPTION(BUILD_PLUGINS_SERVICEMONITOR "Build ServiceMonitor plugin (requires Qt6 WebEngine)" OFF)
OPTION(BUILD_PLUGINS_PARTICIPANT_ORG_CHART "Build ParticipantOrgChart (requires Qt6 WebEngine)" OFF)
OPTION(BUILD_PLUGINS_MSDL "Build MSDL module (requires Qt6 XmlPatterns)" OFF)
OPTION(BUILD_PLUGINS_SAAB "Build Saab module (requires Qt6 XmlPatterns)" OFF)
OPTION(BUILD_RTI "Build RTI Connext DDS dependent modules" OFF)
OPTION(BUILD_VIEWER_ONLY "Build only Viewer module (no RTI required)" OFF)
# Add Lts/ include path globally for QosProfile and other Lts headers # Add Lts/ include path globally for QosProfile and other Lts headers
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Lts) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Lts)
IF(BUILD_RTI)
# Define BUILD_RTI as preprocessor macro for all targets
ADD_COMPILE_DEFINITIONS(BUILD_RTI)
ENDIF()
OPTION(BUILD_ARCGIS "Build ArcGIS SDK dependent modules" ON)
OPTION(BUILD_FILTERMANAGEMENT "Build FilterManagement plugins (temporarily disabled for migration)" OFF)
OPTION(BUILD_CODIFICATION "Build CodificationManagement plugins (requires KDReports)" OFF)
OPTION(BUILD_GRANTLEE "Build CodeGen SQL files using KTextTemplate parser (KF6::TextTemplate)" ON)
# If BUILD_GRANTLEE is OFF but ngl_codegen is needed (for IDL codegen),
# provide it as an imported executable target from pre-built location
# Skip this for RELEASE_BUILD since CodeGen is excluded and ngl_codegen is not needed
IF(NOT BUILD_GRANTLEE AND NOT RELEASE_BUILD)
# ngl_codegen is copied to build/bin/ by run_final_migration.sh
# Create an imported target so MacroCodeGenIdl.cmake can find it
IF(NOT TARGET ngl_codegen)
ADD_EXECUTABLE(ngl_codegen IMPORTED GLOBAL)
SET_TARGET_PROPERTIES(ngl_codegen PROPERTIES
IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/bin/ngl_codegen"
)
MESSAGE(STATUS "Using pre-built ngl_codegen from ${CMAKE_BINARY_DIR}/bin/ngl_codegen")
ENDIF()
ENDIF()
OPTION(BUILD_LTSWEBSOCKET "Build LtsWebSocket module (requires NGLLogger)" ON) OPTION(BUILD_LTSWEBSOCKET "Build LtsWebSocket module (requires NGLLogger)" ON)
IF(WIN32)
SET(EXTERNAL_LIBRARY_DIR "C:/Development/Projekte/SituationMap/ExtFw" CACHE STRING "Library dir with all external dependencies")
LIST(APPEND CMAKE_PREFIX_PATH "${EXTERNAL_LIBRARY_DIR}")
LIST(APPEND CMAKE_PROGRAM_PATH "${EXTERNAL_LIBRARY_DIR}/bin;${EXTERNAL_LIBRARY_DIR}/dev-utils/bin")
ELSE()
# Linux: ArcGIS SDK Pfad konfigurieren (nur wenn BUILD_ARCGIS=ON)
IF(BUILD_ARCGIS)
# Use environment variable ARCGIS_ROOT if set, otherwise default to /workspace/external/... (Docker) or host path
IF(DEFINED ENV{ARCGIS_ROOT})
SET(ARCGIS_SDK_DIR "$ENV{ARCGIS_ROOT}" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSEIF(EXISTS "/workspace/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk")
SET(ARCGIS_SDK_DIR "/workspace/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSE()
SET(ARCGIS_SDK_DIR "/repo/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ENDIF()
IF(EXISTS "${ARCGIS_SDK_DIR}")
LIST(APPEND CMAKE_PREFIX_PATH "${ARCGIS_SDK_DIR}")
MESSAGE(STATUS "ArcGIS SDK found at: ${ARCGIS_SDK_DIR}")
ELSE()
MESSAGE(WARNING "ArcGIS SDK not found at: ${ARCGIS_SDK_DIR}")
ENDIF()
ENDIF()
ENDIF()
# Set CMAKE_MODULE_PATH early so FIND_PACKAGE can find our custom Find modules # Set CMAKE_MODULE_PATH early so FIND_PACKAGE can find our custom Find modules
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
INCLUDE(FindLibraryWithDebug) INCLUDE(FindLibraryWithDebug)
# Find ArcGIS SDK globally if BUILD_ARCGIS is enabled
# This creates ArcGIS::ArcGIS target for all modules to use
IF(BUILD_ARCGIS)
FIND_PACKAGE(ArcGIS REQUIRED)
ENDIF()
ENABLE_TESTING() ENABLE_TESTING()
INCLUDE(CTest) INCLUDE(CTest)
CONFIGURE_FILE(CTestCustom.ctest ${CMAKE_BINARY_DIR}/CTestCustom.ctest COPYONLY) CONFIGURE_FILE(CTestCustom.ctest ${CMAKE_BINARY_DIR}/CTestCustom.ctest COPYONLY)
@@ -521,17 +395,6 @@ if(NOT TARGET Qt6::WebEngineWidgets)
message(STATUS "Created stub target for Qt6::WebEngineWidgets (library not available)") message(STATUS "Created stub target for Qt6::WebEngineWidgets (library not available)")
endif() endif()
# Stub KDReports::KDReports target if not available (needed by LtsReportDisplay)
# UNKNOWN (not INTERFACE) so FindKDReports.cmake can upgrade it with a real
# IMPORTED_LOCATION; an INTERFACE imported target ignores IMPORTED_LOCATION.
if(NOT TARGET KDReports::KDReports)
add_library(KDReports::KDReports UNKNOWN IMPORTED)
set_target_properties(KDReports::KDReports PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "NO_KDREPORTS"
)
message(STATUS "Created stub target for KDReports::KDReports (library not available)")
endif()
# Stub Qt6::Core5Compat target if not available (needed by textEditorTest) # Stub Qt6::Core5Compat target if not available (needed by textEditorTest)
if(NOT TARGET Qt6::Core5Compat) if(NOT TARGET Qt6::Core5Compat)
add_library(Qt6::Core5Compat INTERFACE IMPORTED) add_library(Qt6::Core5Compat INTERFACE IMPORTED)
@@ -623,140 +486,6 @@ endif()
MESSAGE(STATUS "Qt version is ${Qt6Core_VERSION}, GUI available: ${QT6_GUI_AVAILABLE}") MESSAGE(STATUS "Qt version is ${Qt6Core_VERSION}, GUI available: ${QT6_GUI_AVAILABLE}")
# #
# RTI Connext DDS - manuelle Konfiguration da keine CMake Config Files vorhanden
#
IF(BUILD_RTI)
# Support environment variable override, otherwise use relative path from repo root
IF(DEFINED ENV{DDS_PATH})
SET(RTI_INSTALL_DIR "$ENV{DDS_PATH}" CACHE PATH "RTI Connext DDS installation directory")
ELSE()
# In Docker container: /workspace/external/rti_connext_dds-7.7.0
# On host: ${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0
IF(EXISTS "/workspace/external/rti_connext_dds-7.7.0")
SET(RTI_INSTALL_DIR "/workspace/external/rti_connext_dds-7.7.0" CACHE PATH "RTI Connext DDS installation directory")
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
SET(RTI_INSTALL_DIR "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0" CACHE PATH "RTI Connext DDS installation directory")
ELSE()
SET(RTI_INSTALL_DIR "/opt/RTI" CACHE PATH "RTI Connext DDS installation directory")
ENDIF()
ENDIF()
# Also set RTI_DIR for FindRTI.cmake compatibility (used by subdirectories)
SET(RTI_DIR "${RTI_INSTALL_DIR}" CACHE PATH "RTI base path" FORCE)
IF(EXISTS "${RTI_INSTALL_DIR}")
SET(RTI_LIB_DIR "${RTI_INSTALL_DIR}/lib/x64Linux4gcc8.5.0")
SET(RTI_INCLUDE_DIR "${RTI_INSTALL_DIR}/include/ndds/hpp")
# RTI hat vier Include-Pfade:
# - include/ für ndds/... und andere Top-Level Headers (z.B. ndds/ndds_config_common.h)
# - include/ndds/ für osapi/... Headers (z.B. osapi/osapi_platform.h)
# - include/ndds/hpp für C++ Headers (dds/..., rti/...)
# - include/rti für rti/... Headers
SET(RTI_INCLUDE_DIRS
"${RTI_INSTALL_DIR}/include"
"${RTI_INSTALL_DIR}/include/ndds"
"${RTI_INSTALL_DIR}/include/ndds/hpp"
"${RTI_INSTALL_DIR}/include/rti"
)
# RTI Include-Pfade global hinzufügen (auch für Tests die keine RTI Libraries linken)
INCLUDE_DIRECTORIES(${RTI_INCLUDE_DIRS})
# RTI Include-Pfade auch an MOC weitergeben (für Q_OBJECT Header mit RTI Types)
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${RTI_INCLUDE_DIRS})
# The generated <svc>_topic_type_plugin.h / <svc>_record_replay_plugin.h
# headers use Q_INTERFACES(DDSGeneric::TopicTypePlugin), so moc must see
# the Q_DECLARE_INTERFACE in Lts/DDS/... (resolved through the Lts include
# root). Without this path every <svc>TopicTypePlugin fails with
# "Undefined interface" even though the compiler sees the header.
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/Lts)
# The ElevationMapManager stub header (include/Viewer/SituationMap/ElevationMap/)
# lives apart from its source (src/...), so moc needs its directory explicitly.
# NOTE: this must be set at root scope - subdir-scope appends do not reach
# the AutogenInfo MOC_INCLUDES.
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap/ElevationMap)
# The migrated Projects declare Q_INTERFACES(ProjectPlugin::Plugin) and include
# <PluginInterfaces/project_plugin_interface.h>. That include dir
# (Lts/Common/PluginInterfaces/..) is only a target-level PUBLIC include of
# ProjectPluginInterface and is NOT part of the global include_directories that
# reach the AutogenInfo MOC_INCLUDES, so moc fails with "Undefined interface".
# Add the Lts/Common root explicitly (mirrors the Lts append above) so moc can
# resolve the interface. Must be set at root scope - subdir appends do not
# reach the AutogenInfo MOC_INCLUDES.
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/Lts/Common)
# IMPORTED Targets für RTI Libraries erstellen
# Debug und Release Varianten korrekt konfigurieren
FOREACH(lib nddsc nddscore nddscpp nddscpp2 nddsctesthelpers)
ADD_LIBRARY(RTI::${lib} SHARED IMPORTED)
# Debug Library
IF(EXISTS "${RTI_LIB_DIR}/lib${lib}d.so")
SET_TARGET_PROPERTIES(RTI::${lib} PROPERTIES
IMPORTED_LOCATION_DEBUG "${RTI_LIB_DIR}/lib${lib}d.so"
)
ENDIF()
# Release Library
IF(EXISTS "${RTI_LIB_DIR}/lib${lib}.so")
SET_TARGET_PROPERTIES(RTI::${lib} PROPERTIES
IMPORTED_LOCATION_RELEASE "${RTI_LIB_DIR}/lib${lib}.so"
IMPORTED_LOCATION_RELWITHDEBINFO "${RTI_LIB_DIR}/lib${lib}.so"
IMPORTED_LOCATION_MINSIZEREL "${RTI_LIB_DIR}/lib${lib}.so"
)
ENDIF()
# Include Verzeichnisse für alle Varianten
# RTI_UNIX required for basic types (RTI_INT32, RTI_UINT32, etc.)
# RTI_POSIX_THREADS required for pthread support
SET_TARGET_PROPERTIES(RTI::${lib} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${RTI_INCLUDE_DIRS}"
INTERFACE_COMPILE_DEFINITIONS "RTI_LINUX;RTI_UNIX;RTI_POSIX_THREADS"
)
ENDFOREACH()
MESSAGE(STATUS "RTI Connext DDS found at: ${RTI_INSTALL_DIR}")
MESSAGE(STATUS "RTI Libraries: ${RTI_LIB_DIR}")
MESSAGE(STATUS "RTI Platform: RTI_LINUX")
ELSE()
MESSAGE(WARNING "RTI Connext DDS not found at: ${RTI_INSTALL_DIR}, BUILD_RTI will fail")
ENDIF()
ENDIF(BUILD_RTI)
# Alias Targets für RTI Libraries (für Abwärtskompatibilität)
# Ermöglicht Verwendung von "ddscore" statt "RTI::nddscore" in CMakeLists.txt Files
# HINWEIS: ddscore, ddsftc, ddsfts, ddsconnector werden von Lts/DDS Modulen als echte Targets erstellt
# Daher hier KEINE ALIAS für diese Targets erstellen um Kollisionen zu vermeiden
IF(BUILD_RTI)
# BUILD_RTI=ON: Targets werden von Lts/DDS/Core/CMakeLists.txt erstellt - hier keine Stubs!
# Alias-Typen werden später erstellt, wenn RTI:: Targets verfügbar sind
IF(TARGET RTI::nddsc)
ADD_LIBRARY(ddsc ALIAS RTI::nddsc)
# ddscore wird von Lts/DDS/Core/CMakeLists.txt als echtes Target erstellt - kein Alias hier!
ADD_LIBRARY(ddscpp2 ALIAS RTI::nddscpp2)
# Optionale Targets nur als ALIAS erstellen wenn verfügbar (RTI 7.x hat nicht alle Legacy-Bibliotheken)
IF(TARGET RTI::nddscpp)
ADD_LIBRARY(ddscpp ALIAS RTI::nddscpp)
ENDIF()
IF(TARGET RTI::nddsctesthelpers)
ADD_LIBRARY(nddsctesthelpers ALIAS RTI::nddsctesthelpers)
ENDIF()
ENDIF()
# HINWEIS: ddsftc, ddsfts, ddsconnector werden von Lts/DDS/FTC Modulen als INTERFACE Targets erstellt
# Hier KEINE ALIAS erstellen um Target-Kollisionen zu vermeiden
ELSE()
# BUILD_RTI=OFF: Leere Interface-Libraries als Platzhalter
ADD_LIBRARY(ddsc INTERFACE)
ADD_LIBRARY(ddscore INTERFACE)
ADD_LIBRARY(ddscpp INTERFACE)
ADD_LIBRARY(ddscpp2 INTERFACE)
ADD_LIBRARY(nddsctesthelpers INTERFACE)
# HINWEIS: ddsftc, ddsfts, ddsconnector werden von Lts/DDS/FTC Modulen als INTERFACE Targets erstellt
# Hier KEINE Platzhalter erstellen um Target-Kollisionen zu vermeiden
ENDIF(BUILD_RTI)
ADD_DEFINITIONS(-DQT_USE_QSTRINGBUILDER) ADD_DEFINITIONS(-DQT_USE_QSTRINGBUILDER)
ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII) ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII)
ADD_DEFINITIONS(-DQT_NO_CAST_FROM_ASCII) ADD_DEFINITIONS(-DQT_NO_CAST_FROM_ASCII)
@@ -774,25 +503,12 @@ ENDIF()
# Ein paar NGL-spezifische Macros # Ein paar NGL-spezifische Macros
# #
INCLUDE(NGLMacros) INCLUDE(NGLMacros)
# Skip MacroCodeGenIdl for release builds as CodeGen module is excluded
IF(NOT RELEASE_BUILD)
INCLUDE(MacroCodeGenIdl)
ENDIF()
# #
# Projektspezifische Einstellungen? # Projektspezifische Einstellungen?
# #
NGL_INSTALL(SV AAR WS FILES lts-cc.conf DESTINATION . RENAME lts-cc.conf.distrib) NGL_INSTALL(SV AAR WS FILES lts-cc.conf DESTINATION . RENAME lts-cc.conf.distrib)
OPTION(ETS_MODE "Build for ETS (No B-Contamination etc)" OFF)
IF(ETS_MODE)
ADD_DEFINITIONS(-DETS_MODE)
ENDIF()
OPTION(TABLET_MODE "Build for TABLET " OFF)
IF(TABLET_MODE)
ADD_DEFINITIONS(-DTABLET_MODE)
ENDIF()
OPTION(GUEZ_MODE "Build for GUEZ " ON) OPTION(GUEZ_MODE "Build for GUEZ " ON)
IF(GUEZ_MODE) IF(GUEZ_MODE)
ADD_DEFINITIONS(-DGUEZ_MODE) ADD_DEFINITIONS(-DGUEZ_MODE)
@@ -948,74 +664,12 @@ ELSE()
ENDIF() ENDIF()
# # Release scope: always build only TetraIF, Z/src, and Lts/Common
# DDS benoetigt zwingend RTI # (TrainingAreaBase is included via Lts/Proxies when Lts is processed)
# NGL_ADD_SUBDIR_GUARDED(TetraIF)
FIND_PACKAGE(RTI QUIET) NGL_ADD_SUBDIR_GUARDED(Z/src)
if(NOT RTI_FOUND) NGL_ADD_SUBDIR_GUARDED(Lts)
message(WARNING "RTI not found; creating placeholder RTI::* imported targets to allow configure without RTI installation")
set(_rti_libs nddscore nddsc nddscpp2 rtiroutingservice)
foreach(_lib ${_rti_libs})
if(NOT TARGET RTI::${_lib})
add_library(RTI::${_lib} UNKNOWN IMPORTED)
set_property(TARGET RTI::${_lib} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "")
endif()
endforeach()
endif()
# Respect MIGRATE_MODULE: when set to a relative path (e.g. "Lts/Common"), only add
# the top-level subdirectories required to configure/build that module. This allows
# per-module migration builds via -DMIGRATE_MODULE=<path>.
if(NOT DEFINED MIGRATE_MODULE)
set(MIGRATE_MODULE "" CACHE STRING "If set, only add subdirectories covering this module (path relative to repo root)")
endif()
# RELEASE_BUILD: when ON, only build the first release modules (TetraIF, Z, Lts/Common)
# This excludes Lts/Services, Lts/DDS, Lts/Tools, Lts/Application, Lts/Proxies, Lts/Plugins, Lts/Viewer, Lts/Projects
if(NOT DEFINED RELEASE_BUILD)
set(RELEASE_BUILD OFF CACHE BOOL "Build only the first release modules (TetraIF, Z, Lts/Common)")
endif()
# For release builds, disable ArcGIS (not in release scope, requires Qt6Location which is not available)
if(RELEASE_BUILD)
set(BUILD_ARCGIS OFF CACHE BOOL "Build ArcGIS SDK dependent modules" FORCE)
endif()
# Add only guarded subdirectories
if(RELEASE_BUILD)
message(STATUS "RELEASE_BUILD=ON: Building only TetraIF, Z/src, and Lts/Common")
NGL_ADD_SUBDIR_GUARDED(TetraIF)
NGL_ADD_SUBDIR_GUARDED(Z/src)
NGL_ADD_SUBDIR_GUARDED(Lts)
else()
NGL_ADD_SUBDIR_GUARDED(TetraIF)
NGL_ADD_SUBDIR_GUARDED(Z/src)
# Services are included before plugins via Lts/CMakeLists.txt (LTS_SUBDIRS order)
NGL_ADD_SUBDIR_GUARDED(Lts)
endif()
# Add migration tests - skip when MIGRATE_MODULE targets specific Lts modules (tests need full codebase)
# MUST be after Lts configuration so tests can access Lts targets (LtsTimelineClassic, codegen_base, etc.)
if(NOT DEFINED MIGRATE_MODULE OR MIGRATE_MODULE STREQUAL "" OR MIGRATE_MODULE STREQUAL "tests")
ADD_SUBDIRECTORY(tests)
else()
message(STATUS "MIGRATE_MODULE=${MIGRATE_MODULE} - skipping tests (need full codebase)")
endif()
# TrainingAreaBase is included via Lts/Proxies when Lts is processed
# Special-case: when migrating TetraIF, also include ProjectDataManagement so generated headers
# and internal logger target are available in the same build tree for TetraIF dependents.
if(DEFINED MIGRATE_MODULE AND MIGRATE_MODULE STREQUAL "TetraIF")
message(STATUS "Including helper modules for TetraIF migration: Lts/Plugins/ProjectDataManagement")
# Services already included above when BUILD_RTI=ON
add_subdirectory(Lts/Plugins/ProjectDataManagement)
endif()
# at last, to make sure we get all targets in NGL_TS_TARGETS property # at last, to make sure we get all targets in NGL_TS_TARGETS property
NGL_ADD_SUBDIR_GUARDED(translations) NGL_ADD_SUBDIR_GUARDED(translations)
#----------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------
OPTION(BUILD_QAV "Build script for local QAV analysis" OFF)
IF (BUILD_QAV)
ADD_SUBDIRECTORY(qav)
ENDIF()
@@ -15,64 +15,21 @@ else()
message(WARNING "Doxygen config ${CMAKE_SOURCE_DIR}/doxygen/DoxyfileLts.in not found; skipping ADD_DOXYGEN_TARGET(Lts)") message(WARNING "Doxygen config ${CMAKE_SOURCE_DIR}/doxygen/DoxyfileLts.in not found; skipping ADD_DOXYGEN_TARGET(Lts)")
endif() endif()
# Add only existing subdirectories to allow partial checkouts / incremental migration # Release scope: only build Lts/Common and Lts/Proxies/TrainingAreaBase (tabTelegrams library)
if(RELEASE_BUILD) # Excludes: Tools, Application, DDS, Services, most of Proxies, Plugins, Viewer, Projects
# For first release: only build Lts/Common and Lts/Proxies/TrainingAreaBase (tabTelegrams library) message(STATUS "Building Lts/Common and Lts/Proxies/TrainingAreaBase")
# Excludes: Tools, Application, DDS, Services, most of Proxies, Plugins, Viewer, Projects if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Common")
message(STATUS "RELEASE_BUILD=ON: Building Lts/Common and Lts/Proxies/TrainingAreaBase") NGL_ADD_SUBDIR_GUARDED(Common)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Common")
NGL_ADD_SUBDIR_GUARDED(Common)
else()
message(STATUS "Skipping missing Lts subdirectory: Common")
endif()
# TrainingAreaBase provides tabTelegrams library needed by TetraIF/CoPrtCnv
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Proxies/TrainingAreaBase")
NGL_ADD_SUBDIR_GUARDED(Proxies/TrainingAreaBase)
else()
message(STATUS "Skipping missing Lts subdirectory: Proxies/TrainingAreaBase")
endif()
else() else()
set(LTS_SUBDIRS Tools Application DDS Common Services Proxies Plugins Viewer Projects) message(STATUS "Skipping missing Lts subdirectory: Common")
foreach(dir IN LISTS LTS_SUBDIRS) endif()
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}") # TrainingAreaBase provides tabTelegrams library needed by TetraIF/CoPrtCnv
# Use guarded add so top-level MIGRATE_MODULE can restrict which Lts subdirs are included if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Proxies/TrainingAreaBase")
NGL_ADD_SUBDIR_GUARDED(${dir}) NGL_ADD_SUBDIR_GUARDED(Proxies/TrainingAreaBase)
else() else()
message(STATUS "Skipping missing Lts subdirectory: ${dir}") message(STATUS "Skipping missing Lts subdirectory: Proxies/TrainingAreaBase")
endif()
endforeach()
endif() endif()
IF (BUILD_TESTING) # Export headers included by bare name from module sources (release scope)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Tests")
ADD_SUBDIRECTORY(Tests)
else()
message(STATUS "Skipping missing Tests directory under Lts (BUILD_TESTING is ON)")
endif()
ENDIF()
OPTION(BUILD_DOCS "Build documentation as html files from Lts/Documentation" OFF)
IF (BUILD_DOCS)
ADD_SUBDIRECTORY(Documentation)
ENDIF()
# Ensure codegen macros are available before calling CODEGEN_* helpers
# Skip for release builds as CodeGen module is excluded and not needed
IF(NOT RELEASE_BUILD)
INCLUDE(MacroCodeGenIdl)
ENDIF()
# Add stub headers for non-RTI/non-FilterManagement builds
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/AudioVideoManagement/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/NGLLogger/) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/NGLLogger/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsSession/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/TopicEditorBase/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/OperatorManagement/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsScriptTimeline/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsUtilsGuiDds/) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsUtilsGuiDds/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/Services/PresentationManagement/)
IF(NOT RELEASE_BUILD)
CODEGEN_WRITE_SERVICEFILE_INFO()
ENDIF()
@@ -4,59 +4,22 @@
# $Author$ # $Author$
# #
# RELEASE_BUILD: exclude modules with DDS/RTI dependencies not needed for TetraIF/Z # Core modules needed for TetraIF and Z
# DDS-dependent modules: CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation, ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
# LtsLogin, LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation, ADD_SUBDIRECTORY(httq)
ADD_SUBDIRECTORY(LtsAppDescriptor)
ADD_SUBDIRECTORY(LtsCommandLineParser)
ADD_SUBDIRECTORY(LtsCoordTrans)
ADD_SUBDIRECTORY(LtsLicence)
ADD_SUBDIRECTORY(LtsNotification)
ADD_SUBDIRECTORY(LtsRestClient)
ADD_SUBDIRECTORY(LtsSerialPortQuerry)
# Excluded: LtsTimeline (depends on LtsWidgets which has DDS dependencies)
ADD_SUBDIRECTORY(LtsUtils)
ADD_SUBDIRECTORY(LtsWebSocket)
ADD_SUBDIRECTORY(PluginInterfaces)
ADD_SUBDIRECTORY(ProjectConfig)
# Excluded: CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation, LtsLogin,
# LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
# LtsScriptTimeline, LtsSession, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets, # LtsScriptTimeline, LtsSession, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets,
# PluginInterfaces (TopicReplayInterface, RecordReplayPlugin), TopicEditorBase # TopicEditorBase
if(RELEASE_BUILD)
# Core modules needed for TetraIF and Z
ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
ADD_SUBDIRECTORY(httq)
ADD_SUBDIRECTORY(LtsAppDescriptor)
ADD_SUBDIRECTORY(LtsCommandLineParser)
ADD_SUBDIRECTORY(LtsCoordTrans)
ADD_SUBDIRECTORY(LtsLicence)
ADD_SUBDIRECTORY(LtsNotification)
ADD_SUBDIRECTORY(LtsRestClient)
ADD_SUBDIRECTORY(LtsSerialPortQuerry)
# Excluded: LtsTimeline (depends on LtsWidgets which has DDS dependencies)
ADD_SUBDIRECTORY(LtsUtils)
ADD_SUBDIRECTORY(LtsWebSocket)
ADD_SUBDIRECTORY(PluginInterfaces)
ADD_SUBDIRECTORY(ProjectConfig)
# Excluded: CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation, LtsLogin,
# LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
# LtsScriptTimeline, LtsSession, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets,
# TopicEditorBase
else()
ADD_SUBDIRECTORY(CodeGen)
ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
ADD_SUBDIRECTORY(httq)
ADD_SUBDIRECTORY(LtsAppDescriptor)
ADD_SUBDIRECTORY(LtsAppManager)
ADD_SUBDIRECTORY(LtsCommandLineParser)
ADD_SUBDIRECTORY(LtsCoordinate)
ADD_SUBDIRECTORY(LtsCoordTrans)
ADD_SUBDIRECTORY(LtsElevation)
ADD_SUBDIRECTORY(LtsLicence)
ADD_SUBDIRECTORY(LtsLogin)
ADD_SUBDIRECTORY(LtsMultiMonitor)
ADD_SUBDIRECTORY(LtsNotification)
ADD_SUBDIRECTORY(LtsPluginManager)
ADD_SUBDIRECTORY(LtsPrinting)
ADD_SUBDIRECTORY(LtsProjectionWorkstation)
ADD_SUBDIRECTORY(LtsRestClient)
ADD_SUBDIRECTORY(LtsScriptTimeline)
ADD_SUBDIRECTORY(LtsSerialPortQuerry)
ADD_SUBDIRECTORY(LtsSession)
ADD_SUBDIRECTORY(LtsTimeline)
ADD_SUBDIRECTORY(LtsUtils)
ADD_SUBDIRECTORY(LtsVirtualKeyboard)
ADD_SUBDIRECTORY(LtsWebSocket)
ADD_SUBDIRECTORY(LtsWidgets)
ADD_SUBDIRECTORY(PluginInterfaces)
ADD_SUBDIRECTORY(ProjectConfig)
ADD_SUBDIRECTORY(TopicEditorBase)
endif()
@@ -1,4 +1,4 @@
// Stub GTest smoke test for coordTrans
#include <gtest/gtest.h> #include <gtest/gtest.h>
TEST(CoordTransSmokeTest, StubTest) TEST(CoordTransSmokeTest, StubTest)
@@ -1,4 +1,4 @@
// Stub QtTest smoke test for coordTrans
#include <QTest> #include <QTest>
class CoordTransSmokeTest : public QObject class CoordTransSmokeTest : public QObject
@@ -1,5 +1,3 @@
// MockCoordTrans.h - Stub mock for CoordTrans functionality
// This is a placeholder to allow builds without full CoordTrans implementation
#ifndef MOCK_COORD_TRANS_H #ifndef MOCK_COORD_TRANS_H
#define MOCK_COORD_TRANS_H #define MOCK_COORD_TRANS_H
@@ -35,8 +35,6 @@ NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptor
NGL_INSTALL_TARGET(LtsAppDescriptor) NGL_INSTALL_TARGET(LtsAppDescriptor)
# LtsAppDescriptorChecker # LtsAppDescriptorChecker
SET(LtsAppDescriptorChecker_SRCS SET(LtsAppDescriptorChecker_SRCS
checker/main.cpp checker/main.cpp
@@ -51,27 +49,6 @@ NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptorChecker
Qt6::Core Qt6::Core
) )
# LtsAppDescriptorEditor => Hat niemand benutzt, wird keiner benutzen, also wird der bis auf Weiteres auch nicht an die neue Syntax angepasst.
#SET(LtsAppDescriptorEditor_SRCS
# lts_app_descriptor_editor.cpp
# lts_app_descriptor_editor.h
#)
#NGL_WRAP_UI(LtsAppDescriptorEditor_SRCS
# lts_app_descriptor_editor.ui
#)
#NGL_ADD_LIBRARY2(WS NO_TRANSLATION LtsAppDescriptorEditor SHARED ${LtsAppDescriptorEditor_SRCS})
#NGL_TARGET_INCLUDE_DIRECTORIES(LtsAppDescriptorEditor
# PUBLIC
# ${CMAKE_CURRENT_SOURCE_DIR}/../
#)
if(QT6_GUI_AVAILABLE) if(QT6_GUI_AVAILABLE)
#NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptorEditor #NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptorEditor
# PUBLIC # PUBLIC
@@ -8,7 +8,4 @@
ADD_SUBDIRECTORY(LtsUtilsCore) ADD_SUBDIRECTORY(LtsUtilsCore)
IF(NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(LtsUtilsGui)
ENDIF()
ADD_SUBDIRECTORY(LtsUtilsSettings) ADD_SUBDIRECTORY(LtsUtilsSettings)
@@ -48,22 +48,3 @@ NGL_TARGET_LINK_LIBRARIES(LtsUtilsCore
Qt6::Core Qt6::Core
LtsUtilsCoreHeaderOnly LtsUtilsCoreHeaderOnly
) )
#
# --- Tests --------------------------------------------------------------
#
IF(BUILD_RTI AND (BUILD_WS OR BUILD_SV) AND BUILD_TESTING)
ADD_EXECUTABLE(utils_test
UnitTests/utils_test.cpp
UnitTests/utils_test.h
promise_examples.h
promise_examples.cpp
)
TARGET_LINK_LIBRARIES(utils_test
LtsUtilsCore
Qt6::Core
Qt6::Test
ddscore
)
ADD_TEST(NAME utils_test COMMAND $<TARGET_FILE:utils_test>)
ENDIF()
@@ -45,9 +45,6 @@ if(QT6_GUI_AVAILABLE)
Qt6::Svg Qt6::Svg
) )
endif() endif()
IF(BUILD_RTI)
TARGET_LINK_LIBRARIES(LtsUtilsGuiDds PUBLIC ddscore)
ENDIF(BUILD_RTI)
NGL_TARGET_COMPILE_DEFINITIONS(LtsUtilsGuiDds NGL_TARGET_COMPILE_DEFINITIONS(LtsUtilsGuiDds
PUBLIC PUBLIC
REQUEST_HELPER_WITH_GUI REQUEST_HELPER_WITH_GUI
@@ -66,6 +63,3 @@ NGL_TARGET_LINK_LIBRARIES(LtsUtilsDds
PUBLIC PUBLIC
Qt6::Core Qt6::Core
) )
IF(BUILD_RTI)
TARGET_LINK_LIBRARIES(LtsUtilsDds PUBLIC ddscore)
ENDIF(BUILD_RTI)
@@ -14,16 +14,6 @@ ADD_LIBRARY(DataPluginInterface SHARED
TARGET_INCLUDE_DIRECTORIES(DataPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..) TARGET_INCLUDE_DIRECTORIES(DataPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(DataPluginInterface PUBLIC Qt6::Core) TARGET_LINK_LIBRARIES(DataPluginInterface PUBLIC Qt6::Core)
# GuiPluginInterface
IF(NOT RELEASE_BUILD)
ADD_LIBRARY(GuiPluginInterface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/gui_plugin_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/gui_plugin_interface.cpp
)
TARGET_INCLUDE_DIRECTORIES(GuiPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(GuiPluginInterface PUBLIC Qt6::Core LtsWidgets ProjectConfig LtsAppDescriptor LtsUtilsCore)
ENDIF()
# projectPluginInterface # projectPluginInterface
ADD_LIBRARY(ProjectPluginInterface SHARED ADD_LIBRARY(ProjectPluginInterface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/project_plugin_interface.h ${CMAKE_CURRENT_SOURCE_DIR}/project_plugin_interface.h
@@ -39,24 +29,3 @@ ADD_LIBRARY(StylePluginInterface SHARED
) )
TARGET_INCLUDE_DIRECTORIES(StylePluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..) TARGET_INCLUDE_DIRECTORIES(StylePluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(StylePluginInterface PUBLIC Qt6::Core) TARGET_LINK_LIBRARIES(StylePluginInterface PUBLIC Qt6::Core)
# record_replay_plugin (requires RTI DDS)
if(BUILD_RTI)
ADD_LIBRARY(RecordReplayPlugin SHARED
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.h
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.cpp
)
TARGET_INCLUDE_DIRECTORIES(RecordReplayPlugin PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(RecordReplayPlugin PUBLIC Qt6::Core)
# Topic Replay Interface (requires RTI DDS and TopicEditorBase)
ADD_LIBRARY(TopicReplayInterface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.cpp
)
TARGET_INCLUDE_DIRECTORIES(TopicReplayInterface PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_BINARY_DIR}/Lts/Common/TopicEditorBase # topiceditorbase_export.h
)
TARGET_LINK_LIBRARIES(TopicReplayInterface PUBLIC Qt6::Core TopicEditorBase)
endif()
@@ -1,14 +1,6 @@
# Modified CMakeLists.txt from github.com/wille-io/httq # Modified CMakeLists.txt from github.com/wille-io/httq
# Make ${Qt6_WebSockets} optional # Make ${Qt6_WebSockets} optional
# Link the real WebSockets module whenever the websocket code path is
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
# Qt6::WebSockets import are set when the real module was found. The old
# QT6_GUI_AVAILABLE condition never held in this environment (Qt6
# discovery takes the minimal path) and the Qt6_WebSockets variable was
# never defined, so AbstractServer.cpp compiled the websocket code
# without the module on the link line (undefined reference to
# QWebSocketServer::handleConnection).
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND) if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
set(Qt6_WebSockets Qt6::WebSockets) set(Qt6_WebSockets Qt6::WebSockets)
else() else()
@@ -16,9 +16,6 @@ else()
endif() endif()
INCLUDE(MacroRTIDDSGen)
INCLUDE(MacroCodeGenIdl)
ADD_SUBDIRECTORY(Plugins) ADD_SUBDIRECTORY(Plugins)
SET(xml_FILE tab_service.xml) SET(xml_FILE tab_service.xml)
@@ -36,6 +33,9 @@ SET(SRCS_telegrams
training_area_telegrams.h training_area_telegrams.h
) )
NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams}) NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams})
# tabTelegrams is a STATIC lib linked into shared/MODULE targets
SET_TARGET_PROPERTIES(tabTelegrams PROPERTIES POSITION_INDEPENDENT_CODE ON)
NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..
@@ -70,34 +70,17 @@ SET(SRCS_common
tab_export.h tab_export.h
) )
IF(BUILD_RTI) # Stub files (no RTI code generation in the release scope)
# Generate tab_enums.idl / tab.idl LIST(APPEND SRCS_common
CODEGEN_IDL_SVC(SRCS_common ${xml_FILE}) stubs/tab_enums_stub.hpp
# Generate tab_db_impl.cpp/.h, tab_db.h stubs/tab_stub.hpp
CODEGEN_DATABASE(SRCS_common ${xml_FILE}) stubs/tab_db_stub.hpp
# Generate *.cpp/*.hpp from idl (only with BUILD_RTI) stubs/tab_topic_type_plugin_stub.cpp
RTIDDSGEN(SRCS_common tab_enums.idl) )
# tab.idl includes pdm.idl, so add explicit dependency on pdm.idl generation
RTIDDSGEN(SRCS_common tab.idl DEPENDS ${CMAKE_BINARY_DIR}/Lts/Services/ProjectDataManagement/pdm.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})
ELSE()
# Stub files for BUILD_RTI=OFF - NO code generation
LIST(APPEND SRCS_common
stubs/tab_enums_stub.hpp
stubs/tab_stub.hpp
stubs/tab_db_stub.hpp
stubs/tab_topic_type_plugin_stub.cpp
)
ENDIF()
# Create target only if component flags allow # Create target only if component flags allow
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common}) NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
# Generate export header ALWAYS (needed for logger.h even if target not built)
# Use custom command to create minimal export header if target wasn't created
IF(NOT TARGET svcTabCommon) IF(NOT TARGET svcTabCommon)
# Create a dummy static library just for export header generation # Create a dummy static library just for export header generation
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common}) ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
@@ -121,220 +104,8 @@ NGL_TARGET_LINK_LIBRARIES(svcTabCommon
$<IF:$<TARGET_EXISTS:svcPdmCommon>,svcPdmCommon,> $<IF:$<TARGET_EXISTS:svcPdmCommon>,svcPdmCommon,>
LtsUtilsCoreHeaderOnly LtsUtilsCoreHeaderOnly
) )
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcTabCommon
PRIVATE
RTI::nddscpp2
PUBLIC
ddscore
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcTabCommon) NGL_INSTALL_TARGET(svcTabCommon)
#
# --- Library svcTabClient --------------------------------------------------------------------------------
#
# Skip for release builds - DDS-dependent service library
IF(NOT RELEASE_BUILD)
SET(SRCS_client
tab_export.h
)
IF(BUILD_RTI)
# generate tab_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
ENDIF()
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabClient SHARED ${SRCS_client})
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
# MAKE_<SYMBOL>_LIB compile guard, but the generated tab_[d|f]tc_impl.h
# headers require MAKE_SVCTABCLIENT_LIB — same situation as
# svcCoreClient/ddscore, which define their guards explicitly.
TARGET_COMPILE_DEFINITIONS(svcTabClient PRIVATE MAKE_SVCTABCLIENT_LIB)
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcTabClient
PRIVATE
RTI::nddscpp2
ddsconnector
PUBLIC
svcTabCommon
ddsftc
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcTabClient)
ENDIF() # NOT RELEASE_BUILD
#
# --- Library svcTabServer --------------------------------------------------------------------------------
#
# Skip for release builds - DDS-dependent service library
IF(NOT RELEASE_BUILD)
SET(SRCS_server
tx_mixin.cpp
tx_mixin.h
)
IF(BUILD_RTI)
# generate tab_[d|f]ts.h, tab_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
ENDIF()
NGL_ADD_LIBRARY2(AAR HLA SV svcTabServer SHARED ${SRCS_server}) # NGL_ADD_LIBRARY2 won't work here - no time for investigations
# Generated tab_[d|f]ts_impl.h require MAKE_SVCTABSERVER_LIB (see svcTabClient above).
TARGET_COMPILE_DEFINITIONS(svcTabServer PRIVATE MAKE_SVCTABSERVER_LIB)
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
PUBLIC
svcTabCommon
ngldb
${_QT_CORE_TARGET}
$<IF:$<AND:$<BOOL:${QT6_GUI_AVAILABLE}>,$<TARGET_EXISTS:Qt6::Gui>>,Qt6::Gui,>
${_QT_NETWORK_TARGET}
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcTabServer
PRIVATE
RTI::nddscpp2
ddsconnector
ddsfts
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcTabServer)
ENDIF() # NOT RELEASE_BUILD
#
# --- Topic Type Plugin --------------------------------------------------------------
#
IF(BUILD_RTI)
CREATE_TOPIC_TYPE_PLUGIN(${xml_FILE})
ENDIF()
#
# --- RecordReplayPlugin --------------------------------------------------------------
#
IF(BUILD_RTI)
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()
ENDIF()
#
# --- Executable svcTrainingAreaBase (sTAB) -------------------------------------------------
#
# Skip for release builds - DDS-dependent executable
IF(NOT RELEASE_BUILD)
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}
)
IF(BUILD_RTI)
# Generate tab.sql, tab.xml
CODEGEN_SQL(SRCS_exe ${xml_FILE})
ENDIF()
NGL_ADD_SVC_ICON(SRCS_exe)
NGL_ADD_EXECUTABLE(AAR SV svcTrainingAreaBase ${SRCS_exe})
NGL_TARGET_LINK_LIBRARIES(svcTrainingAreaBase
Qt6::Core
Qt6::Network
LtsCoordTrans
LtsWebSocketServer
LtsCommandLineParser
LtsPluginLoader
LtsUtilsCoreHeaderOnly
LtsUtilsCore
svcTabCommon
svcTabServer
# main_handler.cpp includes the generated <TrainingAreaBase/tab_record_replay_plugin.h>
# and directly instantiates TrainingAreaBase::RecordReplayPluginCustom (whose methods
# live in the plugin .so). Linking the plugin target (rather than relying on a full
# `make all` having generated the header first) makes this a proper build dependency:
# the plugin's codegen runs before the exe compiles (so the generated header exists),
# the plugin's PUBLIC build-tree include dir is inherited (so the include resolves),
# and the plugin .so is linked (so the RecordReplayPluginCustom symbols resolve).
$<IF:$<TARGET_EXISTS:tabRecordReplayPlugin>,tabRecordReplayPlugin,>
svcNomClient
svcAesClient
svcOpmClient
svcCoreClient
svcAsmClient
svcExmClient
$<IF:$<TARGET_EXISTS:svcIsmClient>,svcIsmClient,>
svcPdmClient
svcPpmClient
$<IF:$<TARGET_EXISTS:ddsconnector>,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)
ENDIF() # NOT RELEASE_BUILD
# clientPluginInterface # clientPluginInterface
ADD_LIBRARY(tabPluginInterface INTERFACE) ADD_LIBRARY(tabPluginInterface INTERFACE)
TARGET_SOURCES(tabPluginInterface INTERFACE TARGET_SOURCES(tabPluginInterface INTERFACE
@@ -4,43 +4,5 @@
# $Author$ # $Author$
# #
IF (NOT BUILD_RPM AND NOT RELEASE_BUILD) # Release scope: only the TetraJson plugin is in the tree (GUEZ project, no RTI)
ADD_SUBDIRECTORY(DebugJsonDir) ADD_SUBDIRECTORY(TetraJson)
ENDIF()
#ADD_SUBDIRECTORY(Spu)
IF (BUILD_WLS AND NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(WlsTetra)
ELSE()
ADD_SUBDIRECTORY(TetraJson)
ENDIF()
IF ("${_pname}" STREQUAL "commaster")
ADD_SUBDIRECTORY(Nmea)
ENDIF()
IF (BUILD_SV AND DEFINED _pname)
IF ("${_pname}" STREQUAL "guez")
IF(NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(HlaJson)
ENDIF()
ENDIF()
ENDIF()
IF (BUILD_SVC_HLA)
IF ("${_pname}" STREQUAL "ahtc")
ADD_SUBDIRECTORY(ApacheHlaJson)
ENDIF()
ENDIF()
# AdlerJson depends on svcPdmClient (ProjectDataManagement) which is not in release scope
IF(NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(AdlerJson)
ENDIF()
OPTION(BUILD_UAS_PROXY "Build the UAS TAB Plugin (default: OFF) [needs BUILD_SV = ON and UNIX-like OS]" OFF) # TODO: use 'pname = guez' if done
if (BUILD_SV AND BUILD_UAS_PROXY AND NOT WIN32 AND NOT RELEASE_BUILD)
add_subdirectory(UAS)
endif()
@@ -1,5 +1,3 @@
// Stub file for tab_db - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated database code
#ifndef TAB_DB_STUB_HPP #ifndef TAB_DB_STUB_HPP
#define TAB_DB_STUB_HPP #define TAB_DB_STUB_HPP
@@ -1,5 +1,3 @@
// Stub file for tab_enums - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated enums
#ifndef TAB_ENUMS_STUB_HPP #ifndef TAB_ENUMS_STUB_HPP
#define TAB_ENUMS_STUB_HPP #define TAB_ENUMS_STUB_HPP
@@ -1,6 +1,3 @@
// Stub file for tab types - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated types
#ifndef TAB_STUB_HPP #ifndef TAB_STUB_HPP
#define TAB_STUB_HPP #define TAB_STUB_HPP
@@ -1,6 +1,3 @@
// Stub file for tab_topic_type_plugin - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated plugin code
#include "tab_enums_stub.hpp" #include "tab_enums_stub.hpp"
namespace tab namespace tab
@@ -1,5 +1,3 @@
// Stub file for pdm - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated code
#ifndef PDM_HPP #ifndef PDM_HPP
#define PDM_HPP #define PDM_HPP
@@ -10,9 +8,6 @@
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
// Forward declarations and stub types for ProjectDataManagement namespace
// Used when BUILD_RTI=OFF to allow compilation without RTI Connext DDS
namespace ProjectDataManagement namespace ProjectDataManagement
{ {
@@ -1,6 +1,3 @@
// Stub file for pdm_db - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated database code
#ifndef PDM_DB_STUB_HPP #ifndef PDM_DB_STUB_HPP
#define PDM_DB_STUB_HPP #define PDM_DB_STUB_HPP
@@ -1,5 +1,3 @@
// Stub file for pdm_enums - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated code
#ifndef PDM_ENUMS_STUB_HPP #ifndef PDM_ENUMS_STUB_HPP
#define PDM_ENUMS_STUB_HPP #define PDM_ENUMS_STUB_HPP
@@ -1,5 +1,3 @@
// Stub file for pdm - BUILD_RTI=OFF
// Auto-generated stub to replace RTI IDL-generated code
#ifndef PDM_STUB_HPP #ifndef PDM_STUB_HPP
#define PDM_STUB_HPP #define PDM_STUB_HPP
+299
View File
@@ -0,0 +1,299 @@
# qt6-migrated-legatus — build and run, step by step
Build guide for the Qt6-migrated legatus tree on the release
**validation-scope** branch. Everything runs inside a prebuilt Docker
image; the host only needs Docker.
## Scope
What `new_docker_build.sh` builds and packages:
| Area | Contents |
|---|---|
| `TetraIF/` | `CoPrtCnv`, `LogView`, `PrtCnv` (+ `unit-test/` — see Step 3) |
| `Z/src/` | NGL application/core library stack (NGLLogger, nglcoreapplication, …) |
| `Lts/Common/` | LTS common libraries (LtsCoordTrans, LtsLicence, LtsUtils, …) |
| `Lts/Proxies/TrainingAreaBase` | `tabTelegrams` library, built as a TetraIF dependency |
Entries at the tree root:
- `new_docker_build.sh` — build driver (image build, compile, ctest, DEB packaging)
- `Dockerfile` — recipe of the prebuilt build image (Ubuntu 26.04 + Qt 6.10.2 + deps)
- `rpmbuild/make_rpm_ubuntu26.py` — in-tree DEB package producer (self-contained)
- `jenkins-ci-rme/` — in-tree copy of the Jenkins CI flow (see its own `README.md`)
- `build4/` — build tree, created by the driver (git-ignored scratch area)
Toolchain inside the image: **Ubuntu 26.04, GCC 15.2.0, Qt 6.10.2**
(`/opt/Qt/6.10.2/gcc_64`), C++17, Release build. No license file is
required.
## Prerequisites
1. **Docker** available on the host.
2. The tree must be reachable inside the container at
`/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus`, i.e.
mount the pipeline root on `/workspace` — this is how
`new_docker_build.sh` invokes Docker, so running the driver as-is
satisfies this.
The driver resolves the pipeline root from its own location (override
with the exported `MIGRATE_PIPELINE_ROOT` or the `.envrc` in this
directory).
All commands below are run **from this directory**
(`qt6-migrated-legatus/`).
## Step 1 — Build the prebuilt Docker image (once)
```bash
./new_docker_build.sh --build-prebuilt-image --docker-image legatus-qt6:1.0
```
This builds the image from the in-tree `Dockerfile` (Ubuntu 26.04 base,
apt deps, Qt 6.10.2 via `aqtinstall`, KDReports from source). Re-run it
only after changing the `Dockerfile` or the `APT_PACKAGES` list in
`new_docker_build.sh`.
To remove it later:
```bash
./new_docker_build.sh --delete-prebuilt-image --docker-image legatus-qt6:1.0
```
## Step 2 — Compile the release scope
```bash
./new_docker_build.sh --docker-image legatus-qt6:1.0
```
What the driver does inside the container:
1. `rm -rf build4 && mkdir build4 && cd build4` (fresh build tree)
2. Configure with CMake:
```bash
cmake .. \
-DBUILD_TESTING=ON \
-DRELEASE_BUILD=ON \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/opt/Qt/6.10.2/gcc_64:/usr/local
```
(`RELEASE_BUILD=ON` selects the release scope; everything else is at
its CMake default.)
3. `make -j8` the release-scope targets (TetraIF modules, Z stack,
Lts/Common libraries, all test executables — the list is
`RELEASE_BUILD_TARGETS` in `new_docker_build.sh`).
4. Run **ctest** (see Step 3).
Output to inspect after the run:
- `build4/release_build.log` — full make output (the build must end with
**0 warnings**)
- `build4/bin/` — executables (apps + test binaries)
- `build4/lib/` — shared libraries
To rebuild incrementally without a fresh tree, run `make` directly in an
interactive container against the existing `build4/`:
```bash
docker run --rm -it -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 \
&& make -j8'
```
## Run an executable directly
To run a built executable interactively — e.g. the GUI apps under
`build4/bin/` (`LogView`, `PrtCnv`) against your local display — start a
shell inside the container with X11 forwarding:
```bash
docker run --rm -it \
-e DISPLAY \
-e LC_ALL=C.UTF-8 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /path/to/pipeline-root:/workspace \
legatus-qt6:1.0 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 && exec bash'
```
## Step 3 — Run the tests
### 3.1 ctest (automatic)
`new_docker_build.sh` already runs `ctest --test-dir build4
--output-on-failure` after the compile. Expected baseline (7 tests, all
passed):
| # | Test | Result |
|---|---|---|
| 1 | `coprtcnv_unit_test` | Passed |
| 2 | `logview_unit_test` | Passed |
| 3 | `prtcnv_unit_test` | Passed |
| 4 | `NGLToolsQtSmoke` | Passed |
| 5 | `test_nglpdfwidget` | Passed |
| 6 | `lts_coord_trans_unit_test` | Passed |
| 7 | `aes_crypt_test` | Passed |
### 3.2 Build the unit tests only
```bash
docker run --rm -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 \
&& make -j8 coprtcnv_unit_test logview_unit_test prtcnv_unit_test'
```
### 3.3 Run a test executable directly
GUI-free tests need the offscreen Qt platform in a headless container:
```bash
docker run --rm -it -v /path/to/pipeline-root:/workspace legatus-qt6:1.0 \
bash -c 'export QT_QPA_PLATFORM=offscreen
cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4
./bin/coprtcnv_unit_test # CoPrtCnv: telegrams, fragmentation, helpers
./bin/logview_unit_test # LogView: IntegerCalculator
./bin/prtcnv_unit_test # PrtCnv: PrtCnvMember fragmented-telegram handling
./bin/lts_coord_trans_unit_test
./bin/aes_crypt_test
./bin/test_nglpdfwidget
# or everything registered:
ctest --output-on-failure'
```
Each QtTest binary accepts a single slot name to run just one test,
e.g. `./bin/coprtcnv_unit_test radioTelegramFragmentationRoundtrip`.
### 3.4 TetraIF unit tests (`TetraIF/unit-test/`)
| Test | Module covered | Note |
|---|---|---|
| `coprtcnv_unit_test` | `CoPrtCnv` — central & radio telegram header fields, payload access, length checks, fragmentation/reassembly roundtrip, id→string helpers | links `CoPrtCnv` |
| `logview_unit_test` | `LogView` — `IntegerCalculator` (arithmetic, precedence, error codes, variables) | compiles `LogView/IntegerCalculator.cpp` into the test (the class otherwise lives in the LogView executable) |
| `prtcnv_unit_test` | `PrtCnv` — `PrtCnvMember` state + fragmented-telegram add/reassembly | compiles `PrtCnv/PrtCnvMember.cpp` into the test because `PrtCnvLib` is built with hidden visibility (its symbols are not linkable from outside) |
Sources are registered with ctest via `TetraIF/unit-test/CMakeLists.txt`
and packaged into the ctest DEBs (see Step 4).
## Step 4 — Produce the release DEB packages
```bash
export WORKSPACE=/path/to/pipeline-root # e.g. ~/release/qt6-migration-pipeline
export PROJECT=guez
export OS_VERSION=26.04
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
--run-jenkins-builder \
--package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/" \
> /path/to/build.log 2>&1
```
(export the variables *before* the command — command-prefix variables are
not expanded in the same command's arguments.)
The driver compiles the release scope, runs ctest, then stages the tree
and runs the in-tree `rpmbuild/make_rpm_ubuntu26.py`, which produces 5
DEBs in `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/`:
| DEB | Contents |
|---|---|
| `qt6-release-runtime_*` | runtime libraries + the release-scope executables |
| `qt6-release-sources_*` | release-scope sources |
| `qt6-release-ctest-runtime_*` | test executables under `/usr/lib/ctest/` (incl. the TetraIF unit tests) |
| `qt6-release-ctest-sources_*` | test sources (files with "test" in the name under the release dirs, incl. `TetraIF/unit-test/*.cpp`) |
| `qt6-release-build-pipeline_*` | the in-tree pipeline files (`new_docker_build.sh`, `Dockerfile`, `CMakeLists.txt`, `rpmbuild/`, `jenkins-ci-rme/`) under `/usr/src/pipeline/` |
Verify a package:
```bash
dpkg -c "${WORKSPACE}/rpms/guez/26.04/qt6-release-ctest-runtime_1.0-1_amd64.deb" \
| grep unit_test
dpkg -i "${WORKSPACE}/rpms/guez/26.04/"*.deb # install locally, if wanted
```
A copy of the DEBs is also placed in the container's
`/workspace/packages-out` mount (same-file skip guarded by device:inode).
## Step 5 — CI / Jenkins flow (optional)
The in-tree `jenkins-ci-rme/` directory contains the full Jenkins
pipeline (`Jenkinsfile`, builder, publisher) adapted to this tree. For a
local dry run of the same flow without Jenkins:
```bash
jenkins-ci-rme/release-16-10-2026.sh
```
See `jenkins-ci-rme/README.md` for the pipeline details.
## Step 6 — Code coverage (lcov)
```bash
export WORKSPACE=/path/to/pipeline-root # e.g. ~/release/qt6-migration-pipeline
export PROJECT=guez
export OS_VERSION=26.04
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
--run-coverage \
--coverage-output-dir "${WORKSPACE}/coverage/${PROJECT}/${OS_VERSION}/" \
> /path/to/coverage.log 2>&1
```
(export the variables *before* the command — command-prefix variables are
not expanded in the same command's arguments.)
The driver builds the release scope with `-O0 --coverage`, runs the same ctest
suite, then captures the data with lcov: the report covers the release scope
(`TetraIF`, `Z/src`, `Lts/Common`, `Lts/Proxies/TrainingAreaBase`), and test
sources are filtered out of the report, so the percentages reflect the module
code.
Artifacts in the coverage output directory:
| File | Contents |
|---|---|
| `html/index.html` | browsable report (line + branch coverage per file) |
| `coverage.info` | machine-readable lcov tracefile |
| `coverage_summary.txt` | whole-scope totals |
`--run-coverage` is mutually exclusive with `--run-jenkins-builder` (different
instrumentation of the same build tree).
The Jenkins pipeline runs the same step on every build (`RunCoverage`
parameter, on by default) and archives the report as build artifacts under
`coverage/<project>/<os>/`; the local dry run
(`jenkins-ci-rme/release-16-10-2026.sh`) does the same, with
`DRYRUN_COVERAGE=OFF` to skip coverage there.
## Options reference
`./new_docker_build.sh --help` prints the full option list. The main
ones:
| Option | Default | Purpose |
|---|---|---|
| `--docker-image IMAGE` | `legatus-qt6:1.0` | image to use/build/delete |
| `--build-prebuilt-image` | — | build the image from `./Dockerfile` and exit |
| `--delete-prebuilt-image` | — | delete the image and exit |
| `--run-jenkins-builder` | off | produce the DEB packages (Step 4) |
| `--package-output-dir DIR` | `./packages-out` | where the DEBs are written |
| `--lts-version / --project / --build-number / --build-tag` | `1.0` / `guez` / `1` / `manual-build` | package metadata |
| `--run-coverage` | off | coverage build + lcov report (Step 6) |
| `--coverage-output-dir DIR` | `./coverage-out` | where the coverage report is written |
Environment overrides: `DOCKER_IMAGE`, `RUN_JENKINS_BUILDER`,
`PACKAGE_OUTPUT_DIR`, `RUN_COVERAGE`, `COVERAGE_OUTPUT_DIR`, `PROJECT`,
`LTS_VERSION`, `GUEZ_MODE`, `BUILD_NUMBER`, `BUILD_TAG`,
`MIGRATE_PIPELINE_ROOT`.
## Troubleshooting
- **"no Qt platform plugin could be initialized"** when running a test
binary by hand → `export QT_QPA_PLATFORM=offscreen`.
- **Stale build tree** → the driver always recreates `build4/`; for
manual builds delete `build4/` and rerun Step 2 if CMake behaves oddly.
- **DEBs not on the host** → the output dir must be a path that exists
*on the host* (it is bind-mounted into the container as
`/workspace/packages-out`); check the `package-output-dir` argument.
@@ -7,3 +7,4 @@
ADD_SUBDIRECTORY(CoPrtCnv) ADD_SUBDIRECTORY(CoPrtCnv)
ADD_SUBDIRECTORY(LogView) ADD_SUBDIRECTORY(LogView)
ADD_SUBDIRECTORY(PrtCnv) ADD_SUBDIRECTORY(PrtCnv)
ADD_SUBDIRECTORY(unit-test)
@@ -14,6 +14,8 @@ NGL_TARGET_LINK_LIBRARIES(LogViewLogger
NGLLogger NGLLogger
) )
SET_TARGET_PROPERTIES(LogViewLogger PROPERTIES POSITION_INDEPENDENT_CODE ON)
SET(my_SRCS SET(my_SRCS
IntegerCalculator.cpp IntegerCalculator.cpp
IntegerCalculator.hpp IntegerCalculator.hpp
@@ -15,4 +15,26 @@
<file>image/ShowSend.png</file> <file>image/ShowSend.png</file>
<file>image/Wls.png</file> <file>image/Wls.png</file>
</qresource> </qresource>
<qresource prefix="/icons/16x16">
<file alias="configure.png">../../Z/src/nglwidgets/icons/16x16/configure.png</file>
<file alias="dialog-ok-apply.png">../../Z/src/nglwidgets/icons/16x16/dialog-ok-apply.png</file>
<file alias="document-edit.png">../../Z/src/nglwidgets/icons/16x16/document-edit.png</file>
<file alias="document-import.png">../../Z/src/nglwidgets/icons/16x16/document-import.png</file>
<file alias="document-new.png">../../Z/src/nglwidgets/icons/16x16/document-new.png</file>
<file alias="document-open-data.png">../../Z/src/nglwidgets/icons/16x16/document-open-data.png</file>
<file alias="document-save.png">../../Z/src/nglwidgets/icons/16x16/document-save.png</file>
<file alias="edit-copy.png">../../Z/src/nglwidgets/icons/16x16/edit-copy.png</file>
<file alias="edit-delete.png">../../Z/src/nglwidgets/icons/16x16/edit-delete.png</file>
<file alias="edit-paste.png">../../Z/src/nglwidgets/icons/16x16/edit-paste.png</file>
<file alias="edit-redo.png">../../Z/src/nglwidgets/icons/16x16/edit-redo.png</file>
<file alias="go-down.png">../../Z/src/nglwidgets/icons/16x16/go-down.png</file>
<file alias="go-up.png">../../Z/src/nglwidgets/icons/16x16/go-up.png</file>
<file alias="list-add.png">../../Z/src/nglwidgets/icons/16x16/list-add.png</file>
<file alias="list-remove.png">../../Z/src/nglwidgets/icons/16x16/list-remove.png</file>
<file alias="mail-send.png">../../Z/src/nglwidgets/icons/16x16/mail-send.png</file>
<file alias="media-play-normal.png">../../Z/src/nglwidgets/icons/16x16/media-play-normal.png</file>
<file alias="media-playback-start.png">../../Z/src/nglwidgets/icons/16x16/media-playback-start.png</file>
<file alias="media-playback-stop.png">../../Z/src/nglwidgets/icons/16x16/media-playback-stop.png</file>
<file alias="rde_16x16.png">../../Z/src/nglwidgets/icons/16x16/rde_16x16.png</file>
</qresource>
</RCC> </RCC>
@@ -1 +0,0 @@
zsksxd_tetraForLogView.x
@@ -1 +0,0 @@
zsksxd_tetraForLogView_guez.x
File diff suppressed because it is too large. Load diff
@@ -5,12 +5,6 @@
# #
#ADD_SUBDIRECTORY(TetraTestServer)
IF(NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(LastTest)
ADD_SUBDIRECTORY(LastTestAuswertung)
ENDIF()
SET(PrtCnv_SRCS SET(PrtCnv_SRCS
logger.h logger.h
logger.cpp logger.cpp
@@ -0,0 +1,46 @@
#
# Unit tests for the TetraIF modules (CoPrtCnv, LogView, PrtCnv).
# One test executable per module, each registered with ctest.
#
# LogView: the module is classes are compiled into the LogView executable
#
if (NOT BUILD_TESTING)
return()
endif()
# --- CoPrtCnv: telegram classes and helpers --------------------------------
if (TARGET CoPrtCnv)
ADD_EXECUTABLE(coprtcnv_unit_test coprtcnv_unit_test.cpp)
TARGET_LINK_LIBRARIES(coprtcnv_unit_test
CoPrtCnv
NGLLogger
Qt6::Core
Qt6::Test
)
ADD_TEST(NAME coprtcnv_unit_test COMMAND $<TARGET_FILE:coprtcnv_unit_test>)
endif()
# --- LogView: IntegerCalculator --------------------------------------------
ADD_EXECUTABLE(logview_unit_test
logview_unit_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../LogView/IntegerCalculator.cpp)
TARGET_LINK_LIBRARIES(logview_unit_test
Qt6::Core
Qt6::Test
)
ADD_TEST(NAME logview_unit_test COMMAND $<TARGET_FILE:logview_unit_test>)
# --- PrtCnv: PrtCnvMember (fragmented telegram handling) --------------------
if (TARGET CoPrtCnv)
ADD_EXECUTABLE(prtcnv_unit_test
prtcnv_unit_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../PrtCnv/PrtCnvMember.cpp)
TARGET_LINK_LIBRARIES(prtcnv_unit_test
CoPrtCnv
NGLLogger
Qt6::Core
Qt6::Test
)
ADD_TEST(NAME prtcnv_unit_test COMMAND $<TARGET_FILE:prtcnv_unit_test>)
endif()
@@ -0,0 +1,175 @@
//
// Unit tests for the CoPrtCnv module: central telegram, radio telegram
// (header fields, payload access, fragmentation) and the string helpers.
//
#include <CoPrtCnv/CoPrtCnvCentralTelegram.hpp>
#include <CoPrtCnv/CoPrtCnvHexDumpHelper.hpp>
#include <CoPrtCnv/CoPrtCnvLogHeader.hpp>
#include <CoPrtCnv/CoPrtCnvRadioTelegram.hpp>
#include <CoPrtCnv/tetra_telegram_ids.h>
#include <TrainingAreaBase/training_area_telegrams.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QByteArray>
#include <QtTest/QTest>
#include <memory>
#include <vector>
class coprtcnv_unit_test : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void centralTelegramFromId();
void centralTelegramDataRoundtrip();
void centralTelegramCounter();
void radioTelegramSourceIssi();
void radioTelegramDestIssi();
void radioTelegramIdentity();
void radioTelegramCounter();
void radioTelegramPayloadBytes();
void radioTelegramLengthChecks();
void radioTelegramFragmentationRoundtrip();
void radioTelegramLoginVsNormal();
void telegramIdToString();
void wirkfeldTypToString();
};
void coprtcnv_unit_test::initTestCase()
{
NGL::NGLLoggerBootstrap::createNGLRootLogger("log4cxx.props", false);
}
void coprtcnv_unit_test::centralTelegramFromId()
{
N_CoPrtCnv::CoPrtCnvCentralTelegram tele(TrainingAreaBase::TetraIcd::BESTAETIGUNG);
QCOMPARE(tele.telegramId(), TrainingAreaBase::TetraIcd::BESTAETIGUNG);
}
void coprtcnv_unit_test::centralTelegramDataRoundtrip()
{
N_CoPrtCnv::CoPrtCnvCentralTelegram tele(TrainingAreaBase::TetraIcd::BESTAETIGUNG);
const QByteArray data(QByteArrayLiteral("central-telegram-payload"));
tele.setData(data);
QCOMPARE(tele.data(), data);
}
void coprtcnv_unit_test::centralTelegramCounter()
{
N_CoPrtCnv::CoPrtCnvCentralTelegram tele(TrainingAreaBase::TetraIcd::BESTAETIGUNG);
tele.setCounter(42);
QCOMPARE(tele.counter(), 42);
}
void coprtcnv_unit_test::radioTelegramSourceIssi()
{
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(0x12345678);
QCOMPARE(tele.getSrcISSI(), 0x12345678u);
}
void coprtcnv_unit_test::radioTelegramDestIssi()
{
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(0x00000001);
tele.setDestISSI(0x87654321);
QCOMPARE(tele.getDestISSI(), 0x87654321u);
}
void coprtcnv_unit_test::radioTelegramIdentity()
{
// Identity is only a field of the DataIndReq payload (the (id, size, identity) constructor); other PDU types have no identity area.
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(GEF_BESTAETIGUNG, 32, 0xBEEF);
QCOMPARE(tele.getIdentity(), 0xBEEF);
}
void coprtcnv_unit_test::radioTelegramCounter()
{
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(0x00000003);
tele.setZaehler(7);
QCOMPARE(tele.zaehler(), 7);
}
void coprtcnv_unit_test::radioTelegramPayloadBytes()
{
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(GEF_BESTAETIGUNG, 32, 0x3333);
QCOMPARE(tele.getPayloadSize(), 32);
const uint8_t pattern[4] = {0xDE, 0xAD, 0xBE, 0xEF};
tele.setPayloadData(pattern, 4);
QCOMPARE(tele.getPayloadDataUInt8(3), 0xDE);
QCOMPARE(tele.getPayloadDataUInt8(4), 0xAD);
QCOMPARE(tele.getPayloadDataUInt8(5), 0xBE);
QCOMPARE(tele.getPayloadDataUInt8(6), 0xEF);
// getPayloadDataUInt32 assembles the bytes big endian
QCOMPARE(tele.getPayloadDataUInt32(3, 4), 0xDEADBEEFu);
}
void coprtcnv_unit_test::radioTelegramLengthChecks()
{
// isTelegramLengthOk: length <= MAX_RADIO_TELEGRAM_PAYLOAD_LENGTH
// + DATA_IND_REQ_HEADER_LENGTH - sizeof(GwHeader) - PAYLOAD_STATUS_LENGTH
// = 249 + 27 - 4 - 1 = 271
QVERIFY(N_CoPrtCnv::CoPrtCnvRadioTelegram::isTelegramLengthOk(271));
QVERIFY(!N_CoPrtCnv::CoPrtCnvRadioTelegram::isTelegramLengthOk(272));
QVERIFY(!N_CoPrtCnv::CoPrtCnvRadioTelegram::isTelegramLengthOk(1000));
}
void coprtcnv_unit_test::radioTelegramFragmentationRoundtrip()
{
// Build a big telegram whose payload must be fragmented, reassemble the
// fragments and compare the payload area against the original data.
const uint16_t payloadSize = 300;
std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> bigPtr(new N_CoPrtCnv::CoPrtCnvRadioTelegram(GEF_BESTAETIGUNG, payloadSize, 0x1111));
const int payloadPart = bigPtr->getSize() - N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH;
const uint8_t maxFragPayload = N_CoPrtCnv::CoPrtCnvRadioTelegram::MAX_RADIO_TELEGRAM_PAYLOAD_LENGTH
- N_CoPrtCnv::CoPrtCnvRadioTelegram::PAYLOAD_STATUS_LENGTH;
const uint8_t nbrFragments = static_cast<uint8_t>((payloadPart - 1) / maxFragPayload);
QVERIFY(nbrFragments >= 1);
std::vector<std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> > frags;
std::multimap<uint16_t, N_CoPrtCnv::CoPrtCnvRadioTelegram *> fragList;
for (uint8_t i = 0; i <= nbrFragments; ++i)
{
bool error = true;
auto frag = std::make_shared<N_CoPrtCnv::CoPrtCnvRadioTelegram>(bigPtr, i, error);
QVERIFY2(!error, "fragment creation failed");
frags.push_back(frag);
fragList.insert(std::make_pair(frag->getFragmentCounter(), frag.get()));
}
QCOMPARE(static_cast<int>(fragList.size()), static_cast<int>(nbrFragments) + 1);
const QByteArray unfragmented = N_CoPrtCnv::CoPrtCnvRadioTelegram::getUnfragmentedData(fragList);
QVERIFY(!unfragmented.isEmpty());
QCOMPARE(unfragmented.size(), bigPtr->data().size());
QCOMPARE(unfragmented.mid(N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH - 1),
bigPtr->data().mid(N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH - 1));
}
void coprtcnv_unit_test::radioTelegramLoginVsNormal()
{
N_CoPrtCnv::CoPrtCnvRadioTelegram login(N_CoPrtCnv::CoPrtCnvRadioTelegram::e_LoginRequest, 0x2222, 0x00000005);
QVERIFY(login.isLoginTelegram());
QVERIFY(!login.isNormalTelegram());
}
void coprtcnv_unit_test::telegramIdToString()
{
// telegramId2String / wirkfeldTyp2Str are declared in global scope
const QByteArray known = telegramId2String(GEF_BESTAETIGUNG);
QVERIFY(!known.isEmpty());
}
void coprtcnv_unit_test::wirkfeldTypToString()
{
const QString text = wirkfeldTyp2Str(TrainingAreaBase::TetraIcd::AreaEffectSimulationType::BeStillWarning);
QVERIFY(!text.isEmpty());
}
QTEST_MAIN(coprtcnv_unit_test)
#include "coprtcnv_unit_test.moc"
@@ -0,0 +1,150 @@
//
// Unit tests for the LogView module: IntegerCalculator (the module's pure
// logic class, compiled from the LogView sources).
//
#include "../LogView/IntegerCalculator.hpp"
#include <QtTest/QTest>
#include <string>
using IntegerCalculator = N_SST::IntegerCalculator;
using E_Error = IntegerCalculator::E_Error;
class logview_unit_test : public QObject
{
Q_OBJECT
private slots:
void basicArithmetic();
void operatorPriority();
void parentheses();
void unaryMinus();
void divisionByZero();
void noOperandBetweenOperators();
void missingRightParanthesis();
void missingLeftParanthesis();
void unknownVariable();
void variables();
};
void logview_unit_test::basicArithmetic()
{
IntegerCalculator calc;
E_Error error = E_Error::e_UnknownError;
QCOMPARE(calc.calc("1+2", error), 3);
QCOMPARE(error, E_Error::e_Ok);
QCOMPARE(calc.calc("10-4", error), 6);
QCOMPARE(error, E_Error::e_Ok);
QCOMPARE(calc.calc("6*7", error), 42);
QCOMPARE(error, E_Error::e_Ok);
QCOMPARE(calc.calc("84/4", error), 21);
QCOMPARE(error, E_Error::e_Ok);
}
void logview_unit_test::operatorPriority()
{
IntegerCalculator calc;
E_Error error = E_Error::e_UnknownError;
QCOMPARE(calc.calc("1+2*3", error), 7);
QCOMPARE(error, E_Error::e_Ok);
QCOMPARE(calc.calc("2*3+4", error), 10);
QCOMPARE(error, E_Error::e_Ok);
QCOMPARE(calc.calc("10-2*3", error), 4);
QCOMPARE(error, E_Error::e_Ok);
}
void logview_unit_test::parentheses()
{
IntegerCalculator calc;
E_Error error = E_Error::e_UnknownError;
QCOMPARE(calc.calc("(1+2)*3", error), 9);
QCOMPARE(error, E_Error::e_Ok);
QCOMPARE(calc.calc("((2+3)*4)", error), 20);
QCOMPARE(error, E_Error::e_Ok);
}
void logview_unit_test::unaryMinus()
{
IntegerCalculator calc;
E_Error error = E_Error::e_UnknownError;
QCOMPARE(calc.calc("-3+5", error), 2);
QCOMPARE(error, E_Error::e_Ok);
}
void logview_unit_test::divisionByZero()
{
IntegerCalculator calc;
E_Error error = E_Error::e_Ok;
(void)calc.calc("1/0", error);
QCOMPARE(error, E_Error::e_DivisionByZero);
}
void logview_unit_test::noOperandBetweenOperators()
{
IntegerCalculator calc;
E_Error error = E_Error::e_Ok;
(void)calc.calc("1+*2", error);
QCOMPARE(error, E_Error::e_NoOperandBetweenOperators);
}
void logview_unit_test::missingRightParanthesis()
{
IntegerCalculator calc;
E_Error error = E_Error::e_Ok;
(void)calc.calc("(1+2", error);
QCOMPARE(error, E_Error::e_MissingRightParanthesis);
}
void logview_unit_test::missingLeftParanthesis()
{
IntegerCalculator calc;
E_Error error = E_Error::e_Ok;
(void)calc.calc("1+2)", error);
QCOMPARE(error, E_Error::e_MissingLeftParanthesis);
}
void logview_unit_test::unknownVariable()
{
IntegerCalculator calc;
E_Error error = E_Error::e_Ok;
(void)calc.calc("y", error);
QCOMPARE(error, E_Error::e_UnknownOperationOrVariable);
}
void logview_unit_test::variables()
{
IntegerCalculator calc;
E_Error error = E_Error::e_UnknownError;
calc.addVariable("x", 5);
QCOMPARE(calc.calc("x*2", error), 10);
QCOMPARE(error, E_Error::e_Ok);
calc.addVariable("y", -3);
QCOMPARE(calc.calc("x+y", error), 2);
QCOMPARE(error, E_Error::e_Ok);
calc.removeVariable("x");
error = E_Error::e_Ok;
(void)calc.calc("x", error);
QCOMPARE(error, E_Error::e_UnknownOperationOrVariable);
}
QTEST_MAIN(logview_unit_test)
#include "logview_unit_test.moc"
@@ -0,0 +1,115 @@
//
// Unit tests for the PrtCnv module: PrtCnvMember (member state and
// fragmented telegram handling / reassembly).
//
#include <PrtCnv/PrtCnvMember.hpp>
#include <CoPrtCnv/CoPrtCnvRadioTelegram.hpp>
#include <CoPrtCnv/tetra_telegram_ids.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtTest/QTest>
#include <memory>
#include <vector>
class prtcnv_unit_test : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void memberDefaults();
void fragmentedListEmptyInitially();
void addAndClearFragments();
void unfragmentationRoundtrip();
};
void prtcnv_unit_test::initTestCase()
{
NGL::NGLLoggerBootstrap::createNGLRootLogger("log4cxx.props", false);
}
void prtcnv_unit_test::memberDefaults()
{
PrtCnv::PrtCnvMember member(7, 0x1234);
QCOMPARE(member.m_Id, 7);
QCOMPARE(member.m_ISSI, 0x1234);
QCOMPARE(member.m_ClaimCount, 0);
QCOMPARE(member.m_loggedInExerciseId, 0);
QCOMPARE(member.m_Licensed, false);
}
void prtcnv_unit_test::fragmentedListEmptyInitially()
{
PrtCnv::PrtCnvMember member(1, 0x0001);
QVERIFY(member.isFragmentedListEmpty());
QVERIFY(member.getUnfragmentedTelegramData().isEmpty());
}
void prtcnv_unit_test::addAndClearFragments()
{
const uint16_t payloadSize = 300;
std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> bigPtr(new N_CoPrtCnv::CoPrtCnvRadioTelegram(GEF_BESTAETIGUNG, payloadSize, 0x4321));
const int payloadPart = bigPtr->getSize() - N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH;
const uint8_t maxFragPayload = N_CoPrtCnv::CoPrtCnvRadioTelegram::MAX_RADIO_TELEGRAM_PAYLOAD_LENGTH
- N_CoPrtCnv::CoPrtCnvRadioTelegram::PAYLOAD_STATUS_LENGTH;
const uint8_t nbrFragments = static_cast<uint8_t>((payloadPart - 1) / maxFragPayload);
PrtCnv::PrtCnvMember member(1, 0x0001);
QVERIFY(member.isFragmentedListEmpty());
std::vector<std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> > frags;
for (uint8_t i = 0; i <= nbrFragments; ++i)
{
bool error = true;
auto frag = std::make_shared<N_CoPrtCnv::CoPrtCnvRadioTelegram>(bigPtr, i, error);
QVERIFY2(!error, "fragment creation failed");
frags.push_back(frag);
member.addFragmentedTelegram(*frag);
}
QVERIFY(!member.isFragmentedListEmpty());
QCOMPARE(member.getFragmentedTelegramId(), GEF_BESTAETIGUNG);
member.clearFragmentedList();
QVERIFY(member.isFragmentedListEmpty());
}
void prtcnv_unit_test::unfragmentationRoundtrip()
{
// A big telegram with a known payload pattern, fragmented into the member and reassembled
const uint16_t payloadSize = 300;
std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> bigPtr(new N_CoPrtCnv::CoPrtCnvRadioTelegram(GEF_BESTAETIGUNG, payloadSize, 0x5678));
QByteArray pattern(payloadSize, 0);
for (int i = 0; i < payloadSize; ++i)
pattern[i] = static_cast<char>(i * 7 + 1);
bigPtr->setPayloadData(reinterpret_cast<const uint8_t *>(pattern.constData()), payloadSize);
const int payloadPart = bigPtr->getSize() - N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH;
const uint8_t maxFragPayload = N_CoPrtCnv::CoPrtCnvRadioTelegram::MAX_RADIO_TELEGRAM_PAYLOAD_LENGTH
- N_CoPrtCnv::CoPrtCnvRadioTelegram::PAYLOAD_STATUS_LENGTH;
const uint8_t nbrFragments = static_cast<uint8_t>((payloadPart - 1) / maxFragPayload);
PrtCnv::PrtCnvMember member(2, 0x0002);
std::vector<std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> > frags;
for (uint8_t i = 0; i <= nbrFragments; ++i)
{
bool error = true;
auto frag = std::make_shared<N_CoPrtCnv::CoPrtCnvRadioTelegram>(bigPtr, i, error);
QVERIFY2(!error, "fragment creation failed");
frags.push_back(frag);
member.addFragmentedTelegram(*frag);
}
const QByteArray unfragmented = member.getUnfragmentedTelegramData();
QCOMPARE(unfragmented.size(), bigPtr->data().size());
QCOMPARE(unfragmented.mid(N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH - 1),
bigPtr->data().mid(N_CoPrtCnv::CoPrtCnvRadioTelegram::DATA_IND_REQ_HEADER_LENGTH - 1));
}
QTEST_MAIN(prtcnv_unit_test)
#include "prtcnv_unit_test.moc"
@@ -28,18 +28,3 @@ NGL_TARGET_LINK_LIBRARIES(nglcompression
) )
# BZip2 disabled - no linking needed # BZip2 disabled - no linking needed
NGL_INSTALL_TARGET(nglcompression) NGL_INSTALL_TARGET(nglcompression)
IF(BUILD_WS AND BUILD_TESTING)
REMOVE_DEFINITIONS(-DQT_GUI_LIB)
ADD_EXECUTABLE(nglcomp_test nglcomp_test.cpp nglcomp_test.h)
TARGET_LINK_LIBRARIES(nglcomp_test
NGLLogger
nglcoreapplication
ngltools
nglcompression
Qt6::Test
)
ADD_TEST(NAME nglcomp_test COMMAND $<TARGET_FILE:nglcomp_test>)
ENDIF()
@@ -83,11 +83,13 @@ NGL_WRAP_UI(nglwidgets_SRCS
) )
# Collect big resource QRCs # Collect big resource QRCs
set(oxygen_SRCS nglresources.qrc) set(oxygen_SRCS)
if(TARGET Qt6::Core) if(TARGET Qt6::Core)
# Use Qt6's CMake helper to generate resource sources so resources are available at runtime # Use Qt6's CMake helper to generate resource sources so resources are available at runtime.
qt_add_resources(RME_LIGHT_RCC rme_light_style.qrc) # Both qrcs MUST go through qt_add_resources: a raw .qrc left in the source list is not
list(APPEND oxygen_SRCS ${RME_LIGHT_RCC}) # compiled (CMAKE_AUTORCC is off), so its resources would be missing at runtime
# (e.g. :icons/16x16/* toolbar/window icons used by LogView).
qt_add_resources(oxygen_SRCS nglresources.qrc rme_light_style.qrc)
else() else()
NGL_ADD_BIG_RESOURCES(oxygen_SRCS nglresources.qrc rme_light_style.qrc) NGL_ADD_BIG_RESOURCES(oxygen_SRCS nglresources.qrc rme_light_style.qrc)
endif() endif()
@@ -1,125 +0,0 @@
IF(ARCGIS_INCLUDE_DIR AND ARCGIS_LIBRARY)
SET(ARCGIS_FOUND TRUE)
ELSE()
INCLUDE(FindLibraryWithDebug)
INCLUDE(FindPackageHandleStandardArgs)
SET(QT_MIN_VERSION 6.0.0)
FIND_PACKAGE(Qt6 COMPONENTS Core Gui Location Network Sensors)
IF (NOT Qt6_FOUND)
MESSAGE(WARNING "Qt6 not found; skipping ArcGIS")
SET(BUILD_ARCGIS OFF CACHE BOOL "Build ArcGIS SDK dependent modules" FORCE)
RETURN()
ENDIF()
SET(_arcgis_include_hint "${CMAKE_SOURCE_DIR}/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk/include")
SET(_arcgis_library_hint "${CMAKE_SOURCE_DIR}/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk/linux/x64/lib")
# Check if paths exist, if not try alternative paths
IF(NOT EXISTS "${_arcgis_include_hint}")
SET(_arcgis_include_hint "${CMAKE_SOURCE_DIR}/../../external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk/include")
SET(_arcgis_library_hint "${CMAKE_SOURCE_DIR}/../../external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk/linux/x64/lib")
ENDIF()
SET(_arcgis_lib_dir $ENV{ARCGIS_LIB_DIR})
SET(_arcgis_inc_dir $ENV{ARCGIS_INC_DIR})
IF (NOT ${_arcgis_lib_dir} STREQUAL "")
SET(_arcgis_library_hint "${_arcgis_lib_dir}")
ENDIF()
IF (NOT ${_arcgis_inc_dir} STREQUAL "")
SET(_arcgis_include_hint "${_arcgis_inc_dir}")
ENDIF()
IF(WIN32)
GET_FILENAME_COMPONENT(_arcgis_root_path "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\ESRI\\ArcGISRuntimeQt100.0.0;InstallDir]" ABSOLUTE)
IF(_arcgis_root_path)
SET(_arcgis_include_hint "${_arcgis_root_path}/sdk/windows/include/")
SET(_arcgis_library_hint "${_arcgis_root_path}/sdk/windows/x86/lib/")
ELSE()
SET(_root "$ENV{KDEROOT}")
FILE(TO_CMAKE_PATH "${_root}" _root)
IF(NOT EXISTS "${_root}" OR NOT IS_DIRECTORY "${_root}")
SET(_root $ENV{WORKSPACE})
FILE(TO_CMAKE_PATH "${_root}" _root)
ENDIF()
IF(NOT EXISTS "${_root}" OR NOT IS_DIRECTORY "${_root}")
SET(_root ${EXTERNAL_LIBRARY_DIR})
FILE(TO_CMAKE_PATH "${_root}" _root)
ENDIF()
SET(_arcgis_include_hint "${_root}/include/")
SET(_arcgis_library_hint "${_root}/lib/")
ENDIF()
ENDIF()
FIND_PATH(ARCGIS_INCLUDE_DIR ArcGISQt_global.h HINTS ${_arcgis_include_hint})
FIND_LIBRARY(ARCGIS_LIBRARY NAMES EsriRuntimeQt HINTS ${_arcgis_library_hint})
FIND_LIBRARY(ARCGIS_COMMON_LIBRARY NAMES EsriCommonQt HINTS ${_arcgis_library_hint})
IF (UNIX)
FIND_LIBRARY(ARCGIS_CPP_LIBRARY NAMES runtimecore HINTS ${_arcgis_library_hint})
ENDIF()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ArcGIS DEFAULT_MSG ARCGIS_LIBRARY ARCGIS_INCLUDE_DIR)
MARK_AS_ADVANCED(ARCGIS_INCLUDE_DIR ARCGIS_LIBRARY)
IF(NOT ARCGIS_FOUND)
SET(BUILD_ARCGIS OFF CACHE BOOL "Build ArcGIS SDK dependent modules" FORCE)
ENDIF()
ENDIF()
IF(NOT TARGET ArcGIS::ArcGIS)
ADD_LIBRARY(ArcGIS::ArcGIS UNKNOWN IMPORTED)
SET_PROPERTY(TARGET ArcGIS::ArcGIS PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${ARCGIS_INCLUDE_DIR}")
SET_PROPERTY(TARGET ArcGIS::ArcGIS PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${ARCGIS_INCLUDE_DIR}")
IF(ARCGIS_LIBRARY_RELEASE)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
SET_PROPERTY(TARGET ArcGIS::ArcGIS PROPERTY IMPORTED_LOCATION_RELEASE "${ARCGIS_LIBRARY_RELEASE}")
ENDIF()
IF(ARCGIS_LIBRARY_DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS PROPERTY IMPORTED_LOCATION_DEBUG "${ARCGIS_LIBRARY_DEBUG}")
ENDIF()
IF(NOT ARCGIS_LIBRARY_RELEASE AND NOT ARCGIS_LIBRARY_DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS PROPERTY IMPORTED_LOCATION "${ARCGIS_LIBRARY}")
ENDIF()
# APPEND (not replace): line 95 above set the ArcGIS SDK include dir; a plain
# SET_PROPERTY here overwrote it, so consumers (e.g. advancedSymbology) never
# saw <Symbol.h> etc. Base-state defect carried over from the legacy Qt5 file
# (identical overwrite of the Qt5 include dirs), never surfaced because the
# ArcGIS-ON GROUP5 path was never validated in this pipeline.
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<TARGET_PROPERTY:Qt6::Core,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt6::Location,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt6::Network,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Qt6::Sensors,INTERFACE_INCLUDE_DIRECTORIES>
)
IF (UNIX)
IF(ARCGIS_COMMON_LIBRARY_RELEASE)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Release>:"${ARCGIS_COMMON_LIBRARY_RELEASE}">)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Release>:"${ARCGIS_CPP_LIBRARY_RELEASE}">)
ENDIF()
IF(ARCGIS_COMMON_LIBRARY_DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Debug>:"${ARCGIS_COMMON_LIBRARY_DEBUG}">)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Debug>:"${ARCGIS_CPP_LIBRARY_DEBUG}">)
ENDIF()
IF(ARCGIS_COMMON_LIBRARY AND NOT ARCGIS_COMMON_LIBRARY_RELEASE AND NOT ARCGIS_COMMON_LIBRARY_DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${ARCGIS_COMMON_LIBRARY}" "${ARCGIS_CPP_LIBRARY}")
ENDIF()
ELSE()
IF(ARCGIS_COMMON_LIBRARY_RELEASE)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Release>:${ARCGIS_COMMON_LIBRARY_RELEASE}>)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:RelWithDebInfo>:${ARCGIS_COMMON_LIBRARY_RELEASE}>)
ENDIF()
IF(ARCGIS_COMMON_LIBRARY_DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Debug>:${ARCGIS_COMMON_LIBRARY_DEBUG}>)
ENDIF()
IF(ARCGIS_COMMON_LIBRARY AND NOT ARCGIS_COMMON_LIBRARY_RELEASE AND NOT ARCGIS_COMMON_LIBRARY_DEBUG)
SET_PROPERTY(TARGET ArcGIS::ArcGIS APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${ARCGIS_COMMON_LIBRARY}")
ENDIF()
ENDIF()
ENDIF()
@@ -1,26 +0,0 @@
INCLUDE(FindPackageHandleStandardArgs)
INCLUDE(FindLibraryWithDebug)
# Allow user to supply BGVIEWER_DIR or check ./external/BgViewer by default
if(NOT DEFINED BGVIEWER_DIR)
if(DEFINED ENV{EXTERNAL_DIR})
set(_external_hint "$ENV{EXTERNAL_DIR}")
else()
set(_external_hint "${CMAKE_SOURCE_DIR}/external")
endif()
set(BGVIEWER_DIR "${_external_hint}/BgViewer" CACHE PATH "BgViewer root directory (optional)")
endif()
# Search in common system locations and in BGVIEWER_DIR
set(_hints "${BGVIEWER_DIR}/lib" "${BGVIEWER_DIR}/lib/*" "${BGVIEWER_DIR}/lib/*/*")
FIND_LIBRARY_WITH_DEBUG(BGVIEWER_DTENTITY_LIBRARY WIN32_DEBUG_POSTFIX d dtEntity HINTS ${_hints})
FIND_LIBRARY_WITH_DEBUG(BGVIEWER_DTENTITYOSG_LIBRARY WIN32_DEBUG_POSTFIX d dtEntityOSG HINTS ${_hints})
FIND_PATH(BGVIEWER_INCLUDE_DIR dtEntity/export.h HINTS "${BGVIEWER_DIR}/include" "${BGVIEWER_DIR}/include/dtEntity" ${_hints} )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(BgViewer DEFAULT_MSG
BGVIEWER_DTENTITY_LIBRARY
BGVIEWER_DTENTITYOSG_LIBRARY
BGVIEWER_INCLUDE_DIR)
SET(BGVIEWER_LIBRARIES ${BGVIEWER_DTENTITYOSG_LIBRARY}
${BGVIEWER_DTENTITY_LIBRARY})
@@ -1,48 +0,0 @@
include(FindPkgConfig)
if(NOT BOTAN_FOUND)
pkg_check_modules(Botan botan-2)
endif()
if(NOT BOTAN_FOUND)
find_path(BOTAN_INCLUDE_DIRS NAMES botan/botan.h
PATH_SUFFIXES botan-2
DOC "The botan include directory")
find_library(BOTAN_LIBRARIES NAMES botan botan-2
DOC "The botan library")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Botan REQUIRED_VARS BOTAN_LIBRARIES BOTAN_INCLUDE_DIRS)
if(BOTAN_FOUND)
set(BOTAN_LIBRARY ${BOTAN_LIBRARIES} CACHE INTERNAL "")
set(BOTAN_INCLUDE_DIR ${BOTAN_INCLUDE_DIRS} CACHE INTERNAL "")
set(BOTAN_FOUND ${BOTAN_FOUND} CACHE INTERNAL "")
endif()
endif()
mark_as_advanced(BOTAN_INCLUDE_DIRS BOTAN_LIBRARIES)
@@ -1,43 +0,0 @@
# Find module for Grantlee5 (Qt5) / Grantlee (Qt6 compatible)
# Grantlee 5.3.0 provides Qt6-compatible targets
if (TARGET Grantlee5::Templates)
set(Grantlee5_FOUND TRUE)
return()
endif()
# Try config-mode: look for Grantlee5Config.cmake in standard locations
# Grantlee 5.3.0 installs to /usr/local/lib/cmake/Grantlee5/
find_package(Grantlee5 CONFIG QUIET)
if(TARGET Grantlee5::Templates)
set(Grantlee5_FOUND TRUE)
return()
endif()
# Try pkg-config as a best-effort (may fail)
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(GRANTLEE5 QUIET grantlee-templates)
if (GRANTLEE5_FOUND)
set(Grantlee5_FOUND TRUE)
# No imported targets provided by this shim
return()
endif()
endif()
# Try config-mode: look for Grantlee5Config.cmake in CMAKE_PREFIX_PATH or installed location
# Try to locate Grantlee5Config.cmake via common locations: CMAKE_PREFIX_PATH, EXTERNAL_DIR, repo/external, and typical install paths
find_file(_Grantlee5Config NAMES Grantlee5Config.cmake
PATHS ${CMAKE_PREFIX_PATH} $ENV{EXTERNAL_DIR} ${CMAKE_SOURCE_DIR}/../external /home/torsten/swy/sandbox/external /repo/external /repo/external/grantlee /usr/local/lib/cmake/Grantlee5
PATH_SUFFIXES grantlee/lib/cmake/Grantlee5 lib/cmake/Grantlee5)
if(_Grantlee5Config)
include(${_Grantlee5Config})
if(TARGET Grantlee5::Templates)
set(Grantlee5_FOUND TRUE)
return()
endif()
endif()
# Not found: provide helpful message and stop. Downstream CMakeLists check TARGET Grantlee5::Templates
set(Grantlee5_FOUND FALSE)
message(STATUS "Grantlee5 not found (shim cmake/FindGrantlee5.cmake); codegen_grantlee will be skipped if present.")
@@ -1,40 +0,0 @@
IF(KDCHART_INCLUDE_DIRS AND KDCHART_LIBRARY)
SET(KDCHART_FOUND TRUE)
ELSE()
FIND_PATH(KDCHART_INCLUDE_DIRS KDChart/kdchart_export.h)
FIND_LIBRARY(KDCHART_LIBRARY NAMES kdchart)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KDChart DEFAULT_MSG KDCHART_LIBRARY KDCHART_INCLUDE_DIRS)
MARK_AS_ADVANCED(KDCHART_INCLUDE_DIRS KDCHART_LIBRARY)
ENDIF()
IF(NOT TARGET KDChart::KDChart)
ADD_LIBRARY(KDChart::KDChart UNKNOWN IMPORTED)
SET_PROPERTY(TARGET KDChart::KDChart PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${KDCHART_INCLUDE_DIRS}")
SET_PROPERTY(TARGET KDChart::KDChart PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${KDCHART_INCLUDE_DIRS}")
SET_PROPERTY(TARGET KDChart::KDChart PROPERTY IMPORTED_LOCATION "${KDCHART_LIBRARY}")
ENDIF()
@@ -1,62 +0,0 @@
# Qt6 only - no Qt5 fallback
find_package(Qt6 COMPONENTS Core Gui PrintSupport Sql Svg Widgets Xml QUIET)
if(NOT Qt6_FOUND)
set(KDReports_FOUND FALSE)
return()
endif()
set(_qt_prefix "Qt6")
# Prefer KDReports-qt6 package config if installed under standard prefixes
# Search in common installation locations for KDReports cmake config
list(APPEND CMAKE_PREFIX_PATH /usr/local /usr)
find_package(KDReports-qt6 CONFIG QUIET PATHS /usr/local/lib/cmake/KDReports-qt6 /usr/local/lib64/cmake/KDReports-qt6 /usr/lib/cmake/KDReports-qt6 /usr/lib64/cmake/KDReports-qt6)
if(KDReports-qt6_FOUND OR KDReports-qt6_CONFIG)
message(STATUS "Found KDReports-qt6 package config")
set(KDREPORTS_FOUND TRUE)
set(KDReports_FOUND TRUE)
# KDReports-qt6 config provides KDReports::KDReports imported target
# Set variables for compatibility with code that uses them
set(KDREPORTS_INCLUDE_DIR "/usr/local/include/KDReports-qt6")
set(KDREPORTS_KDREPORTS_INCLUDE_DIR "/usr/local/include/KDReports-qt6")
# Check lib64 first, then lib
if(EXISTS "/usr/local/lib64/libkdreports-qt6.so")
set(KDREPORTS_LIBRARY "/usr/local/lib64/libkdreports-qt6.so")
else()
set(KDREPORTS_LIBRARY "/usr/local/lib/libkdreports-qt6.so")
endif()
else()
# Search both /usr and /usr/local for apt-installed or manually built KDReports
FIND_PATH(KDREPORTS_INCLUDE_DIR KDReports/KDReports.h PATHS /usr/include /usr/local/include)
FIND_PATH(KDREPORTS_KDREPORTS_INCLUDE_DIR KDReports.h PATH_SUFFIXES KDReports PATHS /usr/include /usr/local/include)
FIND_LIBRARY(KDREPORTS_LIBRARY NAMES kdreports kdreport kdreports-qt6 PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KDReports DEFAULT_MSG
KDREPORTS_LIBRARY
KDREPORTS_INCLUDE_DIR
KDREPORTS_KDREPORTS_INCLUDE_DIR
)
MARK_AS_ADVANCED(KDREPORTS_INCLUDE_DIR KDREPORTS_LIBRARY)
MARK_AS_ADVANCED(KDREPORTS_KDREPORTS_INCLUDE_DIR KDREPORTS_LIBRARY)
endif()
# The root CMakeLists may already have created a no-op stub target for
# KDReports::KDReports (before FindKDReports ran). When the library was found,
# upgrade that existing target to the real imported target instead of skipping.
IF(KDReports_FOUND)
IF(NOT TARGET KDReports::KDReports)
ADD_LIBRARY(KDReports::KDReports UNKNOWN IMPORTED)
ENDIF()
SET_PROPERTY(TARGET KDReports::KDReports PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${KDREPORTS_INCLUDE_DIR}" "${KDREPORTS_KDREPORTS_INCLUDE_DIR}")
SET_PROPERTY(TARGET KDReports::KDReports PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${KDREPORTS_INCLUDE_DIR}" "${KDREPORTS_KDREPORTS_INCLUDE_DIR}")
SET_PROPERTY(TARGET KDReports::KDReports PROPERTY IMPORTED_LOCATION "${KDREPORTS_LIBRARY}")
SET_PROPERTY(TARGET KDReports::KDReports PROPERTY INTERFACE_COMPILE_DEFINITIONS "")
SET_PROPERTY(TARGET KDReports::KDReports APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${_qt_prefix}::Core ${_qt_prefix}::Gui ${_qt_prefix}::PrintSupport ${_qt_prefix}::Widgets)
ELSE()
IF(NOT TARGET KDReports::KDReports)
ADD_LIBRARY(KDReports::KDReports UNKNOWN IMPORTED)
ENDIF()
ENDIF()
@@ -1,134 +0,0 @@
IF(NGS_INCLUDE_DIRS AND NGS_LIBRARIES)
SET(NGS_FOUND TRUE)
ELSE()
SET(FOM_NAME "RPRFOM20d17E")
IF("$ENV{NGS_ROOT}" STREQUAL "")
SET(NGS_ROOT "/opt/NGS/NGSPublic")
MESSAGE(STATUS "NGS_ROOT env var not set - using ${NGS_ROOT}")
ELSE()
SET(NGS_ROOT "$ENV{NGS_ROOT}")
ENDIF()
FIND_PROGRAM(NGS_FOMBUILD fombuild
PATHS ${NGS_ROOT}/exe
)
FIND_PATH(NGS_INCLUDE_DIR NGSUtils/SimTime.h
PATHS ${NGS_ROOT}/include
)
FIND_PATH(NGS_SM_INCLUDE_DIR ISystem.h
PATHS ${NGS_INCLUDE_DIR}
PATH_SUFFIXES SimulationManager
)
FIND_PATH(NGS_FC_INCLUDE_DIR IRTIAmbassador.h
PATHS ${NGS_INCLUDE_DIR}
PATH_SUFFIXES RTIFacadeAPI
)
FIND_PATH(NGS_GE_INCLUDE_DIR SimulatedWorldAPI.h
PATHS ${NGS_INCLUDE_DIR}
PATH_SUFFIXES SWGeneral
)
FIND_PATH(NGS_UT_INCLUDE_DIR NGSConfig.h
PATHS ${NGS_INCLUDE_DIR}
PATH_SUFFIXES NGSUtils
)
FIND_PATH(NGS_PF_INCLUDE_DIR configureBool.h
PATHS ${NGS_INCLUDE_DIR}
PATH_SUFFIXES NGSPlatformConfigure
)
FIND_PATH(NGS_FOM_INCLUDE_DIR WorldLocationStruct.h
PATHS ${NGS_INCLUDE_DIR}
PATH_SUFFIXES sw${FOM_NAME}/rpr
PATH_SUFFIXES sw${FOM_NAME}/rpr2
)
FIND_LIBRARY(NGS_LIBRARY NGS
PATHS ${NGS_ROOT}/lib
PATHS ${NGS_ROOT}/lib64
)
FIND_LIBRARY(NGS_LIBRARY_SWGENERAL SWGENERAL
PATHS ${NGS_ROOT}/lib
PATHS ${NGS_ROOT}/lib64
)
FIND_LIBRARY(NGS_LIBRARY_UTILS NGSUtils
PATHS ${NGS_ROOT}/lib
PATHS ${NGS_ROOT}/lib64
)
FIND_LIBRARY(FOM_LIBRARY SW${FOM_NAME}
PATHS ${NGS_ROOT}/lib
PATHS ${NGS_ROOT}/lib64
)
FIND_LIBRARY(NGS_LIBRARY_CORBA CorbaNotify
PATHS ${NGS_ROOT}/lib/CorbaNotifyCdr
)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NGS DEFAULT_MSG NGS_LIBRARY
NGS_LIBRARY_SWGENERAL
NGS_LIBRARY_UTILS
NGS_LIBRARY_CORBA
FOM_LIBRARY
NGS_SM_INCLUDE_DIR
NGS_FC_INCLUDE_DIR
NGS_GE_INCLUDE_DIR
NGS_UT_INCLUDE_DIR
)
SET(NGS_INCLUDE_DIRS
${NGS_INCLUDE_DIR}
${NGS_SM_INCLUDE_DIR}
${NGS_FC_INCLUDE_DIR}
${NGS_GE_INCLUDE_DIR}
${NGS_UT_INCLUDE_DIR}
${NGS_PF_INCLUDE_DIR}
${NGS_FOM_INCLUDE_DIR}
CACHE STRING "All ngs include dirs" FORCE
)
SET(NGS_LIBRARIES
${NGS_LIBRARY}
${NGS_LIBRARY_SWGENERAL}
${NGS_LIBRARY_UTILS}
${NGS_LIBRARY_CORBA}
${FOM_LIBRARY}
CACHE STRING "All ngs libraries" FORCE
)
MARK_AS_ADVANCED(NGS_INCLUDE_DIR NGS_LIBRARY FOM_LIBRARY)
ENDIF()
SET(NGS_IS_GUEZ OFF)
SET(NGS_IS_AHTC OFF)
IF (NGS_FOUND)
FIND_PATH(NGS_GUEZ_INCLUDE_DIR TacticalStatusStruct.h
PATHS ${NGS_FOM_INCLUDE_DIR})
FIND_PATH(NGS_AHTC_INCLUDE_DIR LongBowApacheObjClass.h
PATHS ${NGS_FOM_INCLUDE_DIR})
IF (NGS_GUEZ_INCLUDE_DIR AND EXISTS "${NGS_GUEZ_INCLUDE_DIR}/TacticalStatusStruct.h")
SET(NGS_IS_GUEZ ON)
MESSAGE(STATUS "NGS - GUEZ version (${NGS_GUEZ_INCLUDE_DIR})")
ELSE()
SET(NGS_IS_GUEZ OFF)
ENDIF()
IF (NGS_AHTC_INCLUDE_DIR AND EXISTS "${NGS_AHTC_INCLUDE_DIR}/LongBowApacheObjClass.h")
SET(NGS_IS_AHTC ON)
MESSAGE(STATUS "NGS - AHTC version (${NGS_AHTC_INCLUDE_DIR})")
ELSE()
SET(NGS_IS_AHTC OFF)
ENDIF()
ENDIF()
IF(NOT TARGET NGS::NGS)
ADD_LIBRARY(NGS::NGS UNKNOWN IMPORTED)
SET_PROPERTY(TARGET NGS::NGS PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${NGS_INCLUDE_DIRS})
SET_PROPERTY(TARGET NGS::NGS PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${NGS_INCLUDE_DIRS})
SET_PROPERTY(TARGET NGS::NGS PROPERTY IMPORTED_LOCATION "${NGS_LIBRARY}")
SET_PROPERTY(TARGET NGS::NGS APPEND PROPERTY INTERFACE_LINK_LIBRARIES
"${NGS_LIBRARY_SWGENERAL}"
"${NGS_LIBRARY_UTILS}"
"${NGS_LIBRARY_CORBA}"
"${FOM_LIBRARY}"
)
ENDIF()
@@ -1,103 +0,0 @@
# FindPopplerQt6.cmake - Find Poppler Qt6 bindings
# Sets: POPPLER_QT6_INCLUDE_DIR, POPPLER_QT6_LIBRARY, PopplerQt6::Poppler target
if(POPPLER_QT6_INCLUDE_DIR AND POPPLER_QT6_LIBRARY)
set(POPPLER_QT6_FOUND TRUE)
else()
set(_poppler_version_bad FALSE)
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(NOT _poppler_version_bad)
set(POPPLER_QT6_FOUND FALSE)
# 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()
if(NOT POPPLER_QT6_LIBRARY)
find_library(POPPLER_QT6_LIBRARY ${_pc_poppler_pkgname}
HINTS ${_pc_poppler_LIBRARY_DIRS}
)
endif()
# 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()
# 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()
endif()
@@ -1,333 +0,0 @@
SET(_rti_gcc_arch "")
# Suppress CMP0153 warning: EXEC_PROGRAM is deprecated
if(POLICY CMP0153)
cmake_policy(SET CMP0153 OLD)
endif()
# 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 "")
# 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}")
ENDIF()
IF(MSVC_VERSION EQUAL 1900)
SET(_rti_msvc_ver "VS2015")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1910)
SET(_rti_msvc_ver "VS2017")
ENDIF()
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(_rti_msvc_ver "x64Win64${_rti_msvc_ver}")
ELSE()
SET(_rti_msvc_ver "i86Win32${_rti_msvc_ver}")
ENDIF()
IF(NOT ${_rti_root_path})
SET(_RTI_DIR $ENV{KDEROOT})
FILE(TO_CMAKE_PATH "${_RTI_DIR}" _RTI_DIR)
IF(NOT EXISTS "${_RTI_DIR}" OR NOT IS_DIRECTORY "${_RTI_DIR}")
SET(_RTI_DIR $ENV{WORKSPACE})
FILE(TO_CMAKE_PATH "${_RTI_DIR}" _RTI_DIR)
ENDIF()
IF(NOT EXISTS "${_RTI_DIR}" OR NOT IS_DIRECTORY "${_RTI_DIR}")
SET(_RTI_DIR ${EXTERNAL_LIBRARY_DIR})
FILE(TO_CMAKE_PATH "${_RTI_DIR}" _RTI_DIR)
ENDIF()
ENDIF()
SET(_arch "${_rti_msvc_ver}")
ELSE(WIN32)
SET(_RTI_DIR $ENV{DDS_PATH})
IF(NOT _RTI_DIR)
# Try local external directory first (check multiple levels for different repo structures)
# 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")
ELSE()
SET(_RTI_DIR "/opt/RTI")
ENDIF()
ENDIF()
IF(NOT EXISTS "${_RTI_DIR}" OR NOT IS_DIRECTORY "${_RTI_DIR}")
MESSAGE(WARNING "RTI directory ${_RTI_DIR} not found; continuing without RTI. Set DDS_PATH to RTI installation to enable RTI features.")
# mark as not available
set(_RTI_DIR_NOT_FOUND TRUE)
set(_RTI_DIR "")
ENDIF()
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()
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/")
SET(_rti_library_hint "${RTI_DIR}/lib/${_rti_msvc_ver}/")
ELSE()
SET(_rti_include_hint "${RTI_DIR}/include/")
SET(_rti_library_hint "${RTI_DIR}/lib/")
ENDIF()
IF(NOT RTI_INCLUDE_DIR)
if(DEFINED _RTI_DIR_NOT_FOUND AND _RTI_DIR STREQUAL "")
# RTI directory was not found earlier; skip searching for includes and create empty placeholder
message(WARNING "Skipping RTI include search because RTI installation was not found")
set(RTI_INCLUDE_DIR "")
set(RTI_INCLUDE_DIRS "" CACHE STRING "RTI include directories" FORCE)
# Create placeholder INTERFACE targets for all RTI libraries when RTI is not installed
# These allow configuration to succeed but will cause link errors if actually used
SET(_RTI_LIBS nddscore nddsc nddscpp2 rtiroutingservice)
FOREACH(_lib ${_RTI_LIBS})
SET(_tgt_name RTI::${_lib})
IF(NOT TARGET ${_tgt_name})
ADD_LIBRARY(${_tgt_name} INTERFACE IMPORTED)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "")
# Set dummy library variables to satisfy Ninja dependency tracking
SET(RTI_${_lib}_LIBRARY "" CACHE STRING "RTI ${_lib} library (placeholder)" FORCE)
SET(RTI_${_lib}_LIBRARY_RELEASE "" CACHE STRING "RTI ${_lib} library release (placeholder)" FORCE)
SET(RTI_${_lib}_LIBRARY_DEBUG "" CACHE STRING "RTI ${_lib} library debug (placeholder)" FORCE)
ENDIF()
ENDFOREACH()
SET(RTI_LIBRARIES "" CACHE STRING "All rti libraries (placeholder)" FORCE)
SET(RTI_FOUND FALSE CACHE BOOL "RTI not found" FORCE)
# Force BUILD_RTI to OFF when RTI is not actually installed
SET(BUILD_RTI OFF CACHE BOOL "Build with RTI support" FORCE)
MESSAGE(WARNING "RTI not found - disabling BUILD_RTI. Set DDS_PATH to RTI installation to enable RTI features.")
return()
else()
# 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)
ELSE()
MESSAGE(FATAL "Could not find RTI include directory at ${_rti_include_hint}")
ENDIF()
endif()
ENDIF()
IF(NOT RTI_DDSGEN_EXECUTABLE)
FIND_PROGRAM(RTI_DDSGEN_EXECUTABLE NAMES rtiddsgen rtiddsgen.bat HINTS ${RTI_DIR}/scripts ${RTI_DIR}/bin)
ENDIF()
IF(NOT RTI_VERSION_MAJOR)
EXEC_PROGRAM(${RTI_DDSGEN_EXECUTABLE} ARGS -version OUTPUT_VARIABLE _dds_version_output)
STRING(REGEX REPLACE ".* ([0-9]\\.[0-9]\\.[0-9]).*" "\\1" _dds_version_output ${_dds_version_output})
SET(_rti_version_major 5)
IF(_dds_version_output VERSION_GREATER 2.9.9)
SET(_rti_version_major 6)
ENDIF()
SET(RTI_VERSION_MAJOR ${_rti_version_major} CACHE STRING "RTI version" FORCE)
ENDIF()
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" "${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)
if(IS_DIRECTORY "${_arch_dir}")
list(APPEND _rti_lib_search_paths "${_arch_dir}")
endif()
endforeach()
FOREACH(_lib ${_RTI_LIBS})
SET(_libname "RTI_${_lib}_LIBRARY")
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})
IF(NOT TARGET ${_tgt_name})
ADD_LIBRARY(${_tgt_name} UNKNOWN IMPORTED)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${RTI_INCLUDE_DIRS}")
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${RTI_INCLUDE_DIRS}")
IF(UNIX)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_COMPILE_DEFINITIONS "RTI_UNIX;RTI_LINUX;RTI_64BIT" )
ENDIF()
IF(WIN32)
IF("${_lib}" STREQUAL "rtiroutingservice")
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_COMPILE_DEFINITIONS "RTI_WIN32;RTI_routingservice_DLL_VARIABLE" )
ELSE()
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_COMPILE_DEFINITIONS "RTI_WIN32;NDDS_DLL_VARIABLE" )
ENDIF()
ENDIF()
# 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}")
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}_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}}")
# 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)
SET_PROPERTY(TARGET RTI::nddscore PROPERTY INTERFACE_LINK_LIBRARIES "dl" )
ENDIF()
SET(RTI_LIBRARIES ${_libs} CACHE STRING "All rti libraries" FORCE)
MARK_AS_ADVANCED(RTI_LIBRARIES)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RTI DEFAULT_MSG RTI_DIR RTI_INCLUDE_DIR RTI_DDSGEN_EXECUTABLE ${_lib_vars})
@@ -1,40 +0,0 @@
IF(SCHUSSTAFEL_INCLUDE_DIR AND SCHUSSTAFEL_LIBRARY)
SET(SCHUSSTAFEL_FOUND TRUE)
ELSE(SCHUSSTAFEL_INCLUDE_DIR AND SCHUSSTAFEL_LIBRARY)
FIND_PATH(SCHUSSTAFEL_INCLUDE_DIR Schusstafel.h)
FIND_LIBRARY_WITH_DEBUG(SCHUSSTAFEL_LIBRARY WIN32_DEBUG_POSTFIX d NAMES Schusstafel libSchusstafel)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Schusstafel DEFAULT_MSG SCHUSSTAFEL_LIBRARY SCHUSSTAFEL_INCLUDE_DIR)
MARK_AS_ADVANCED(SCHUSSTAFEL_INCLUDE_DIR SCHUSSTAFEL_LIBRARY)
ENDIF(SCHUSSTAFEL_INCLUDE_DIR AND SCHUSSTAFEL_LIBRARY)
@@ -1,104 +0,0 @@
IF(NOT TMSIF_DIR)
SET(_arch "unknown")
SET(_TMSIF_DIR $ENV{TMSIF_PATH})
IF(NOT _TMSIF_DIR)
SET(_TMSIF_DIR "/opt/tmsif")
ENDIF()
IF(NOT EXISTS "${_TMSIF_DIR}" OR NOT IS_DIRECTORY "${_TMSIF_DIR}")
MESSAGE(FATAL_ERROR "Umgebungsvariable TMSIF_PATH nicht gesetzt!")
ENDIF()
SET(TMSIF_DIR "${_TMSIF_DIR}" CACHE STRING "TMSIF base path" FORCE)
MESSAGE(STATUS "Trying to use TMSIF_DIR from ${TMSIF_DIR}")
ENDIF()
SET(_tmsif_include_hint "${TMSIF_DIR}/include/")
SET(_tmsif_library_hint "${TMSIF_DIR}/lib/")
IF(NOT TMSIF_INCLUDE_DIR)
FIND_PATH(TMSIF_INCLUDE_DIR Common.h HINTS ${_tmsif_include_hint})
IF(TMSIF_INCLUDE_DIR)
SET(TMSIF_INCLUDE_DIRS "${TMSIF_INCLUDE_DIR}" "${TMSIF_INCLUDE_DIR}/ddscxx" CACHE STRING "TMSIF include directories" FORCE)
MARK_AS_ADVANCED(TMSIF_INCLUDE_DIRS)
ELSE()
MESSAGE(FATAL "Could not find TMSIF include directory at ${_tmsif_include_hint}")
ENDIF()
ENDIF()
SET(_TMSIF_LIBS tmsif-cyclone ddscxx ddkit-cyclone )
SET(_libs "")
SET(_lib_vars "")
FOREACH(_lib ${_TMSIF_LIBS})
SET(_libname "TMSIF_${_lib}_LIBRARY")
IF (NOT ${_libname})
FIND_LIBRARY_WITH_DEBUG("${_libname}"
WIN32_DEBUG_POSTFIX d
NAMES ${_lib}
HINTS ${_tmsif_library_hint} ${TMSIF_DIR}/lib )
ENDIF()
SET(_tgt_name TMSIF::${_lib})
IF(NOT TARGET ${_tgt_name})
ADD_LIBRARY(${_tgt_name} UNKNOWN IMPORTED)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${TMSIF_INCLUDE_DIRS}")
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${TMSIF_INCLUDE_DIRS}")
IF(UNIX)
SET_PROPERTY(TARGET ${_tgt_name} PROPERTY INTERFACE_COMPILE_DEFINITIONS "TMSIF_UNIX;TMSIF_LINUX;TMSIF_64BIT" )
ENDIF()
IF(${_libname}_RELEASE)
SET_PROPERTY(TARGET ${_tgt_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
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}}")
ENDIF()
ENDIF()
LIST(APPEND _libs "${${_libname}}")
LIST(APPEND _lib_vars "${_libname}")
ENDFOREACH()
SET(TMSIF_LIBRARIES ${_libs} CACHE STRING "All TMSIF libraries" FORCE)
MARK_AS_ADVANCED(TMSIF_LIBRARIES)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TMSIF DEFAULT_MSG TMSIF_DIR TMSIF_INCLUDE_DIR ${_lib_vars})
@@ -1,49 +0,0 @@
IF(VLC_INCLUDE_DIR AND VLC_LIBRARIES)
SET(VLC_FOUND TRUE)
ELSE()
INCLUDE(FindPackageHandleStandardArgs)
INCLUDE(FindLibraryWithDebug)
FIND_LIBRARY_WITH_DEBUG(VLC_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES vlc libvlc)
FIND_PATH(VLC_INCLUDE_DIR vlc/vlc.h)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VLC DEFAULT_MSG VLC_LIBRARIES VLC_INCLUDE_DIR)
FIND_PATH(VLC_IS_2_0_ABOVE vlc/libvlc_version.h
PATHS ${VLC_INCLUDE_DIR}
NO_DEFAULT_PATH)
IF(NOT VLC_IS_2_0_ABOVE)
MESSAGE(FATAL_ERROR "Need at least VLC 2.x")
ENDIF()
MARK_AS_ADVANCED(VLC_DEFINES)
ENDIF()
@@ -1,81 +0,0 @@
IF(XSD_INCLUDE_DIR AND XSD_COMPILER)
SET(XSD_FOUND TRUE)
ELSE(XSD_INCLUDE_DIR AND XSD_COMPILER)
FIND_PROGRAM(XSD_COMPILER NAMES xsdcxx xsd)
FIND_PATH(XSD_INCLUDE_DIR xsd/cxx/config.hxx)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XSD DEFAULT_MSG
XSD_COMPILER
XSD_INCLUDE_DIR
)
MARK_AS_ADVANCED(XSD_COMPILER
XSD_INCLUDE_DIR)
ENDIF(XSD_INCLUDE_DIR AND XSD_COMPILER)
MACRO(XSD_GENERATE_TREE srcList infile)
GET_FILENAME_COMPONENT(output ${infile} NAME)
GET_FILENAME_COMPONENT(input ${infile} ABSOLUTE)
GET_FILENAME_COMPONENT(dir ${infile} DIRECTORY)
EXEC_PROGRAM(${XSD_COMPILER} ARGS version OUTPUT_VARIABLE _xsd_version_output)
STRING(REGEX REPLACE ".* ([0-9]\\.[0-9]\\.[0-9]).*" "\\1" _xsd_version_output ${_xsd_version_output})
SET(_xsd_in ${input})
SET(_cpp_out ${dir}/${output}.cxx)
SET(_hpp_out ${dir}/${output}.hxx)
STRING(REPLACE ".xsd" "" _cpp_out "${_cpp_out}")
STRING(REPLACE ".xsd" "" _hpp_out "${_hpp_out}")
SET(additional_xsd_args "")
IF(_xsd_version_output VERSION_GREATER 3.9.0)
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7.0)
SET(additional_xsd_args --std c++11)
ELSE()
IF(WIN32 OR NOT CMAKE_COMPILER_IS_GNUCC)
SET(additional_xsd_args --std c++11)
ENDIF(WIN32 OR NOT CMAKE_COMPILER_IS_GNUCC)
ENDIF()
ENDIF()
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${dir}
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${dir}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ADD_CUSTOM_COMMAND(OUTPUT ${_cpp_out} ${_hpp_out}
COMMAND ${XSD_COMPILER}
ARGS cxx-tree ${additional_xsd_args} --generate-serialization ${_xsd_in}
DEPENDS ${_xsd_in} ${CMAKE_CURRENT_BINARY_DIR}/${dir}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}
)
LIST(APPEND ${srcList} ${_cpp_out} ${_hpp_out} ${infile})
ENDMACRO(XSD_GENERATE_TREE srcList infile)
@@ -1,527 +0,0 @@
INCLUDE(CMakeParseArguments)
MACRO(_ADD_SERVICE_RESTART_FLAG svcName)
STRING(TOUPPER ${svcName} _svcNameUpper)
STRING(TOLOWER ${svcName} _svcNameLower)
SET(_optionName DONTRESTARTSVC_${_svcNameUpper})
OPTION(${_optionName} "Do not automatically restart Service ${_svcNameUpper} (build dir only)" OFF)
SET(_fn "${CMAKE_BINARY_DIR}/share/Lts/xml/${_svcNameLower}.dontRestart")
IF (${_optionName})
FILE(WRITE ${_fn} "blub")
ELSE()
FILE(REMOVE ${_fn})
ENDIF()
ENDMACRO()
MACRO(_GET_SERVICENAME xmlFile_in svcNameOut)
GET_FILENAME_COMPONENT(xmlFile ${xmlFile_in} NAME_WE)
SET(_idx -1)
STRING(FIND "${xmlFile}" "_" _idx)
STRING(SUBSTRING "${xmlFile}" 0 ${_idx} ${svcNameOut})
ENDMACRO()
MACRO(_CODEGEN_ACTION action srcList xmlIn in_files out_files)
LIST(APPEND dependFiles ${ARGN} ${xmlIn} ${${in_files}})
SET(_cg $<TARGET_FILE:ngl_codegen>)
SET(_env "QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt6/plugins/kf6/ktexttemplate")
ADD_CUSTOM_COMMAND(OUTPUT ${${out_files}}
COMMAND ${CMAKE_COMMAND} -E env ${_env} ${_cg}
ARGS -s ${xmlIn}
-a ${action}
-o ${CMAKE_CURRENT_BINARY_DIR}
-i ${CMAKE_BINARY_DIR}/service_idl_files.txt
${${in_files}}
DEPENDS ${_cg} ${dependFiles}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
LIST(APPEND ${srcList} ${${out_files}})
GET_FILENAME_COMPONENT(_xml "${CMAKE_CURRENT_SOURCE_DIR}/${xmlIn}" ABSOLUTE)
SET_PROPERTY(GLOBAL APPEND PROPERTY CODEGEN_IDL_FILES "${_xml}")
ENDMACRO()
MACRO(CODEGEN_DATABASE_STRUCTS srcList_h xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_structs.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_structs.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_structs.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_structs.h"
)
_CODEGEN_ACTION("DATABASE" ${srcList_h} ${xmlFile_in} in_files out_files ${ARGN})
ENDMACRO()
MACRO(CODEGEN_DATABASE_SQL srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_impl.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_impl.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_impl.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_impl.h"
)
_CODEGEN_ACTION("DATABASE" ${srcList} ${xmlFile_in} in_files out_files ${ARGN})
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_impl.h")
ENDIF()
ENDMACRO()
MACRO(CODEGEN_DAO srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dao.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dao.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dao.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dao.h"
)
_CODEGEN_ACTION("dao" ${srcList} ${xmlFile_in} in_files out_files ${ARGN})
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dao.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dao.h")
ENDIF()
ENDMACRO()
MACRO(CODEGEN_DATABASE srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_structs.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_structs.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_impl.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_db.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_structs.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_structs.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_impl.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db.h"
)
_CODEGEN_ACTION("DATABASE_SERVER" ${srcList} ${xmlFile_in} in_files out_files ${ARGN})
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_db_impl.h")
ENDIF()
ENDMACRO()
MACRO(INSTALL_SHARED_FILES srcList)
SET(options)
SET(oneValueArgs DESTINATION)
SET(multiValueArgs FILES)
CMAKE_PARSE_ARGUMENTS(_ISF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
SET(build_out_dir ${CMAKE_BINARY_DIR}/share/Lts/${_ISF_DESTINATION})
SET(inst_out_dir share/Lts/${_ISF_DESTINATION})
FOREACH(filename ${_ISF_FILES})
GET_FILENAME_COMPONENT(fn ${filename} NAME)
SET(build_out_file ${build_out_dir}/${fn})
SET(in_file ${CMAKE_CURRENT_SOURCE_DIR}/${filename})
ADD_CUSTOM_COMMAND(OUTPUT ${build_out_file}
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory ${build_out_dir}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${in_file} ${build_out_file}
DEPENDS ${in_file}
)
LIST(APPEND ${srcList} ${in_file} ${build_out_file})
ENDFOREACH()
NGL_INSTALL(${_ISF_UNPARSED_ARGUMENTS} FILES ${_ISF_FILES} DESTINATION ${inst_out_dir})
ENDMACRO()
MACRO(CODEGEN_SQL srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(out_dir_sql "${CMAKE_BINARY_DIR}/share/Lts/sql/")
SET(out_file_sql "${out_dir_sql}/${svcNameOut}.sql")
SET(action "SQL")
SET(_cg $<TARGET_FILE:ngl_codegen>)
ADD_CUSTOM_COMMAND(OUTPUT ${out_file_sql}
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory ${out_dir_sql}
COMMAND ${CMAKE_COMMAND} -E env QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt6/plugins/kf6/ktexttemplate ${_cg}
ARGS -s ${xmlFile_in}
-a ${action}
-o ${out_dir_sql}
-i ${CMAKE_BINARY_DIR}/service_idl_files.txt
DEPENDS ${_cg} ${xmlFile_in}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
LIST(APPEND ${srcList} ${out_file_sql})
NGL_INSTALL(SV AAR FILES ${out_file_sql} DESTINATION share/Lts/sql)
ENDMACRO()
MACRO(CODEGEN_HANDLE_SVC_XML srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(out_dir_xml "${CMAKE_BINARY_DIR}/share/Lts/xml/")
SET(out_file_xml "${out_dir_xml}/${svcNameOut}.xml")
ADD_CUSTOM_COMMAND(OUTPUT ${out_file_xml}
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory ${out_dir_xml}
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${xmlFile_in} ${out_file_xml}
DEPENDS ${xmlFile_in}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
LIST(APPEND ${srcList} ${xmlFile_in} ${out_file_xml})
_ADD_SERVICE_RESTART_FLAG(${svcNameOut})
NGL_INSTALL(SV AAR FILES ${out_file_xml} DESTINATION share/Lts/xml)
ENDMACRO()
MACRO(CODEGEN_IDL_SVC srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}.idl"
"${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")
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})
CODEGEN_HANDLE_SVC_XML(${srcList} ${xmlFile_in})
ENDMACRO()
# Use Python 3 (Python 2.7 not available on modern distributions like openSUSE Leap 16.0)
FIND_PACKAGE(Python3 COMPONENTS Interpreter REQUIRED)
SET(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
MACRO(CODEGEN_TOPIC_TYPEDEFS srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(inFile ${xmlFile_in})
IF(NOT IS_ABSOLUTE ${inFile})
SET(inFile ${CMAKE_CURRENT_SOURCE_DIR}/${inFile})
IF(NOT EXISTS ${inFile})
SET(inFile ${CMAKE_CURRENT_BINARY_DIR}/${inFile})
ENDIF()
ENDIF()
SET(prog ${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/codegen_simple.py)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dts_types.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dtc_types.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_fts_types.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_ftc_types.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_operator_rights.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_operator_rights.cpp"
"${CMAKE_BINARY_DIR}/share/Lts/sql/${svcNameOut}_operator_rights.sql"
)
ADD_CUSTOM_COMMAND( OUTPUT ${out_files}
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND}
ARGS -E make_directory ${CMAKE_BINARY_DIR}/share/Lts/sql/
COMMAND ${PYTHON_EXECUTABLE}
ARGS ${prog} ALL
${inFile}
${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PYTHON_EXECUTABLE}
ARGS ${prog} SQL
${inFile}
${CMAKE_BINARY_DIR}/share/Lts/sql
DEPENDS ${inFile}
${prog}
)
LIST(APPEND ${srcList} ${out_files})
SET_PROPERTY(GLOBAL APPEND PROPERTY CODEGEN_XML_FILES "${inFile}")
ENDMACRO()
MACRO(CODEGEN_CLIENT_TOPICS_IFC srcList xmlFile_in)
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.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)
ENDMACRO()
MACRO(CODEGEN_CLIENT_TOPICS_IMPL srcList xmlFile_in)
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})")
ENDIF()
ENDFOREACH()
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
ENDMACRO()
MACRO(CODEGEN_SERVER_TOPICS srcList xmlFile_in)
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 "DTS" "FTS")
ENDIF()
SET(in_files "")
SET(out_files "")
FOREACH(part ${_CST_PARTS})
IF(part STREQUAL "DTS")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dts.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dts_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_dts_impl.cpp.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dts.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dts_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_dts_impl.cpp"
)
ELSEIF(part STREQUAL "FTS")
LIST(APPEND in_files
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_fts.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_fts_impl.h.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_fts_impl.cpp.grantlee"
)
LIST(APPEND out_files
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_fts.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_fts_impl.h"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_fts_impl.cpp"
)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_fts_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)
ENDMACRO()
MACRO(CODEGEN_TOPIC_TYPE_PLUGIN srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_topic_type_plugin.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_topic_type_plugin.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_topic_type_plugin.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_topic_type_plugin.h"
)
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_topic_type_plugin.h)
ENDIF()
ENDMACRO()
MACRO(CREATE_TOPIC_TYPE_PLUGIN xmlFile_in)
SET(_my_srcs "")
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
CODEGEN_TOPIC_TYPE_PLUGIN(_my_srcs ${xmlFile_in})
STRING(SUBSTRING ${svcNameOut} 0 1 _ss1)
STRING(SUBSTRING ${svcNameOut} 1 -1 _ss2)
STRING(TOUPPER ${_ss1} _ss1)
SET(_commonLib "svc${_ss1}${_ss2}Common")
IF(svcNameOut STREQUAL "core")
SET(_commonLib ddscore)
ENDIF()
NGL_ADD_LIBRARY(WS AAR SV NO_TRANSLATION ${svcNameOut}TopicTypePlugin MODULE
${_my_srcs}
)
NGL_TARGET_LINK_LIBRARIES(${svcNameOut}TopicTypePlugin
topic_type_plugin
routing_plugin
ddscore
ddsftccore
# The generated *_topic_type_plugin.cpp includes generic_fts_impl.h
# -> generic_fts_internal.h -> "ddsfts_export.h". Linking ddsfts also
# propagates its exported include dirs (source and binary dir).
ddsfts
${_commonLib}
)
NGL_INSTALL_TARGET(${svcNameOut}TopicTypePlugin)
ENDMACRO()
MACRO(CODEGEN_RECORD_REPLAY_PLUGIN srcList xmlFile_in)
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
SET(in_files "${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee"
"${CMAKE_SOURCE_DIR}/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee"
)
SET(out_files "${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_record_replay_plugin.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_record_replay_plugin.h"
)
_CODEGEN_ACTION("DDS_TOPICS" ${srcList} "${xmlFile_in}" in_files out_files)
IF(NOT POLICY CMP0071)
QT6_WRAP_CPP(${srcList} ${CMAKE_CURRENT_BINARY_DIR}/${svcNameOut}_record_replay_plugin.h)
ENDIF()
ENDMACRO()
MACRO(CREATE_RECORD_REPLAY_PLUGIN_INTERN xmlFile_in svcSourceList libtype)
SET(_my_srcs "")
_GET_SERVICENAME( "${xmlFile_in}" svcNameOut )
CODEGEN_RECORD_REPLAY_PLUGIN(_my_srcs ${xmlFile_in})
STRING(SUBSTRING ${svcNameOut} 0 1 _ss1)
STRING(SUBSTRING ${svcNameOut} 1 -1 _ss2)
STRING(TOUPPER ${_ss1} _ss1)
SET(_commonLib "svc${_ss1}${_ss2}Common")
IF(svcNameOut STREQUAL "core")
SET(_commonLib ddscore)
ENDIF()
LIST(APPEND ${svcSourceList} ${_my_srcs})
NGL_ADD_LIBRARY(SV AAR WS ${svcNameOut}RecordReplayPlugin ${libtype}
${_my_srcs}
)
NGL_TARGET_LINK_LIBRARIES(${svcNameOut}RecordReplayPlugin
RecordReplayPlugin
ddscore
ddsconnector
ddsdtc
ngldb
LtsUtilsCore
${_commonLib}
)
NGL_INSTALL_TARGET(${svcNameOut}RecordReplayPlugin)
NGL_TARGET_INCLUDE_DIRECTORIES(${svcNameOut}RecordReplayPlugin
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../
)
ENDMACRO()
MACRO(CREATE_RECORD_REPLAY_PLUGIN xmlFile_in svcSourceList)
CREATE_RECORD_REPLAY_PLUGIN_INTERN(${xmlFile_in} ${svcSourceList} MODULE)
ENDMACRO()
MACRO(CREATE_RECORD_REPLAY_PLUGIN_SHARED xmlFile_in)
CREATE_RECORD_REPLAY_PLUGIN_INTERN(${xmlFile_in} _unused SHARED)
ENDMACRO()
MACRO(CODEGEN_WRITE_SERVICEFILE_INFO)
GET_PROPERTY(idl_files GLOBAL PROPERTY CODEGEN_IDL_FILES)
LIST(REMOVE_DUPLICATES idl_files)
FILE(WRITE ${CMAKE_BINARY_DIR}/service_idl_files.txt "-- all available service idl files\n")
FOREACH(idl_file ${idl_files})
FILE(APPEND ${CMAKE_BINARY_DIR}/service_idl_files.txt "${idl_file}\n")
ENDFOREACH()
ENDMACRO()
@@ -1,77 +0,0 @@
MACRO(RTIDDSGEN srcList infile)
# RTI (DDS) code generation is optional during migration; if RTI is not found, skip code generation.
FIND_PACKAGE(RTI)
if (NOT RTI_FOUND)
message(STATUS "RTI not found; skipping RTI IDL code generation for ${infile}")
return()
endif()
SET(input ${infile})
IF(NOT IS_ABSOLUTE ${input})
SET(input "${CMAKE_CURRENT_BINARY_DIR}/${input}")
ENDIF()
GET_FILENAME_COMPONENT(output ${infile} NAME_WE)
GET_FILENAME_COMPONENT(input ${input} ABSOLUTE)
SET(_ddsgen_args "")
SET(output_cxx
${CMAKE_CURRENT_BINARY_DIR}/${output}.cxx
${CMAKE_CURRENT_BINARY_DIR}/${output}Plugin.cxx
)
SET(output_hpp
${CMAKE_CURRENT_BINARY_DIR}/${output}.hpp
${CMAKE_CURRENT_BINARY_DIR}/${output}Plugin.hpp
)
ADD_CUSTOM_COMMAND(OUTPUT ${output_cxx} ${output_hpp}
COMMAND ${CMAKE_COMMAND}
ARGS -E remove ${output_cxx}
COMMAND ${RTI_DDSGEN_EXECUTABLE}
ARGS -language "C++11"
ARGS -unboundedSupport
ARGS -verbosity 2
ARGS -update typefiles
ARGS -stl
ARGS -d ${CMAKE_CURRENT_BINARY_DIR}
ARGS -inputIdl ${input}
ARGS -I ${CMAKE_CURRENT_BINARY_DIR}
ARGS -I ${CMAKE_CURRENT_BINARY_DIR}/../
ARGS -I ${CMAKE_CURRENT_BINARY_DIR}/../../
ARGS -I ${CMAKE_CURRENT_SOURCE_DIR}
ARGS -I ${CMAKE_CURRENT_SOURCE_DIR}/../
ARGS -I ${CMAKE_CURRENT_SOURCE_DIR}/../../
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${input} ${ARGN}
)
IF(WIN32)
SET_SOURCE_FILES_PROPERTIES(${output_cxx} PROPERTIES COMPILE_FLAGS "-DNDDS_USER_DLL_EXPORT")
ELSE()
SET_SOURCE_FILES_PROPERTIES(${output_cxx} PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
ENDIF()
LIST(APPEND ${srcList} ${output_cxx} ${output_hpp})
ENDMACRO()
@@ -38,11 +38,20 @@ if(POLICY CMP0177)
cmake_policy(SET CMP0177 OLD) cmake_policy(SET CMP0177 OLD)
endif() endif()
# Compatibility stubs for Qt5 CMake macros when Qt6 is used. # Compatibility stubs for Qt5 CMake macros when Qt6 is used (UI/CPP wrapping
# These stubs allow configure to succeed; actual resource/ui generation should be addressed during source migration. # still no-op; resource handling is implemented below).
# QT5_ADD_RESOURCES maps onto Qt6's qt6_add_resources() in the outfiles-variable
# form: the generated qrc_<name>.cpp sources are appended to the given source
# list, so .qrc files are compiled into the targets that reference them
# (e.g. TetraIF/LogView). Without this the resources are silently dropped and
# ":/..." icons render empty at runtime.
if(NOT COMMAND QT5_ADD_RESOURCES) if(NOT COMMAND QT5_ADD_RESOURCES)
macro(QT5_ADD_RESOURCES _out) macro(QT5_ADD_RESOURCES _out)
set(${_out} "" PARENT_SCOPE) if(TARGET Qt6::Core)
qt6_add_resources(${_out} ${ARGN})
else()
message(WARNING "QT5_ADD_RESOURCES stub: Qt6::Core not found, skipping resources: ${ARGN}")
endif()
endmacro() endmacro()
endif() endif()
if(NOT COMMAND QT5_ADD_BIG_RESOURCES) if(NOT COMMAND QT5_ADD_BIG_RESOURCES)
@@ -1,30 +0,0 @@
# Placeholder internal targets to allow partial configure during migration
# Creates IMPORTED targets for internal DDS generator targets that are not
# yet available in the repository. These placeholders allow CMake checks
# like "if(TARGET ddsgen)" to behave consistently and let subdirs add
# tests during migration. They should be removed/replaced when real
# targets are added during module migration.
if(NOT TARGET ddsgen)
add_library(ddsgen UNKNOWN IMPORTED)
# 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)
# 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)
# 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)
# Qt6 Migration: Removed INTERFACE_POSITION_INDEPENDENT_CODE - conflicts with Qt6 reduce_relocations
# set_target_properties(ddsQoS PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
endif()
@@ -1,8 +0,0 @@
#ifndef SVCALMCOMMON_EXPORT_H
#define SVCALMCOMMON_EXPORT_H
// Stub export macro for AlarmManagement
#define SVCALMCOMMON_EXPORT
#define SVCALMCOMMON_NO_EXPORT
#endif // SVCALMCOMMON_EXPORT_H
@@ -1,28 +0,0 @@
// Stub file for aes_enums.hpp - used when BUILD_RTI=OFF
#ifndef AES_ENUMS_HPP
#define AES_ENUMS_HPP
// Minimal stub - actual enums generated by rtiddsgen when BUILD_RTI=ON
namespace AreaEffectSimulation {
// Stub enum definitions for compilation when BUILD_RTI=OFF
enum class SymbolAppearance {
Solid = 0,
Dashed = 1,
Dotted = 2
};
enum class SymbolVisibility {
Visible = 0,
Hidden = 1
};
struct UnitSymbolPosition {
double x = 0.0;
double y = 0.0;
};
} // namespace AreaEffectSimulation
#endif // AES_ENUMS_HPP
@@ -1,28 +0,0 @@
// Stub file for asm_enums.hpp - used when BUILD_RTI=OFF
#ifndef ASM_ENUMS_HPP
#define ASM_ENUMS_HPP
#include <cstdint>
namespace AssetManagement {
enum class SymbolAppearance : std::int32_t {
Solid = 0,
Dashed = 1,
Dotted = 2
};
enum class SymbolVisibility : std::int32_t {
Visible = 0,
Hidden = 1
};
struct UnitSymbolPosition {
double x = 0.0;
double y = 0.0;
double z = 0.0;
};
} // namespace AssetManagement
#endif // ASM_ENUMS_HPP
@@ -1,34 +0,0 @@
/**
* @file avm_enums.hpp
* @brief Stub file for AudioVideoManagement enums (BUILD_RTI=OFF)
*
* This file provides stub definitions when RTI DDS code generation is disabled.
* Replace with generated file when BUILD_RTI=ON.
*/
#ifndef AVM_ENUMS_HPP
#define AVM_ENUMS_HPP
namespace AudioVideoManagement
{
// Stub enum definitions for compilation without RTI DDS
enum class StreamType
{
UNKNOWN = 0,
AUDIO = 1,
VIDEO = 2,
AUDIO_VIDEO = 3
};
enum class ConnectionState
{
DISCONNECTED = 0,
CONNECTING = 1,
CONNECTED = 2,
ERROR = 3
};
} // namespace AudioVideoManagement
#endif // AVM_ENUMS_HPP
@@ -1,24 +0,0 @@
// Stub file for core_enums.hpp - used when BUILD_RTI=OFF
#ifndef CORE_ENUMS_HPP
#define CORE_ENUMS_HPP
#include <cstdint>
namespace Core {
enum class LogLevel : std::int32_t {
Debug = 0,
Info = 1,
Warning = 2,
Error = 3
};
enum class ComponentState : std::int32_t {
Stopped = 0,
Running = 1,
Paused = 2
};
} // namespace Core
#endif // CORE_ENUMS_HPP
@@ -1,24 +0,0 @@
// Stub file for eem_enums.hpp - used when BUILD_RTI=OFF
#ifndef EEM_ENUMS_HPP
#define EEM_ENUMS_HPP
#include <cstdint>
namespace ExerciseEventManagement {
enum class EventState : std::int32_t {
Pending = 0,
Active = 1,
Completed = 2,
Cancelled = 3
};
enum class EventPriority : std::int32_t {
Low = 0,
Medium = 1,
High = 2
};
} // namespace ExerciseEventManagement
#endif // EEM_ENUMS_HPP
@@ -1,27 +0,0 @@
/**
* @RDE_HEADER@
* HMI Plugin for Exercisemanagemt (Interface for access from other Plugins)
*/
#pragma once
#include <PluginInterfaces/data_plugin_interface.h>
#include <ExerciseManagement/exm_dtc.h>
#include <ExerciseManagement/exm_ftc.h>
#include <memory>
namespace ExerciseManagement
{
/**
* @brief The DataInterface class provides the Topics Clients only for the GUI Plugins
*/
class DataInterface : public DataPluginBase::Interface
{
public:
using DataPluginBase::Interface::Interface;
virtual std::shared_ptr<ExerciseManagement::Interface::Dtc> getDtc() = 0;
virtual std::shared_ptr<ExerciseManagement::Interface::Ftc> getFtc() = 0;
};
} // namespace ExerciseManagement
@@ -1,34 +0,0 @@
// Stub file for exm_enums.hpp - used when BUILD_RTI=OFF
#ifndef EXM_ENUMS_HPP
#define EXM_ENUMS_HPP
#include <cstdint>
namespace ExerciseManagement {
enum class ExerciseState : std::int32_t {
Planned = 0,
Running = 1,
Paused = 2,
Finished = 3
};
enum class ExerciseType : std::int32_t {
Training = 0,
Operational = 1,
Test = 2
};
enum class SymbolAppearance : std::int32_t {
Solid = 0,
Outline = 1
};
enum class SymbolVisibility : std::int32_t {
Visible = 0,
Hidden = 1
};
} // namespace ExerciseManagement
#endif // EXM_ENUMS_HPP
@@ -1,33 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include <QtCore/QString>
#include <ostream>
#include "exmcommon_export.h"
#include "exm_enums.hpp"
namespace ExerciseManagement
{
// STUB: Exercise - wird durch echten DDS-Typ ersetzt
struct EXMCOMMON_EXPORT Exercise
{
int id = 0;
QString m_name;
int phase = 0; // Exercise phase ID
SymbolAppearance symbolAppearance = SymbolAppearance::Solid;
SymbolVisibility symbolVisibility = SymbolVisibility::Visible;
[[nodiscard]] std::string name() const { return m_name.toStdString(); }
// Weitere Felder werden bei Bedarf ergänzt
};
// Stream operator for logging
inline std::ostream& operator<<(std::ostream& os, const Exercise& ex) {
os << "Exercise(id=" << ex.id << ", name=" << ex.m_name.toStdString() << ")";
return os;
}
} // namespace ExerciseManagement
@@ -1,10 +0,0 @@
#pragma once
// Export-Macro für ExerciseManagement Module
// STUB: Wird normalerweise von CMake generiert
#ifdef EXMCOMMON_LIBRARY
#define EXMCOMMON_EXPORT Q_DECL_EXPORT
#else
#define EXMCOMMON_EXPORT Q_DECL_IMPORT
#endif
@@ -1,72 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include <QtCore/QString>
#include <ostream>
#include "gna_export.h"
namespace GuezNasat
{
// STUB: NasatAircraft - wird durch echten DDS-Typ ersetzt
struct NasatAircraft
{
int idValue = 0;
QString nameValue;
int exerciseIdValue = 0;
int nasatIdValue = 0;
bool simulationActiveValue = false;
// Getter-Methoden für Kompatibilität
int id() const { return idValue; }
QString name() const { return nameValue; }
int exerciseId() const { return exerciseIdValue; }
int nasatId() const { return nasatIdValue; }
bool simulationActive() const { return simulationActiveValue; }
// Stream operator für Logger
friend std::ostream& operator<<(std::ostream& os, const NasatAircraft& aircraft);
};
// STUB: NasatAircraftParticipant - wird durch echten DDS-Typ ersetzt
struct NasatAircraftParticipant
{
int idValue = 0;
int nasatAircraftIdValue = 0;
int exerciseIdValue = 0;
int participantIdValue = 0;
// Getter-Methoden für Kompatibilität
int id() const { return idValue; }
int nasatAircraftId() const { return nasatAircraftIdValue; }
int exerciseId() const { return exerciseIdValue; }
int participantId() const { return participantIdValue; }
// Stream operator für Logger
friend std::ostream& operator<<(std::ostream& os, const NasatAircraftParticipant& participant);
};
} // namespace GuezNasat
// Stream-Operator Implementierung
namespace GuezNasat
{
inline std::ostream& operator<<(std::ostream& os, const NasatAircraft& aircraft)
{
os << "NasatAircraft{id=" << aircraft.id() << ", name=" << aircraft.name().toStdString()
<< ", exerciseId=" << aircraft.exerciseId() << ", nasatId=" << aircraft.nasatId()
<< ", simulationActive=" << aircraft.simulationActive() << "}";
return os;
}
inline std::ostream& operator<<(std::ostream& os, const NasatAircraftParticipant& participant)
{
os << "NasatAircraftParticipant{id=" << participant.id()
<< ", nasatAircraftId=" << participant.nasatAircraftId()
<< ", exerciseId=" << participant.exerciseId()
<< ", participantId=" << participant.participantId() << "}";
return os;
}
} // namespace GuezNasat
@@ -1,5 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
// NasatAircraftParticipant ist bereits in gna_nasat_aircraft.h definiert
#include "gna_nasat_aircraft.h"
@@ -1,29 +0,0 @@
/**
* @RDE_HEADER@
* Translation helper for GuezNasat module
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// filename: gna_translation.h
#include <QtCore/QString>
#include <QtCore/QObject>
#include "svcgnacommon_export.h"
namespace GuezNasat
{
/**
* @brief Translation helper function
*
* Wrapper for QObject::tr() to enable translation in non-QObject classes
*/
GNA_COMMON_EXPORT inline QString tr(const char* sourceText, const char* comment = nullptr)
{
return QObject::tr(sourceText, comment);
}
} // namespace GuezNasat
@@ -1,7 +0,0 @@
#ifndef SVCGNACOMMON_EXPORT_H
#define SVCGNACOMMON_EXPORT_H
// Stub export macro for BUILD_RTI=OFF
#define SVCGNACOMMON_EXPORT
#endif // SVCGNACOMMON_EXPORT_H
@@ -1,69 +0,0 @@
// Stub file for ism_enums.hpp - used when BUILD_RTI=OFF
#ifndef ISM_ENUMS_HPP
#define ISM_ENUMS_HPP
#include <cstdint>
namespace InfrastructureManagement {
enum class InfrastructureState : std::int32_t {
Online = 0,
Offline = 1,
Maintenance = 2
};
enum class ConnectionType : std::int32_t {
Wired = 0,
Wireless = 1,
Satellite = 2
};
// DDS-style enum wrapper
struct MountingPointType_def {
enum type : std::int32_t {
Undefined = 0,
Rack = 1,
Shelf = 2,
Slot = 3,
Module = 4,
Port = 5,
Cable = 6,
Connector = 7
};
};
struct MountingPointState_def {
enum type : std::int32_t {
Undefined = 0,
Planned = 1,
Installed = 2,
InService = 3,
OutOfService = 4,
Defect = 5
};
};
// Also provide enum class for direct usage
enum class MountingPointType : std::int32_t {
Undefined = 0,
Rack = 1,
Shelf = 2,
Slot = 3,
Module = 4,
Port = 5,
Cable = 6,
Connector = 7
};
enum class MountingPointState : std::int32_t {
Undefined = 0,
Planned = 1,
Installed = 2,
InService = 3,
OutOfService = 4,
Defect = 5
};
} // namespace InfrastructureManagement
#endif // ISM_ENUMS_HPP
@@ -1,145 +0,0 @@
/**
* @RDE_HEADER@
* The MountingPoint class wraps all information from InfrastructureManagement which defines a mounting point
* $Id$
* $HeadURL$
* $Author$
* Created by Hannes Baeuerle, SLSE, 2017-01-16
*/
#pragma once
#include "ismshared_export.h"
#include "ism.hpp"
#include <QImage>
namespace dds
{
namespace core
{
static inline uint qHash(const InfrastructureManagement::MountingPointType &mpt)
{
return ::qHash(static_cast<int32_t>(mpt));
}
} // namespace core
} // namespace dds
namespace InfrastructureManagement
{
class ISMSHARED_EXPORT MountingPoint
{
public:
explicit MountingPoint();
explicit MountingPoint(const StructureElement &data, int floorId);
static void init();
const StructureElement &data() const { return m_data; }
void updateData(const StructureElement &data, int floorId) { m_data = data; m_floor = floorId; }
int32_t id() const { return m_data.id; }
int32_t associatedAssetId() const { return m_associatedAssetId; }
bool hasAssociatedAsset() const { return m_associatedAssetId > 0; }
bool hasAssociatedAssetDefect() const { return m_hasAssociatedAssetDefect; }
/*! \name aimState depends on the (loaded) plan/schedule!!! */
//@{
//! \brief aimState of currently loaded schedule!!!
//! \return aimState
MountingPointState aimState() const { return m_aimState; }
void setAimState(const MountingPointState &mps) { m_aimState = mps;}
//@}
bool isValid() const { return m_isValid; }
Core::GeoPosition geoPosition() const { return m_data.geoPosition; }
Core::RelativePosition relPosition() const { return m_data.relPosition; }
MountingPointType type() const { return m_data.mountingPointTypeId; }
int32_t buildingId() const { return m_data.mainStructureElementId; }
QString name() const;
QString fileName() const;
QByteArray properties() const { return m_data.properties.c_str(); }
QImage toImage(int32_t edgeLength = 100) const;
bool writeFile(int32_t edgeLength = 25) const;
int floor() const { return m_floor; }
void setFloor(int floor) { m_floor = floor; }
void setAssociatedAssetId(int32_t id);
void setHasAssociatedAssetDefect(bool hasAssociatedAssetDefect);
MountingPointState getNextMountingPointState(const MountingPointState currState);
private: // methods
private: // attributes
StructureElement m_data;
int32_t m_associatedAssetId;
MountingPointState m_aimState;
bool m_hasAssociatedAssetDefect;
bool m_isValid;
int m_floor;
public:
enum class MpColor
{
GRAY,
BLUE,
RED,
GREEN,
ORANGE
};
static QString mpColorToString(MpColor mpColor);
static QString mpColorToPostfix(MpColor mpColor);
struct NameImagePair
{
NameImagePair(const QString &name = QString(),
const QImage &img = QImage())
: m_name(name), m_img(img)
{}
QString m_name; // like announcement_BLUE
QImage m_img;
};
struct MpNameImageData
{
NameImagePair nipGray;
NameImagePair nipBlue;
NameImagePair nipRed;
NameImagePair nipGreen;
NameImagePair nipOrange;
};
//
// Some methods regarding ImageTable:
//
static QMap<MountingPointType, MpNameImageData> &getImageTable(); // contains images in good quality (100*100px)
static bool getImageAttributePlanActivity(const MountingPoint& mp,
QImage &imgOut, QString &attribNameOut);
static bool getImageAttributePlanDefinition(const MountingPoint& mp,
QImage &imgOut, QString &attribNameOut);
static bool getImageAttribute(const MountingPoint& mp, MpColor mpColor,
QImage &img, QString &attribName);
private:
static QMap<MountingPointType, MpNameImageData> &getImageTableInternal();
static void insertHelper(MountingPointType::type type,
const QString &name,
const QString &colorCodeGray,
const QString &colorCodeGreen,
const QString &colorCodeRed,
const QString &colorCodeOrange,
const QString &defName = QString());
static QImage getImage(const MountingPoint &mp);
static const MpNameImageData *getNameImageData(const MountingPoint&mp);
static const NameImagePair *getNameImagePair(const MountingPoint&mp);
}; // class MountingPoint
} // namespace InfrastructureManagement
@@ -1,78 +0,0 @@
#ifndef LTS_COMMON_PROJECTCONFIG_PROJECT_DEFINES_H
#define LTS_COMMON_PROJECTCONFIG_PROJECT_DEFINES_H
#pragma once
#include <string>
#include <ostream>
namespace IDL
{
enum class PartitionType
{
Any,
Global,
Exercise,
AllExercises,
Replay,
};
inline std::string toStdString(PartitionType pt)
{
switch (pt)
{
case PartitionType::Any:
return "Any";
case PartitionType::Global:
return "Global";
case PartitionType::Exercise:
return "Exercise";
case PartitionType::AllExercises:
return "AllExercises";
case PartitionType::Replay:
return "Replay";
}
return std::string("invalid:") + std::to_string(static_cast<int>(pt));
}
inline std::ostream& operator <<(std::ostream &o, PartitionType pt)
{
switch (pt)
{
case PartitionType::Any:
case PartitionType::Global:
case PartitionType::Exercise:
case PartitionType::AllExercises:
case PartitionType::Replay:
return o << std::string("PartitionType::") + toStdString(pt);
default:
return o << std::to_string(static_cast<int>(pt));
}
}
inline std::string exercisePartition(int exerciseId)
{
if (exerciseId < 0)
return { "ex_*" };
return std::string("ex_") + std::to_string(exerciseId);
}
inline std::string replayPartition(int partitionId)
{
if (partitionId < 0)
return { "srp_*" };
return std::string("srp_") + std::to_string(partitionId);
}
} // namespace IDL
#endif // LTS_COMMON_PROJECTCONFIG_PROJECT_DEFINES_H
@@ -1,26 +0,0 @@
#pragma once
// Stub export header for LtsProjectionWorkstation
// (the real header is generated by CMake via GENERATE_EXPORT_HEADER when the
// library is built; this stub covers non-RTI builds and is found first on the
// -I line because the source include/ dir precedes the build tree)
#ifndef LTSPROJECTIONWORKSTATION_EXPORT_H
#define LTSPROJECTIONWORKSTATION_EXPORT_H
// Must expand to a default-visibility attribute, NOT to empty: the build sets
// CMAKE_CXX_VISIBILITY_PRESET=hidden, and this stub is found before the
// CMake-generated header (the source include/ dir precedes the build tree on
// the -I line). With an empty macro the LtsProjectionWorkstation class symbols
// would be hidden and consumers (e.g. OperatorApplication) fail to link
// libLtsProjectionWorkstation.so.
// If the library is not built, the attribute is harmless: it only changes
// visibility, not symbol resolution.
#if defined(_MSC_VER)
# define LTSPROJECTIONWORKSTATION_EXPORT __declspec(dllexport)
#else
# define LTSPROJECTIONWORKSTATION_EXPORT __attribute__((visibility("default")))
#endif
#define LTSPROJECTIONWORKSTATION_NO_EXPORT
#endif // LTSPROJECTIONWORKSTATION_EXPORT_H
@@ -1,12 +0,0 @@
// STUB HEADER - Generated during Qt6 migration
// This file compensates for missing ltsscripttimeline_export.h when LtsScriptTimeline is not built
// Original would be generated by CMake GENERATE_EXPORT_HEADER for LtsScriptTimeline library
#ifndef LTSSCRIPTTIMELINE_EXPORT_H
#define LTSSCRIPTTIMELINE_EXPORT_H
// Stub export macros for BUILD_RTI=OFF or when LtsScriptTimeline is not built
#define LTSSCRIPTTIMELINE_EXPORT
#define LTSSCRIPTTIMELINE_NO_EXPORT
#endif // LTSSCRIPTTIMELINE_EXPORT_H
@@ -1,22 +0,0 @@
#ifndef LTSSESSION_EXPORT_H
#define LTSSESSION_EXPORT_H
// Stub export header for LtsSession when built without RTI
// This file is generated by CMake when building with RTI
// For non-RTI builds, we provide this stub
// Must expand to a default-visibility attribute, NOT to empty: the build sets
// CMAKE_CXX_VISIBILITY_PRESET=hidden, and this stub is found before the
// CMake-generated header (the source include/ dir precedes the build tree on
// the -I line). With an empty macro the LtsSession class symbols would be
// hidden and consumers (e.g. LtsFileDialog) fail to link libLtsSession.so.
// If the library is not built, the attribute is harmless: it only changes
// visibility, not symbol resolution.
#if defined(_MSC_VER)
# define LTSSESSION_EXPORT __declspec(dllexport)
#else
# define LTSSESSION_EXPORT __attribute__((visibility("default")))
#endif
#define LTSSESSION_NO_EXPORT
#endif // LTSSESSION_EXPORT_H
@@ -1,21 +0,0 @@
/**
* Export definitions for LtsSessionData
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtCore/qglobal.h>
#ifndef LTSSESSIONDATA_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define LTSSESSIONDATA_EXPORT
# else
# if defined(MAKE_LTSESSIONDATA_LIB)
# define LTSSESSIONDATA_EXPORT Q_DECL_EXPORT
# else
# define LTSSESSIONDATA_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
@@ -1,55 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include <QtCore/QString>
#include <vector>
#include "mrkcommon_export.h"
namespace MarkerManagement
{
// STUB: MarkerType enum
enum class MarkerType : int { Unknown = 0, Situation = 1, Audio = 2, Video = 3 };
// STUB: MarkerDescription - wird durch echten DDS-Typ ersetzt (muss VOR Marker deklariert werden)
struct MRKCOMMON_EXPORT MarkerDescription
{
int id = 0;
QString name;
MarkerType markerType() const { return MarkerType::Unknown; }
void setMarkerType(MarkerType type) { Q_UNUSED(type); }
std::string content() const { return ""; }
// Weitere Felder werden bei Bedarf ergänzt
};
// STUB: Marker - wird durch echten DDS-Typ ersetzt
struct MRKCOMMON_EXPORT Marker
{
int id = 0;
QString name;
int exerciseId = 0;
qint64 timeStamp() const { return 0; }
qint64 timeStampOffset() const { return 0; }
int operatorId() const { return 0; }
int fileContentId() const { return 0; }
std::string note() const { return ""; }
std::vector<MarkerDescription> descriptions() const { return {}; }
// Weitere Felder werden bei Bedarf ergänzt
};
// STUB: toString Funktion für MarkerType
inline QString toString(MarkerType type)
{
switch (type)
{
case MarkerType::Unknown: return QStringLiteral("Unknown");
case MarkerType::Situation: return QStringLiteral("Situation");
case MarkerType::Audio: return QStringLiteral("Audio");
case MarkerType::Video: return QStringLiteral("Video");
default: return QStringLiteral("Unknown");
}
}
} // namespace MarkerManagement
@@ -1,14 +0,0 @@
#pragma once
// STUB-HEADER: Export-Macro für MarkerManagement
// Wird normalerweise von CMake generiert
#ifdef _WIN32
#ifdef MRKCOMMON_EXPORTS
#define MRKCOMMON_EXPORT __declspec(dllexport)
#else
#define MRKCOMMON_EXPORT __declspec(dllimport)
#endif
#else
#define MRKCOMMON_EXPORT __attribute__((visibility("default")))
#endif
@@ -1,25 +0,0 @@
// Stub file for nom_enums.hpp - used when BUILD_RTI=OFF
#ifndef NOM_ENUMS_HPP
#define NOM_ENUMS_HPP
#include <cstdint>
namespace NotificationManagement {
enum class NotificationType : std::int32_t {
Info = 0,
Warning = 1,
Error = 2,
Critical = 3
};
enum class NotificationPriority : std::int32_t {
Low = 0,
Normal = 1,
High = 2,
Urgent = 3
};
} // namespace NotificationManagement
#endif // NOM_ENUMS_HPP
@@ -1,43 +0,0 @@
/**
* @RDE_HEADER@
* Data Plugin Interface for OperatorManagement (Interface for access from other Plugins)
*/
#pragma once
#include <PluginInterfaces/data_plugin_interface.h>
#include <OperatorManagement/opm_dtc.h>
#include <OperatorManagement/opm_ftc.h>
#include <memory>
namespace OperatorManagement
{
class ForeignDataInterface;
/**
* @brief The DataInterface class provides the Topics Clients only for the GUI Plugins
*/
class DataInterface : public DataPluginBase::Interface
{
public:
using DataPluginBase::Interface::Interface;
virtual std::shared_ptr<OperatorManagement::Interface::Dtc> getDtc() = 0;
virtual std::shared_ptr<OperatorManagement::Interface::Ftc> getFtc() = 0;
virtual std::shared_ptr<ForeignDataInterface> getForeignDataInterface() = 0;
};
/**
* @brief The ForeignInterface class provides methods and signals for foreign plugins, that need
* access to the data of this DataPlugin
*/
class ForeignDataInterface
{
public:
ForeignDataInterface() = default;
virtual ~ForeignDataInterface() = default;
virtual void onSendKeepAlive() = 0;
};
} // namespace OperatorManagement
@@ -1,31 +0,0 @@
// Stub file for opm_enums.hpp - used when BUILD_RTI=OFF
#ifndef OPM_ENUMS_HPP
#define OPM_ENUMS_HPP
#include <cstdint>
namespace OperatorManagement {
enum class AccessControlLevel : std::int32_t {
None = 0,
ReadOnly = 1,
Operator = 2,
Supervisor = 3,
Administrator = 4
};
enum class OperatorState : std::int32_t {
Offline = 0,
Online = 1,
Busy = 2,
Away = 3
};
enum class GroupType : std::int32_t {
Standard = 0,
Special = 1
};
} // namespace OperatorManagement
#endif // OPM_ENUMS_HPP
@@ -1,49 +0,0 @@
// Stub file for ppm_enums.hpp - used when BUILD_RTI=OFF
#ifndef PPM_ENUMS_HPP
#define PPM_ENUMS_HPP
#include <cstdint>
#include <ostream>
namespace ParticipantManagement {
enum class ParticipantState : std::int32_t {
Active = 0,
Inactive = 1,
Suspended = 2
};
enum class ParticipantRole : std::int32_t {
Observer = 0,
Player = 1,
Controller = 2,
Admin = 3
};
enum class DataModification : std::int32_t {
eAdded = 0,
eModified = 1,
eRemoved = 2
};
enum class TypeClass : std::int32_t {
eUninitialized = 0,
ePlatform = 1,
ePerson = 2,
eEvent = 3
};
inline std::ostream& operator<<(std::ostream& os, TypeClass tc) {
switch (tc) {
case TypeClass::eUninitialized: os << "eUninitialized"; break;
case TypeClass::ePlatform: os << "ePlatform"; break;
case TypeClass::ePerson: os << "ePerson"; break;
case TypeClass::eEvent: os << "eEvent"; break;
default: os << "Unknown"; break;
}
return os;
}
} // namespace ParticipantManagement
#endif // PPM_ENUMS_HPP
@@ -1,10 +0,0 @@
#pragma once
// Export-Macro für ParticipantManagement Module
// STUB: Wird normalerweise von CMake generiert
#ifdef PPMCOMMON_LIBRARY
#define PPMCOMMON_EXPORT Q_DECL_EXPORT
#else
#define PPMCOMMON_EXPORT Q_DECL_IMPORT
#endif
@@ -1,36 +0,0 @@
#pragma once
// STUB-Header: Diese Datei wird normalerweise von DDS/Codegenerator generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include "pdm_types.h"
namespace ProjectDataManagement
{
// EventType wird bereits in pdm_types.h definiert
// STUB: EventType_def - Platzhalter für DDS-generierten Typ
// Wird in AlarmManagement für Event-Typisierung verwendet
struct EventType_def
{
int value{0};
EventType_def() = default;
explicit EventType_def(int v) : value(v) {}
explicit EventType_def(EventType t) : value(static_cast<int>(t)) {}
bool operator==(const EventType_def& other) const { return value == other.value; }
bool operator!=(const EventType_def& other) const { return value != other.value; }
bool operator<(const EventType_def& other) const { return value < other.value; }
};
// STUB: EventData - Basisstruktur für Event-Daten
struct EventData
{
EventType_def eventType;
QString description;
qint64 timestamp{0};
};
} // namespace ProjectDataManagement
@@ -1,24 +0,0 @@
// Stub file for rep_enums.hpp - used when BUILD_RTI=OFF
#ifndef REP_ENUMS_HPP
#define REP_ENUMS_HPP
#include <cstdint>
namespace ReportManagement {
enum class ReportType : std::int32_t {
Summary = 0,
Detailed = 1,
Statistical = 2
};
enum class ReportFormat : std::int32_t {
PDF = 0,
HTML = 1,
XML = 2,
JSON = 3
};
} // namespace ReportManagement
#endif // REP_ENUMS_HPP
@@ -1,21 +0,0 @@
/**
* Export definitions for svcPreCommon
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtCore/qglobal.h>
#ifndef SVCCOMMON_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define SVCCOMMON_EXPORT
# else
# if defined(MAKE_SVCCOMMON_LIB)
# define SVCCOMMON_EXPORT Q_DECL_EXPORT
# else
# define SVCCOMMON_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
@@ -1,25 +0,0 @@
// Stub file for srp_enums.hpp - used when BUILD_RTI=OFF
#ifndef SRP_ENUMS_HPP
#define SRP_ENUMS_HPP
#include <cstdint>
namespace SituationReplay {
enum class ReplayState : std::int32_t {
Stopped = 0,
Playing = 1,
Paused = 2,
Rewinding = 3
};
enum class ReplaySpeed : std::int32_t {
QuarterSpeed = 0,
HalfSpeed = 1,
NormalSpeed = 2,
DoubleSpeed = 3
};
} // namespace SituationReplay
#endif // SRP_ENUMS_HPP
@@ -1,11 +0,0 @@
#ifndef TOPICEDITORBASE_EXPORT_H
#define TOPICEDITORBASE_EXPORT_H
// Stub export header for TopicEditorBase when built without RTI
// This file is generated by CMake when building with RTI
// For non-RTI builds, we provide this stub
#define TOPICEDITORBASE_EXPORT
#define TOPICEDITORBASE_NO_EXPORT
#endif // TOPICEDITORBASE_EXPORT_H
@@ -1,75 +0,0 @@
/**
* STUB-Header für ElevationMapManager - Qt6 Migration
* Diese Datei ermöglicht das Kompilieren von LtsElevation ohne das vollständige ElevationMap-Modul
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QRectF>
#include <QtCore/QPointF>
#include <vector>
// QPoint3D ist bereits in LtsUtilsCore/qpoint3d.h definiert
// #include "LtsUtils/qpoint3d.h" // Wird von lts_elevation_manager.h included
namespace LtsUtils
{
// Forward-Referenz, Definition erfolgt in qpoint3d.h
struct QPoint3D;
} // namespace LtsUtils
using LOSVector = std::vector<double>;
namespace SituationMap
{
// The NGL build uses -fvisibility=hidden; LtsElevation links this class
// across the shared library boundary, so it needs default visibility.
class __attribute__((visibility("default"))) ElevationMapManager final : public QObject
{
Q_OBJECT
public:
ElevationMapManager();
ElevationMapManager(const ElevationMapManager &) = delete;
ElevationMapManager &operator = (const ElevationMapManager &) = delete;
~ElevationMapManager();
int init(const QStringList &filePaths_rough_to_fine);
void cleanupCurrentContent();
bool waitForInitialization();
bool isValid() const;
double elevation(double lon_rad, double lat_rad, bool *bIsCovered = nullptr) const;
double elevation(double lon_rad, double lat_rad, double defaultValue, bool *bIsCovered = nullptr) const;
QRectF simpleUnitedExtent() const;
bool contains(const QPointF &point) const;
void LOSProfile(const QPointF &start, const QPointF &end, LOSVector &losProfile);
enum class LineOfSight { LOS_UNDEFINED = 0,
LOS_ERROR,
LOS_VISIBLE,
LOS_INVISIBLE };
LineOfSight lineOfSightCalculation(const LOSVector &losProfile,
double centerHat,
double objHat) const;
LineOfSight lineOfSightCalculation(const LtsUtils::QPoint3D &startPointGeo_absZ,
const LtsUtils::QPoint3D &endPointGeo_absZ);
LineOfSight lineOfSightCalculation(const QPointF &startPointGeo, double startHat,
const QPointF &endPointGeo, double endHat);
protected:
class Private;
Private *d;
}; // ElevationMapManager
} // namespace SituationMap
@@ -1,163 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_ABSTRACTLOCALIZER_H
#define GRANTLEE_ABSTRACTLOCALIZER_H
#include "grantlee_templates_export.h"
#include <QtCore/QLocale>
#include <QtCore/QSharedPointer>
#include <QtCore/QVariantList>
class QDateTime;
namespace Grantlee
{
/**
@brief Interface for implementing an internationalization system.
This class defines an interface for accessing an internationalization, such as
QLocale/QTranslator or gettext/KLocale.
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT AbstractLocalizer
{
public:
/**
Constructor
*/
AbstractLocalizer();
/**
Destructor
*/
virtual ~AbstractLocalizer();
/**
Processes the data in @p variant into a localized string.
The base implementation can localize numbers, dates and times, and
strings.
*/
virtual QString localize(const QVariant &variant) const;
/**
Returns the current locale as a string.
*/
virtual QString currentLocale() const = 0;
/**
Makes this localizer use the locale specified by @p localeName for output.
*/
virtual void pushLocale(const QString &localeName) = 0;
/**
Makes this localizer use the previous locale for output.
*/
virtual void popLocale() = 0;
/**
Loads the @p catalog from @p path.
*/
virtual void loadCatalog(const QString &path, const QString &catalog) = 0;
/**
Unloads the @p catalog
*/
virtual void unloadCatalog(const QString &catalog) = 0;
/**
Localizes @p number
*/
virtual QString localizeNumber(int number) const = 0;
/**
Localizes @p number
*/
virtual QString localizeNumber(qreal number) const = 0;
/**
Localizes @p value as a monetary value in the currency specified by @p
currencyCode.
*/
virtual QString localizeMonetaryValue(qreal value, const QString &currencyCode
= {}) const = 0;
/**
Localizes @p date with the specified @p formatType
*/
virtual QString localizeDate(const QDate &date,
QLocale::FormatType formatType
= QLocale::ShortFormat) const = 0;
/**
Localizes @p time with the specified @p formatType
*/
virtual QString localizeTime(const QTime &time,
QLocale::FormatType formatType
= QLocale::ShortFormat) const = 0;
/**
Localizes @p dateTime with the specified @p formatType
*/
virtual QString localizeDateTime(const QDateTime &dateTime,
QLocale::FormatType formatType
= QLocale::ShortFormat) const = 0;
/**
Localizes @p string with the specified @p arguments for substitution
*/
virtual QString localizeString(const QString &string,
const QVariantList &arguments = {}) const = 0;
/**
Localizes @p string, disambiguated by @p context with the specified @p
arguments for substitution
*/
virtual QString
localizeContextString(const QString &string, const QString &context,
const QVariantList &arguments = {}) const = 0;
/**
Localizes @p string or its @p pluralForm with the specified @p arguments
for substitution
*/
virtual QString
localizePluralString(const QString &string, const QString &pluralForm,
const QVariantList &arguments = {}) const = 0;
/**
Localizes @p string or its @p pluralForm, disambiguated by @p context with
the specified @p arguments for substitution
*/
virtual QString
localizePluralContextString(const QString &string, const QString &pluralForm,
const QString &context,
const QVariantList &arguments = {}) const = 0;
private:
Q_DISABLE_COPY(AbstractLocalizer)
};
}
#endif
@@ -1,273 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2008,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_ABSTRACTMARKUPBUILDER_H
#define GRANTLEE_ABSTRACTMARKUPBUILDER_H
#include "grantlee_textdocument_export.h"
#include <QtCore/QString>
#include <QtGui/QTextListFormat>
class QBrush;
namespace Grantlee
{
class AbstractMarkupBuilderPrivate;
/// @headerfile abstractmarkupbuilder.h grantlee/abstractmarkupbuilder.h
/**
@brief Interface for creating marked-up text output.
The **%AbstractMarkupBuilder** is used by a MarkupDirector to create marked-up
output such as html or markdown.
See PlainTextMarkupBuilder and TextHTMLBuilder for example implementations.
This interface can be extended to handle custom format types in a
QTextDocument. @see @ref custom_qtextobject
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEXTDOCUMENT_EXPORT AbstractMarkupBuilder
{
public:
/** Destructor */
virtual ~AbstractMarkupBuilder() {}
/** Begin a bold element in the markup */
virtual void beginStrong() = 0;
/** Close the bold element in the markup */
virtual void endStrong() = 0;
/** Begin an emphasised element in the markup */
virtual void beginEmph() = 0;
/** Close the emphasised element in the markup */
virtual void endEmph() = 0;
/** Begin an underlined element in the markup */
virtual void beginUnderline() = 0;
/** Close the underlined element in the markup */
virtual void endUnderline() = 0;
/** Begin a struck out element in the markup */
virtual void beginStrikeout() = 0;
/** Close the struck out element in the markup */
virtual void endStrikeout() = 0;
/**
Begin a decorarated foreground element in the markup (A text color)
using @p brush
*/
virtual void beginForeground(const QBrush &brush) = 0;
/** Close the decorarated foreground element in the markup */
virtual void endForeground() = 0;
/**
Begin a decorarated background element in the markup (A text background
color) using @p brush
*/
virtual void beginBackground(const QBrush &brush) = 0;
/** Close the decorarated background element in the markup */
virtual void endBackground() = 0;
/**
Begin a url anchor element in the markup
@param href The href of the anchor.
@param name The name of the anchor.
*/
virtual void beginAnchor(const QString &href = {}, const QString &name = {})
= 0;
/** Close the anchor element */
virtual void endAnchor() = 0;
/**
Begin a new font familiy element in the markup
@param family The name of the font family to begin.
*/
virtual void beginFontFamily(const QString &family) = 0;
/** End font family element */
virtual void endFontFamily() = 0;
/**
Begin a new font point size element in the markup
@param size The point size to begin.
*/
virtual void beginFontPointSize(int size) = 0;
/** End font point size element */
virtual void endFontPointSize() = 0;
/**
Begin a new paragraph in the markup
@param a The alignment of the new paragraph.
@param top The top margin of the new paragraph.
@param bottom The bottom margin of the new paragraph.
@param left The left margin of the new paragraph.
@param right The right margin of the new paragraph.
*/
virtual void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0,
qreal bottom = 0.0, qreal left = 0.0,
qreal right = 0.0)
= 0;
/** Close the paragraph in the markup. */
virtual void endParagraph() = 0;
/** Add a newline to the markup. */
virtual void addNewline() = 0;
/**
Insert a horizontal rule into the markup.
@param width The width of the rule. Default is full width.
*/
virtual void insertHorizontalRule(int width = -1) = 0;
/**
Insert a new image element into the markup.
@param url The url of the image
@param width The width of the image
@param height The height of the image.
*/
virtual void insertImage(const QString &url, qreal width, qreal height) = 0;
/**
Begin a new list element in the markup.
A list element contains list items, and may contain other lists.
@param style The style of list to create.
*/
virtual void beginList(QTextListFormat::Style style) = 0;
/**
Close the list.
*/
virtual void endList() = 0;
/** Begin a new list item in the markup */
virtual void beginListItem() = 0;
/** End the list item */
virtual void endListItem() = 0;
/** Begin a superscript element */
virtual void beginSuperscript() = 0;
/** End superscript element */
virtual void endSuperscript() = 0;
/** Begin a subscript element */
virtual void beginSubscript() = 0;
/** End subscript element */
virtual void endSubscript() = 0;
/**
Begin a table element.
@param cellpadding The padding attribute for the table.
@param cellspacing The spacing attribute for the table.
@param width The width of the table. May be either an integer, or a
percentage value.
*/
virtual void beginTable(qreal cellpadding, qreal cellspacing,
const QString &width)
= 0;
/**
Begin a new table row
*/
virtual void beginTableRow() = 0;
/**
Begin a new table header cell.
@param width The width of the cell.
@param colSpan The column span of the cell.
@param rowSpan The row span of the cell.
*/
virtual void beginTableHeaderCell(const QString &width, int colSpan,
int rowSpan)
= 0;
/**
Begin a new table cell.
@param width The width of the cell.
@param colSpan The column span of the cell.
@param rowSpan The row span of the cell.
*/
virtual void beginTableCell(const QString &width, int colSpan, int rowSpan)
= 0;
/** End a table element */
virtual void endTable() = 0;
/** End a table row */
virtual void endTableRow() = 0;
/** End a table header cell */
virtual void endTableHeaderCell() = 0;
/** End a table cell */
virtual void endTableCell() = 0;
/**
Begin a level @p level header
@param level An integer between 1 and 6
*/
virtual void beginHeader(int level) = 0;
/**
End a level @p level header
@param level An integer between 1 and 6
*/
virtual void endHeader(int level) = 0;
/**
Append the plain text @p text to the markup
@param text The text to append.
*/
virtual void appendLiteralText(const QString &text) = 0;
/**
Append the raw text @p text to the markup. @p text is added unescaped
*/
virtual void appendRawText(const QString &text) = 0;
/**
Return the fully marked up result of the building process.
This may contain metadata etc, such as a head element in html.
@return The fully marked up text.
*/
virtual QString getResult() = 0;
};
}
#endif
@@ -1,113 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2008 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_BBCODEBUILDER_H
#define GRANTLEE_BBCODEBUILDER_H
#include "abstractmarkupbuilder.h"
namespace Grantlee
{
/**
@brief Builder to create BBCode from a QTextDocument
*/
class BBCodeBuilder : public AbstractMarkupBuilder
{
public:
/**
Creates a new BBCodeBuilder.
*/
BBCodeBuilder();
~BBCodeBuilder() override;
void beginStrong() override;
void endStrong() override;
void beginEmph() override;
void endEmph() override;
void beginUnderline() override;
void endUnderline() override;
void beginStrikeout() override;
void endStrikeout() override;
void beginForeground(const QBrush &brush) override;
void endForeground() override;
// Background colour not supported by BBCode.
void beginAnchor(const QString &href = {}, const QString &name = {}) override;
void endAnchor() override;
// Font family not supported by BBCode.
/**
Begin an element of font size @p size. Note that this size is in pixels,
and must be converted before it is suitable for use in BBCode.
@param size The size of font to begin.
*/
void beginFontPointSize(int size) override;
void endFontPointSize() override;
void beginParagraph(Qt::Alignment a = Qt::AlignLeft, qreal top = 0.0,
qreal bottom = 0.0, qreal left = 0.0,
qreal right = 0.0) override;
void endParagraph() override;
void addNewline() override;
void insertImage(const QString &src, qreal width, qreal height) override;
void beginList(QTextListFormat::Style type) override;
void endList() override;
void beginListItem() override;
void beginSuperscript() override;
void endSuperscript() override;
void beginSubscript() override;
void endSubscript() override;
void beginTable(qreal, qreal, const QString &) override;
void beginTableRow() override;
void appendLiteralText(const QString &text) override;
/**
Escapes @p text appropriately for BBCode.
*/
const QString escape(const QString &text) const;
QString getResult() override;
private:
QList<QTextListFormat::Style> m_currentListItemStyles;
QString m_text;
Qt::Alignment m_currentAlignment;
};
}
#endif
@@ -1,112 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_CACHINGLOADERDECORATOR_H
#define GRANTLEE_CACHINGLOADERDECORATOR_H
#include "templateloader.h"
#include "grantlee_templates_export.h"
namespace Grantlee
{
class CachingLoaderDecoratorPrivate;
/// @headerfile cachingloaderdecorator.h grantlee/cachingloaderdecorator.h
/**
@brief Implements a loader decorator which caches compiled Template objects.
The **%CachingLoaderDecorator** can be used with any implementation of
Grantlee::AbstractTemplateLoader.
@code
auto loader = QSharedPointer<Grantlee::FileSystemTemplateLoader>::create();
loader->setTemplateDirs({"/path/one", "/path/two"});
auto cache =
QSharedPointer<Grantlee::CachingLoaderDecorator>::create( loader );
m_engine->addTemplateLoader( cache );
@endcode
The effect is that templates do not need to be loaded from the filesystem and
compiled into Template objects on each access, but may be returned from the
cache instead.
This can be significant if loading Templates in a loop, or loading the same
Template very often in an application.
@code
<ul>
{% for item in list %}
<li>{% include "itemtemplate.html" %}</li>
{% endfor %}
</ul>
@endcode
If the loading of Templates is a bottleneck in an application, it may make
sense to use the caching decorator.
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT CachingLoaderDecorator
: public AbstractTemplateLoader
{
public:
/**
Constructor
*/
CachingLoaderDecorator(QSharedPointer<AbstractTemplateLoader> loader);
/**
Destructor
*/
~CachingLoaderDecorator() override;
bool canLoadTemplate(const QString &name) const override;
QPair<QString, QString> getMediaUri(const QString &fileName) const override;
Template loadByName(const QString &name,
const Grantlee::Engine *engine) const override;
/**
Clears the Templates objects cached in the decorator.
*/
void clear();
/**
Returns the number of Template objects cached in the decorator.
*/
int size() const;
/**
Returns whether the cache is empty.
*/
bool isEmpty() const;
private:
Q_DECLARE_PRIVATE(CachingLoaderDecorator)
CachingLoaderDecoratorPrivate *const d_ptr;
};
}
#endif
@@ -1,283 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_CONTEXT_H
#define GRANTLEE_CONTEXT_H
#include "abstractlocalizer.h"
#include "grantlee_templates_export.h"
#include <QtCore/QVariantHash>
namespace Grantlee
{
class RenderContext;
class ContextPrivate;
/// @headerfile context.h grantlee/context.h
/**
@brief The **%Context** class holds the context to render a Template with.
For application developers, using the **%Context** class is a matter of
inserting keys and values as appropriate for rendering a Template using the
@ref insert method.
@code
auto t = engine->newTemplate(
"Name is {% name %} and age is {% age %}.", "some_template" );
Context c1;
c1.insert( "name", "Tom" );
c1.insert( "age", 34 );
Context c2;
c2.insert( "name", "Harry" );
c2.insert( "age", 43 );
t->render(c1); // Returns "Name is Tom and age is 43."
t->render(c2); // Returns "Name is Harry and age is 34."
@endcode
Note that one Template may be rendered multiple times with different contexts.
Note also that any QVariant may be inserted into a **%Context** object. Most
commonly, QObjects will be used here.
@see @ref custom_objects
@section context_stack Context Stack.
For template tag developers, some other **%Context** API is relevant.
It is possible to @ref push and @ref pop layers of context while a template
is being rendered. This is useful if your template tag makes additional
variables temporarily available in a part of a template. %Template tags
should only modify layers of context that they @ref push themselves, and
should @ref pop any layers created before finishing its rendering step.
See for example the @gr_tag{with} tag. In a template such as
@code
Some content
{% with person.name|toUpper as lowerName %}
Name is {% lowerName %}
{% endwith %}
@endcode
In this case, lowerName is available in the context only between the
@gr_tag{with} and @gr_tag{endwith} tags. The implementation of
the @gr_tag{with} tag render method is:
@code
void WithNode::render( OutputStream *stream, Context *c ) const
{
c->push();
// {% with m_filterExpression as m_name %}
c->insert( m_name, m_filterExpression.resolve( c ) );
m_list.render( stream, c );
c->pop(); // The section of context defining m_name is removed.
}
@endcode
Note that a **%Context** may temporarily override a variable in a parent
context. This is why it is important to @ref push a new context when adding
items to context and @ref pop it when finished.
@code
Some content
{% with "foo" as var %}
Var is {% var %} // Var is "foo"
{% with "bar" as var %}
Var is {% var %} // Var is "bar"
{% endwith %}
Var is {% var %} // Var is "foo"
{% endwith %}
@endcode
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT Context
{
public:
/**
Creates an empty context
*/
Context();
/**
Sets every key in the hash as a property name with the variant as the
value.
*/
explicit Context(const QVariantHash &hash);
/**
Copy Constructor
*/
Context(const Context &other);
/**
Assignmant operator
*/
Context &operator=(const Context &other);
#ifndef Q_QDOC
/**
@internal
Whether to automatically escape all context content. This is not usually
used directly. Use the @gr_tag{autoescape} tag instead.
*/
bool autoEscape() const;
/**
@internal
Sets whether to automatically escape all context content. This is not
usually used directly. Use the @gr_tag{autoescape} tag instead.
*/
void setAutoEscape(bool autoescape);
#endif
/**
Destructor
*/
~Context();
/**
Returns the context object identified by the key @p str
*/
QVariant lookup(const QString &str) const;
/**
Insert the context object @p object identified by @p name into
the **%Context**.
*/
void insert(const QString &name, QObject *object);
/**
Insert the context object @p variant identified by @p name into
the **%Context**.
*/
void insert(const QString &name, const QVariant &variant);
/**
Pushes a new context.
@see @ref context_stack
*/
void push();
/**
Pops the context.
@see @ref context_stack
*/
void pop();
#ifndef Q_QDOC
/**
@internal Returns the context hash at depth @p depth.
*/
QVariantHash stackHash(int depth) const;
/**
@internal
Returns whether template being rendered is being mutated.
*/
bool isMutating() const;
/**
@internal
Sets whether template being rendered is being mutated to @p mutating.
*/
void setMutating(bool mutating);
/**
@internal
*/
void addExternalMedia(const QString &absolutePart,
const QString &relativePart);
/**
@internal
*/
void clearExternalMedia();
#endif
/**
Sets the @p localizer to be used.
The **%Context** takes ownerwhip of the localizer.
*/
void setLocalizer(QSharedPointer<AbstractLocalizer> localizer);
/**
Returns the localizer currently in use.
*/
QSharedPointer<AbstractLocalizer> localizer() const;
/**
Returns the external media encountered in the Template while rendering.
*/
QList<QPair<QString, QString>> externalMedia() const;
/**
The type of urls to external media that should be put in the template.
*/
enum UrlType {
AbsoluteUrls, ///< Absolute URLs should be put in the template.
RelativeUrls ///< Relative URLs should be put in the template.
};
/**
Sets the type of external media URL to be used in the template to @p type.
@see @ref media_finder_tag
*/
void setUrlType(UrlType type);
/**
The type of URL used in the template.
*/
UrlType urlType() const;
/**
Sets the relative path to external media to be used in templates to @p
relativePath
@see @ref media_finder_tag
*/
void setRelativeMediaPath(const QString &relativePath);
/**
The relative path to external media to be used in templates.
*/
QString relativeMediaPath() const;
/**
Returns a modifiable RenderContext. This may be used to make
Template rendering threadsafe so that render state does not need to be
stored in the Node implementation itself.
*/
RenderContext *renderContext() const;
private:
Q_DECLARE_PRIVATE(Context)
ContextPrivate *const d_ptr;
};
}
#endif
@@ -1,259 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_ENGINE_H
#define GRANTLEE_ENGINE_H
#include "template.h"
#include "templateloader.h"
namespace Grantlee
{
class TagLibraryInterface;
class EnginePrivate;
/// @headerfile engine.h grantlee/engine.h
/**
@brief **%Grantlee::Engine** is the main entry point for creating %Grantlee
Templates.
The **%Grantlee::Engine** is responsible for configuring and creating Template
objects. In typical use, one or more AbstractTemplateLoader objects will be
added to the Engine to load template objects, and plugin directories will be
set to enable finding template tags and filters.
@code
auto engine = new Engine();
auto loader = QSharedPointer<FileSystemTemplateLoader>::create();
loader->setTemplateDirs( {"/usr/share/myapp/templates"} );
engine->addTemplateLoader( loader );
engine->addPluginPath( "/usr/lib/myapp" );
auto template1 = engine->newTemplate( "Template content", "template name" );
auto template2 = engine->loadByName( "templatefile.html" );
@endcode
Once it is configured, the **%Engine** can be used to create new templates by
name by loading the templates with the @ref loadByName method, or by defining
the content in the @ref newTemplate method.
By default the builtin tags and filters distributed with %Grantlee are
available in all templates without using the @gr_tag{load} tag in the
template. These pre-loaded libraries may be configured if appropriate to the
application. For example, an application which defines its own tags and
filters may want them to be always available, or it may be desirable to
restrict the features available to template authors by removing built in
libraries.
Different **%Engine** objects can be used to create templates with differing
configurations.
@section smart_trim Insignificant whitespace
The output of rendering a template depends on the content of the template. In
some cases when generating content in which whitespace is significant, this
can have undesired effects. For example, given a template to generate C++ code
like:
@verbatim
class MyClass {
{# This loop creates the #}
{# methods in the class #}
{% for method in methods %}
{% if method.hasDox %}
{{ method.dox }}
{% endif %}
{{ method.signature }}
{% endfor %}
};
@endverbatim
The output would have a lot of whitespace which is not necessarily wanted.
@code
class MyClass {
void foo() const;
};
@endcode
It is possible to strip insignificant whitespace by enabling the smartTrim
feature with @ref setSmartTrimEnabled. When enabled the output will not
contain a newline for any line in the template which has only one token of
template syntax, such as a comment, tag or variable.
@code
class MyClass {
void foo() const;
};
@endcode
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT Engine : public QObject
{
Q_OBJECT
public:
/**
Constructor
*/
Engine(QObject *parent = {});
/**
Destructor.
*/
~Engine() override;
/**
Returns the TemplateLoaders currently configured on the **%Engine**.
*/
QList<QSharedPointer<AbstractTemplateLoader>> templateLoaders();
/**
Adds @p loader to the TemplateLoaders currently configured on
the **%Engine**.
*/
void addTemplateLoader(QSharedPointer<AbstractTemplateLoader> loader);
/**
Sets the plugin dirs currently configured on the **%Engine** to @p dirs.
@warning This overwrites the default paths. You normally want
@ref addPluginPath.
@see @ref finding_plugins
*/
void setPluginPaths(const QStringList &dirs);
/**
Prepend @p dir to the list of plugin dirs.
*/
void addPluginPath(const QString &dir);
/**
Removes all instances of @p dir from the list of plugin dirs.
*/
void removePluginPath(const QString &dir);
/**
Returns the currently configured plugin dirs
*/
QStringList pluginPaths() const;
/**
Returns a URI for a media item with the name @p name.
Typically this will be used for images. For example the media URI for the
image <tt>"header_logo.png"</tt> may be
<tt>"/home/user/common/header_logo.png"</tt> or
<tt>"/home/user/some_theme/header_logo.png"</tt>
depending on the @ref templateLoaders configured.
This method will not usually be called by application code. To load media
in a template, use the @gr_tag{media_finder} template tag.
*/
QPair<QString, QString> mediaUri(const QString &fileName) const;
/**
Load the Template identified by @p name.
The Templates and plugins loaded will be determined by
the **%Engine** configuration.
*/
Template loadByName(const QString &name) const;
/**
Create a new Template with the content @p content identified by @p name.
The secondary Templates and plugins loaded will be determined by
the **%Engine** configuration.
*/
Template newTemplate(const QString &content, const QString &name) const;
/**
Returns the libraries available by default to new Templates.
*/
QStringList defaultLibraries() const;
/**
Adds the library named @p libName to the libraries available by default to
new Templates.
*/
void addDefaultLibrary(const QString &libName);
/**
Removes the library named @p libName from the libraries available by
default to new Templates.
*/
void removeDefaultLibrary(const QString &libName);
/**
Returns whether the smart trim feature is enabled for newly loaded
templates.
@see smart_trim
This is false by default.
*/
bool smartTrimEnabled() const;
/**
Sets whether the smart trim feature is enabled for newly loaded templates.
@see smart_trim
*/
void setSmartTrimEnabled(bool enabled);
#ifndef Q_QDOC
/**
@internal
Loads and returns the libraries specified in defaultLibraries or @p state.
*/
void loadDefaultLibraries();
/**
@internal
Loads and returns the library specified by @p name in the
current **%Engine** configuration or @p state.
Templates wishing to load a library should use the @gr_tag{load} tag.
*/
TagLibraryInterface *loadLibrary(const QString &name);
#endif
private:
Q_DECLARE_PRIVATE(Engine)
EnginePrivate *const d_ptr;
};
}
#endif
@@ -1,120 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_EXCEPTION_H
#define GRANTLEE_EXCEPTION_H
#include "grantlee_templates_export.h"
#include <QtCore/QString>
#include <exception>
namespace Grantlee
{
/**
Types of errors that can occur while using %Grantlee
*/
enum Error {
NoError,
EmptyVariableError,
EmptyBlockTagError,
InvalidBlockTagError,
UnclosedBlockTagError,
UnknownFilterError,
TagSyntaxError,
// VariableSyntaxError,
VariableNotInContext,
ObjectReturnTypeInvalid,
CompileFunctionError
};
/// @headerfile exception.h grantlee/exception.h
/**
@brief An exception for use when implementing template tags.
The **%Exception** class can be used when implementing
AbstractNodeFactory::getNode. An exception can be thrown to indicate that
the syntax of a particular tag is invalid.
For example, the following template markup should throw an error because the
include tag should have exactly one argument:
@code
<div>
{% include %}
</div>
@endcode
The corresponding implementation of IncludeNodeFactory::getNode is
@code
QStringList tagContents = smartSplit( tagContent );
if ( tagContents.size() != 2 )
throw Grantlee::Exception( TagSyntaxError,
"Error: Include tag takes exactly one argument" );
// The item at index 0 in the list is the tag name, "include"
QString includeName = tagContents.at( 1 );
@endcode
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT Exception
{
public:
/**
Creates an exception for the error @p errorCode and the verbose
message @p what
*/
Exception(Error errorCode, const QString &what)
: m_errorCode(errorCode), m_what(what)
{
}
virtual ~Exception() throw() {}
#ifndef Q_QDOC
/**
@internal
Returns the verbose message for the exception.
*/
const QString what() const throw() { return m_what; }
/**
@internal
Returns the error code for the exception.
*/
Error errorCode() const { return m_errorCode; }
#endif
private:
Error m_errorCode;
QString m_what;
};
}
#endif
@@ -1,117 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
// krazy:excludeall=dpointer
#ifndef GRANTLEE_FILTER_H
#define GRANTLEE_FILTER_H
#include "grantlee_templates_export.h"
#include "outputstream.h"
#include "safestring.h"
#include <QtCore/QSharedPointer>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
namespace Grantlee
{
/// @headerfile filter.h grantlee/filter.h
/**
@brief Base class for all filters.
The **%Filter** class can be implemented in plugin libraries to make
additional functionality available to templates.
Developers are required only to implement the @ref doFilter method and
integrate the filter as part of a custom plugin, but will never create or
access filters directly in application code.
The FilterExpression class is the access interface to a chain of **%Filter**
objects.
The @ref escape and @ref conditionalEscape methods are available for escaping
data where needed.
@see @ref filters
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT Filter
{
public:
/**
Destructor.
*/
virtual ~Filter();
#ifndef Q_QDOC
/**
FilterExpression makes it possible to access stream methods like escape
while resolving.
*/
void setStream(OutputStream *stream);
#endif
/**
Escapes and returns @p input. The OutputStream::escape method is used to
escape @p input.
*/
SafeString escape(const QString &input) const;
/**
Escapes and returns @p input. The OutputStream::escape method is used to
escape @p input.
*/
SafeString escape(const SafeString &input) const;
/**
Escapes @p input if not already safe from further escaping and returns it.
The OutputStream::escape method is used to escape @p input.
*/
SafeString conditionalEscape(const SafeString &input) const;
/**
Reimplement to filter @p input given @p argument.
@p autoescape determines whether the autoescape feature is currently on or
off. Most filters will not use this.
@see @ref autoescaping
*/
virtual QVariant doFilter(const QVariant &input,
const QVariant &argument = {},
bool autoescape = {}) const = 0;
/**
Reimplement to return whether this filter is safe.
*/
virtual bool isSafe() const;
private:
#ifndef Q_QDOC
OutputStream *m_stream;
#endif
};
}
#endif
@@ -1,200 +0,0 @@
/*
This file is part of the Grantlee template system.
Copyright (c) 2009,2010 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either version
2.1 of the Licence, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRANTLEE_FILTEREXPRESSION_H
#define GRANTLEE_FILTEREXPRESSION_H
#include "variable.h"
#include "grantlee_templates_export.h"
namespace Grantlee
{
class Filter;
class OutputStream;
class Parser;
struct Token;
class FilterExpressionPrivate;
/// @headerfile filterexpression.h grantlee/filterexpression.h
/**
@brief A **%FilterExpression** object represents a filter expression in a
template.
This class is only relevant if implementing custom tags or filters. Most of
the API here is internal.
Usually when implementing tags or filters, filter expressions will just be
created and resolved.
In template markup, a filter expression is a variable followed by one or more
filters separated by pipes:
%Filter expressions may appear in variable nodes:
@code
{{ some_var|upper_filter|lower_filter }}
@endcode
Or as arguments to tags
@code
{% some_tag some_arg1|filter1|filter2 some_arg2|filter3 %}
@endcode
The **%FilterExpression** class would be used in the getNode implementation of
the AbstractNodeFactory implementation for the <tt>some_tag</tt> tag.
@code
Node* SomeTagFactory::getNode(const QString &tagContent, Parser *p) const {
auto parts = smartSplit( tagContent );
parts.removeFirst(); // Remove the "some_tag" part.
FilterExpression arg1( parts.first(), p );
FilterExpression arg2( parts.at( 1 ), p );
return new SomeTagNode( arg1, arg2, p );
}
@endcode
@see AbstractNodeFactory::getFilterExpressionList
When implementing the Node::render method, the @ref resolve method may be used
to process the filter expression.
For example, if our <tt>SomeTagNode</tt> was to concatenate the resolved
values given as arguments:
@code
void SomeTagNode::render( QTextStream *stream, Context *c ) {
m_arg1.resolve( stream, c );
m_arg2.resolve( stream, c );
}
@endcode
Because Filters are highly generic, they do not all write data to the stream.
For example, a Filter might take as input a string, and return a list by
splitting the string on commas, or a Filter might compare an input to its
argument and return whether they are the same, but not write anything to the
stream. For that reason, the @ref resolve method writes data to the given
stream, and returns the same data in its returned QVariant.
The suitability of either of the @ref resolve methods will depend on the
implementation and requirements of your custom tag. For example if the
<tt>SomeTagNode</tt> ran a comparison of the arguments:
@code
void SomeTagNode::render( QTextStream *stream, Context *c ) {
QString first = m_arg1.resolve( c ).toString();
QString second = m_arg2.resolve( c ).toString();
if ( first == second )
m_trueList.render( stream, c );
else
m_falseList.render( stream, c );
}
@endcode
@see @ref tags_with_end_tags
@author Stephen Kelly <steveire@gmail.com>
*/
class GRANTLEE_TEMPLATES_EXPORT FilterExpression
{
public:
/**
Constructs an invalid **%FilterExpression**.
*/
FilterExpression();
/**
Constructs a filter expression from the string @p varString. The Parser @p
parser is used to retrieve filters.
*/
FilterExpression(const QString &varString, Grantlee::Parser *parser);
/**
Copy constructor.
*/
FilterExpression(const FilterExpression &other);
/**
Destructor.
*/
~FilterExpression();
/**
Assignment operator.
*/
FilterExpression &operator=(const FilterExpression &other);
/**
Returns the initial variable in the **%FilterExpression**.
*/
Variable variable() const;
/**
Resolves the **%FilterExpression** in the Context @p c and writes it to the
stream @p stream.
*/
QVariant resolve(OutputStream *stream, Context *c) const;
/**
Resolves the **%FilterExpression** in the Context @p c.
*/
QVariant resolve(Context *c) const;
/**
Returns whether the Filter resolves to true in the Context @p c.
@see @ref truthiness
*/
bool isTrue(Context *c) const;
/**
Returns a list for the **%FilterExpression**.
If the **%FilterExpression** can not be resolved to a list, an empty list
will be returned.
*/
QVariantList toList(Context *c) const;
/**
Returns whether a filter expression is valid.
A **%FilterExpression** is valid if all filters in the expression exist and
the initial variable being filtered is valid.
*/
bool isValid() const;
#ifndef Q_QDOC
/**
@internal
Returns the list of filters in the **%FilterExpression**.
*/
QStringList filters() const;
#endif
private:
Q_DECLARE_PRIVATE(FilterExpression)
FilterExpressionPrivate *const d_ptr;
};
}
#endif
@@ -1,42 +0,0 @@
#ifndef GRANTLEE_TEMPLATES_EXPORT_H
#define GRANTLEE_TEMPLATES_EXPORT_H
#ifdef GRANTLEE_TEMPLATES_STATIC_DEFINE
# define GRANTLEE_TEMPLATES_EXPORT
# define GRANTLEE_TEMPLATES_NO_EXPORT
#else
# ifndef GRANTLEE_TEMPLATES_EXPORT
# ifdef Grantlee_Templates_EXPORTS
/* We are building this library */
# define GRANTLEE_TEMPLATES_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define GRANTLEE_TEMPLATES_EXPORT __attribute__((visibility("default")))
# endif
# endif
# ifndef GRANTLEE_TEMPLATES_NO_EXPORT
# define GRANTLEE_TEMPLATES_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif
#ifndef GRANTLEE_TEMPLATES_DEPRECATED
# define GRANTLEE_TEMPLATES_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef GRANTLEE_TEMPLATES_DEPRECATED_EXPORT
# define GRANTLEE_TEMPLATES_DEPRECATED_EXPORT GRANTLEE_TEMPLATES_EXPORT GRANTLEE_TEMPLATES_DEPRECATED
#endif
#ifndef GRANTLEE_TEMPLATES_DEPRECATED_NO_EXPORT
# define GRANTLEE_TEMPLATES_DEPRECATED_NO_EXPORT GRANTLEE_TEMPLATES_NO_EXPORT GRANTLEE_TEMPLATES_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef GRANTLEE_TEMPLATES_NO_DEPRECATED
# define GRANTLEE_TEMPLATES_NO_DEPRECATED
# endif
#endif
#endif /* GRANTLEE_TEMPLATES_EXPORT_H */
@@ -1,42 +0,0 @@
#ifndef GRANTLEE_TEXTDOCUMENT_EXPORT_H
#define GRANTLEE_TEXTDOCUMENT_EXPORT_H
#ifdef GRANTLEE_TEXTDOCUMENT_STATIC_DEFINE
# define GRANTLEE_TEXTDOCUMENT_EXPORT
# define GRANTLEE_TEXTDOCUMENT_NO_EXPORT
#else
# ifndef GRANTLEE_TEXTDOCUMENT_EXPORT
# ifdef Grantlee_TextDocument_EXPORTS
/* We are building this library */
# define GRANTLEE_TEXTDOCUMENT_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define GRANTLEE_TEXTDOCUMENT_EXPORT __attribute__((visibility("default")))
# endif
# endif
# ifndef GRANTLEE_TEXTDOCUMENT_NO_EXPORT
# define GRANTLEE_TEXTDOCUMENT_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif
#ifndef GRANTLEE_TEXTDOCUMENT_DEPRECATED
# define GRANTLEE_TEXTDOCUMENT_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef GRANTLEE_TEXTDOCUMENT_DEPRECATED_EXPORT
# define GRANTLEE_TEXTDOCUMENT_DEPRECATED_EXPORT GRANTLEE_TEXTDOCUMENT_EXPORT GRANTLEE_TEXTDOCUMENT_DEPRECATED
#endif
#ifndef GRANTLEE_TEXTDOCUMENT_DEPRECATED_NO_EXPORT
# define GRANTLEE_TEXTDOCUMENT_DEPRECATED_NO_EXPORT GRANTLEE_TEXTDOCUMENT_NO_EXPORT GRANTLEE_TEXTDOCUMENT_DEPRECATED
#endif
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef GRANTLEE_TEXTDOCUMENT_NO_DEPRECATED
# define GRANTLEE_TEXTDOCUMENT_NO_DEPRECATED
# endif
#endif
#endif /* GRANTLEE_TEXTDOCUMENT_EXPORT_H */
@@ -1,7 +0,0 @@
#define GRANTLEE_VERSION_MAJOR 5
#define GRANTLEE_VERSION_MINOR 3
#define GRANTLEE_VERSION_PATCH 0
#define GRANTLEE_VERSION_STRING "5.3.0"
#define GRANTLEE_VERSION ((5<<16)|(3<<8)|(0))
#define GRANTLEE_MAJOR_MINOR_VERSION_STRING "5.3"
#define GRANTLEE_MIN_PLUGIN_VERSION 0
Loaded 100 of 365 files, more files were not shown because too many files have changed in this diff. Show more