Use the find_dependency option to parse Simgear dependencies to FlightGear

This commit is contained in:
Erik Hofman 2021-03-08 16:15:14 +01:00
parent 023364e245
commit c0205f7eb2
3 changed files with 12 additions and 3 deletions

View File

@ -211,11 +211,10 @@ else()
endif(ENABLE_RTI)
if(ENABLE_CYCLONE)
if (NOT TARGET CycloneDDS::ddsc)
find_package(CycloneDDS QUIET)
endif()
if (CycloneDDS_FOUND)
message(STATUS "Data Distribution Service support: CycloneDDS")
set(SG_HAVE_DDS 1)
else(CycloneDDS_FOUND)
message(STATUS "Data Distribution Service support: DISBLED")
endif(CycloneDDS_FOUND)

View File

@ -17,6 +17,12 @@ set(SIMGEAR_SHARED @SIMGEAR_SHARED@)
set(ENABLE_SIMD @ENABLE_SIMD@)
# SycloneDDS support
set(SG_HAVE_DDS @SG_HAVE_DDS@)
if(SG_HAVE_DDS)
find_dependency(CycloneDDS)
endif()
# OpenRTI support
set(ENABLE_RTI @ENABLE_RTI@)
if(ENABLE_RTI)

View File

@ -131,6 +131,10 @@ install(TARGETS SimGearCore
# we expose ZLib in some of our headers
target_link_libraries(SimGearCore PUBLIC ZLIB::ZLIB)
if (SG_HAVE_DDS)
target_link_libraries(SimGearCore PRIVATE CycloneDDS::ddsc)
endif()
if (ENABLE_RTI)
target_sources(SimGearCore PRIVATE $<TARGET_OBJECTS:rti> $<TARGET_OBJECTS:rti13>)
target_link_libraries(SimGearCore PRIVATE PkgConfig::RTI)