Skip to content

Commit

Permalink
If tbb >= 2021 add TBB::tbb to GAZEBO_LIBRARIES for downstream users
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro committed Feb 15, 2022
1 parent 6903800 commit 73db7c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/SearchForStuff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ if (PKG_CONFIG_FOUND)
endif(tbb_library)
endif (NOT TBB_FOUND)
endif (NOT TBB_FOUND)
set(HAVE_TBB_GREATER_OR_EQUAL_2021 OFF)
if (DEFINED TBB_VERSION)
if (${TBB_VERSION} VERSION_GREATER_EQUAL "2021.0")
set(HAVE_TBB_GREATER_OR_EQUAL_2021 ON)
endif()
endif()

#################################################
# Find OGRE
Expand Down
8 changes: 8 additions & 0 deletions cmake/gazebo-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,11 @@ list(APPEND @PKG_NAME@_LIBRARIES ${IGNITION-FUEL_TOOLS_LIBRARIES})
list(APPEND @PKG_NAME@_LDFLAGS -Wl,-rpath,${GAZEBO_INSTALL_LIB_DIR}/gazebo-@GAZEBO_MAJOR_VERSION@/plugins)
list(APPEND @PKG_NAME@_LDFLAGS -L${GAZEBO_INSTALL_LIB_DIR})
list(APPEND @PKG_NAME@_LDFLAGS -L${GAZEBO_INSTALL_LIB_DIR}/gazebo-@GAZEBO_MAJOR_VERSION@/plugins)

set (GAZEBO_HAS_TBB_GREATER_OR_EQUAL_2021 @HAVE_TBB_GREATER_OR_EQUAL_2021@)
if (GAZEBO_HAS_TBB_GREATER_OR_EQUAL_2021)
find_package(TBB CONFIG)
if (TARGET tbb::tbb)
list(APPEND @PKG_NAME@_LIBRARIES TBB::tbb)
endif ()
endif ()

0 comments on commit 73db7c7

Please sign in to comment.