chore(CMake): make Lts top-level resilient to partial checkouts and optional RTI/doxygen\n\n- Guard ADD_DOXYGEN_TARGET with existence check

- Add only existing Lts subdirectories to allow partial migrations
- Make RTI optional in Lts/Common/CodeGen and guard RTI target properties
\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torsten committed 2026-07-17 12:52:28 +02:00
1 parent d7491140fa
commit 3dbbcc1303
2 files changed
+31 -18

No files matched your search

+17 -12
View File
@@ -7,19 +7,24 @@
cmake_minimum_required(VERSION 3.16)
project(LtsPlaceholder)
SET(DOXYGEN_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen_Lts)
ADD_DOXYGEN_TARGET(Lts ${CMAKE_SOURCE_DIR}/doxygen/DoxyfileLts.in ${CMAKE_BINARY_DIR}/DoxyfileLts
${CMAKE_SOURCE_DIR}/doxygen/rheinmetall_defence_logo.jpg
${DOXYGEN_OUT_DIR})
if (EXISTS "${CMAKE_SOURCE_DIR}/doxygen/DoxyfileLts.in")
ADD_DOXYGEN_TARGET(Lts ${CMAKE_SOURCE_DIR}/doxygen/DoxyfileLts.in ${CMAKE_BINARY_DIR}/DoxyfileLts
${CMAKE_SOURCE_DIR}/doxygen/rheinmetall_defence_logo.jpg
${DOXYGEN_OUT_DIR})
else()
message(WARNING "Doxygen config ${CMAKE_SOURCE_DIR}/doxygen/DoxyfileLts.in not found; skipping ADD_DOXYGEN_TARGET(Lts)")
endif()
ADD_SUBDIRECTORY(Tools)
ADD_SUBDIRECTORY(Application)
ADD_SUBDIRECTORY(Common)
ADD_SUBDIRECTORY(DDS)
ADD_SUBDIRECTORY(Plugins)
ADD_SUBDIRECTORY(Projects)
ADD_SUBDIRECTORY(Proxies)
ADD_SUBDIRECTORY(Services)
ADD_SUBDIRECTORY(Viewer)
# Add only existing subdirectories to allow partial checkouts / incremental migration
set(LTS_SUBDIRS Tools Application Common DDS Plugins Projects Proxies Services Viewer)
foreach(dir IN LISTS LTS_SUBDIRS)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}")
ADD_SUBDIRECTORY(${dir})
else()
message(STATUS "Skipping missing Lts subdirectory: ${dir}")
endif()
endforeach()
IF (BUILD_TESTING)
ADD_SUBDIRECTORY(Tests)
+14 -6
View File
@@ -4,7 +4,7 @@
# $Author$
#
FIND_PACKAGE(RTI REQUIRED)
FIND_PACKAGE(RTI)
FIND_PACKAGE(Grantlee5 REQUIRED)
NGL_ADD_LIBRARY(ALL codegen_base SHARED
@@ -27,12 +27,20 @@ NGL_TARGET_LINK_LIBRARIES(codegen_base
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_base
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
$<TARGET_PROPERTY:RTI::nddscpp2,INTERFACE_INCLUDE_DIRECTORIES>
)
NGL_TARGET_COMPILE_DEFINITIONS(codegen_base
PUBLIC
$<TARGET_PROPERTY:RTI::nddscpp2,INTERFACE_COMPILE_DEFINITIONS>
)
# If RTI target is available, propagate its include dirs/compile defs
if (TARGET RTI::nddscpp2)
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_base
PUBLIC
$<TARGET_PROPERTY:RTI::nddscpp2,INTERFACE_INCLUDE_DIRECTORIES>
)
NGL_TARGET_COMPILE_DEFINITIONS(codegen_base
PUBLIC
$<TARGET_PROPERTY:RTI::nddscpp2,INTERFACE_COMPILE_DEFINITIONS>
)
else()
message(STATUS "RTI not found; building codegen_base without RTI include/compile definitions")
endif()
NGL_INSTALL_TARGET(codegen_base)
NGL_ADD_LIBRARY(ALL codegen_grantlee STATIC