diff --git a/plotjuggler_plugins/ParserROS/CMakeLists.txt b/plotjuggler_plugins/ParserROS/CMakeLists.txt index d2641716a..2e907b1c2 100644 --- a/plotjuggler_plugins/ParserROS/CMakeLists.txt +++ b/plotjuggler_plugins/ParserROS/CMakeLists.txt @@ -3,6 +3,21 @@ add_definitions(${QT_DEFINITIONS}) add_definitions(-DQT_PLUGIN) SET(INTROSPECTION_TESTS OFF CACHE BOOL "Compile the tests") + +# Check if default fastCdr library generation is needed +find_package(fastcdr QUIET) + +if(NOT fastcdr_FOUND ) + message(STATUS "[FastCdr] not found, create shared libraries") + # Override Fast-CDR option: compile as static lib + SET(BUILD_SHARED_LIBS OFF CACHE BOOL "Create shared libraries by default") + add_subdirectory(rosx_introspection/3rdparty/Fast-CDR) + include_directories(rosx_introspection/3rdparty/Fast-CDR/include) +else() + # Mention that FastCdr has been found on system + message(STATUS "[FastCdr] found, version: ${fastcdr_VERSION}") +endif() + add_subdirectory(rosx_introspection) include_directories( rosx_introspection/include ) diff --git a/plotjuggler_plugins/ParserROS/rosx_introspection/CMakeLists.txt b/plotjuggler_plugins/ParserROS/rosx_introspection/CMakeLists.txt index b39ae9412..b645348d6 100644 --- a/plotjuggler_plugins/ParserROS/rosx_introspection/CMakeLists.txt +++ b/plotjuggler_plugins/ParserROS/rosx_introspection/CMakeLists.txt @@ -9,15 +9,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -find_package(fastcdr QUIET) - -if(NOT fastcdr_FOUND ) - # Override Fast-CDR option: compile as static lib - SET(BUILD_SHARED_LIBS OFF CACHE BOOL "Create shared libraries by default") - add_subdirectory(3rdparty/Fast-CDR) - include_directories(3rdparty/Fast-CDR/include) -endif() - ############################################### ## Declare a C++ library ###############################################