Skip to content

Commit 0f2ad6f

Browse files
authored
Add the RPATH within the CMake setup. (p4lang#69)
Signed-off-by: fruffy <fruffy@nyu.edu>
1 parent e27b34b commit 0f2ad6f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
4848
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib")
4949
set(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
5050

51+
# Relative RPATH setup.
52+
list(APPEND CMAKE_INSTALL_RPATH $ORIGIN/../lib)
53+
set(CMAKE_SKIP_BUILD_RPATH FALSE) # Keep RPATH in build tree
54+
set(CMAKE_SKIP_INSTALL_RPATH FALSE) # Keep RPATH when installing
55+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # Append linker paths to RPATH
5156

5257
# p4 specific options
5358
option(TOFINO "Architecture: Build P4 for tofino" OFF)

0 commit comments

Comments
 (0)