cmake: robustly locate RTI libraries via recursive search under RTI_DIR

This commit is contained in:
Copilot authored and Torsten Wierschin committed 2026-07-20 12:49:37 +02:00
1 parent 265f69886e
commit 2a3bfb7aea
1 file changed
+14 -4
+14 -4
View File
@@ -145,10 +145,20 @@ INCLUDE(FindLibraryWithDebug)
INCLUDE(FindPackageHandleStandardArgs)
SET(_RTI_LIBS nddscore nddsc nddscpp2 rtiroutingservice)
SET(_libs "")
SET(_lib_vars "")
SET(_RTI_LIBS nddscore nddsc nddscpp2 rtiroutingservice)
SET(_libs "")
SET(_lib_vars "")
# Try recursive search for RTI libraries under RTI_DIR to handle vendor arch subdirs (e.g. x64Linux4gcc8.5.0)
foreach(_lib IN LISTS _RTI_LIBS)
file(GLOB_RECURSE _found_libs "${RTI_DIR}/lib/**/lib${_lib}.*")
list(LENGTH _found_libs _found_count)
if(_found_count GREATER 0)
list(GET _found_libs 0 _first)
set("RTI_${_lib}_LIBRARY" "${_first}" CACHE STRING "RTI library ${_lib}" FORCE)
endif()
endforeach()
FOREACH(_lib ${_RTI_LIBS})
SET(_libname "RTI_${_lib}_LIBRARY")
IF (NOT ${_libname})