Skip to content

Commit

Permalink
Added cmake option BUILD_WITH_RPATH_NOT_RUNPATH to use old RPATH beha…
Browse files Browse the repository at this point in the history
…vior on build tree (#1308)
  • Loading branch information
matlabbe committed Aug 26, 2024
1 parent 4df207a commit f73e9c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ option(PCL_OMP "With PCL OMP implementations" OFF)
ELSE()
option(PCL_OMP "With PCL OMP implementations" ON)
ENDIF()
option(BUILD_WITH_RPATH_NOT_RUNPATH "Explicitly disable usage of RUNPATH for the build tree on linux systems by adding --disable-new-dtags to linker (using old RPATH behavior instead)" OFF)

set(RTABMAP_QT_VERSION AUTO CACHE STRING "Force a specific Qt version.")
set_property(CACHE RTABMAP_QT_VERSION PROPERTY STRINGS AUTO 4 5 6)
Expand Down Expand Up @@ -806,6 +807,11 @@ IF(WITH_ORB_SLAM AND NOT G2O_FOUND)
ENDIF(ORB_SLAM_FOUND)
ENDIF(WITH_ORB_SLAM AND NOT G2O_FOUND)

SET(DISABLE_NEW_DTAGS_FLAG "--disable-new-dtags")
IF(NOT (APPLE OR WIN32) AND BUILD_WITH_RPATH_NOT_RUNPATH)
ADD_LINK_OPTIONS(LINKER:${DISABLE_NEW_DTAGS_FLAG})
ENDIF()

IF(NOT MSVC)
IF(Qt6_FOUND OR (G2O_FOUND AND G2O_CPP11 EQUAL 1) OR TORCH_FOUND)
# Qt6 requires c++17
Expand Down Expand Up @@ -1304,6 +1310,9 @@ IF(APPLE OR WIN32)
MESSAGE(STATUS " BUILD_AS_BUNDLE = ${BUILD_AS_BUNDLE}")
ENDIF(APPLE OR WIN32)
MESSAGE(STATUS " CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
IF(NOT (APPLE OR WIN32) AND BUILD_WITH_RPATH_NOT_RUNPATH)
MESSAGE(STATUS " LINKER FLAGS = ${DISABLE_NEW_DTAGS_FLAG}")
ENDIF()
MESSAGE(STATUS " FLANN_KDTREE_MEM_OPT = ${FLANN_KDTREE_MEM_OPT}")
MESSAGE(STATUS " PCL_DEFINITIONS = ${PCL_DEFINITIONS}")
MESSAGE(STATUS " PCL_VERSION = ${PCL_VERSION}")
Expand Down

0 comments on commit f73e9c0

Please sign in to comment.