diff --git a/CMakeLists.txt b/CMakeLists.txt index 17efd25b..b887b68e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,11 +211,10 @@ else() endif(ENABLE_RTI) if(ENABLE_CYCLONE) - if (NOT TARGET CycloneDDS::ddsc) - find_package(CycloneDDS QUIET) - endif() + find_package(CycloneDDS QUIET) 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) diff --git a/SimGearConfig.cmake.in b/SimGearConfig.cmake.in index 1394f73c..fa1007cc 100644 --- a/SimGearConfig.cmake.in +++ b/SimGearConfig.cmake.in @@ -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) diff --git a/simgear/CMakeLists.txt b/simgear/CMakeLists.txt index 9ad1dd5e..249d6b42 100644 --- a/simgear/CMakeLists.txt +++ b/simgear/CMakeLists.txt @@ -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_link_libraries(SimGearCore PRIVATE PkgConfig::RTI)