File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,27 @@ set(CMAKE_CUDA_STANDARD 20)
1111set (CMAKE_CUDA_STANDARD_REQUIRED ON )
1212# ------------------
1313
14+ # --- Universal RPATH policy ---
15+ # Don't skip RPATH when installing, but don't hardcode build dirs either
16+ set (CMAKE_SKIP_BUILD_RPATH FALSE )
17+ set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
18+ # When building, allow local RPATH so binaries work in build tree
19+ set (CMAKE_BUILD_RPATH_USE_ORIGIN TRUE )
20+ # Prefer relative RPATHs (avoids absolute /build/ paths)
21+ set (CMAKE_BUILD_RPATH "$ORIGIN/../lib" )
22+ # When installing, make binaries relocatable
23+ set (CMAKE_INSTALL_RPATH "$ORIGIN/../lib" )
24+ # Don’t automatically include system dirs in RPATH (avoid pollution)
25+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE )
26+ # CMake policies (for modern behavior)
27+ if (POLICY CMP0068)
28+ cmake_policy (SET CMP0068 NEW) # RPATH settings apply to install
29+ endif ()
30+ if (POLICY CMP0072)
31+ cmake_policy (SET CMP0072 NEW) # Prefer config mode find_package for OpenGL
32+ endif ()
33+ # ------------------
34+
1435# ---- Options ----
1536option (RAYX_WERROR "add -Werror option. Warning will be treated as errors." OFF ) # inactive per default
1637if (RAYX_WERROR)
You can’t perform that action at this time.
0 commit comments