Skip to content

Commit

Permalink
Moved find fastcdr to parent CMakeList
Browse files Browse the repository at this point in the history
Moved up findCdr or build default library so that cmake does not fail
before building when fastCdr is installed on system.
Added message so that user knows when fastCdr is found on its system.

Issue:
[facontidavide#919]
Co-authored-by: manuelValch
  • Loading branch information
manuelValch authored and manuelValch committed Feb 6, 2024
1 parent 04b0619 commit 833e563
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
14 changes: 14 additions & 0 deletions plotjuggler_plugins/ParserROS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ 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 )
# 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)
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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
###############################################
Expand Down

0 comments on commit 833e563

Please sign in to comment.