File tree Expand file tree Collapse file tree 5 files changed +20
-0
lines changed Expand file tree Collapse file tree 5 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ set(CMAKE_CUDA_STANDARD 20)
1111set (CMAKE_CUDA_STANDARD_REQUIRED ON )
1212# ------------------
1313
14+ # --- Prevent CMake from using absolute paths in RPATH. Use relative paths instead ---
15+ set (CMAKE_BUILD_RPATH_USE_ORIGIN TRUE )
16+ # ------------------
17+
1418# ---- Options ----
1519option (RAYX_WERROR "add -Werror option. Warning will be treated as errors." OFF ) # inactive per default
1620if (RAYX_WERROR)
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ endif()
5454
5555# ---- Project ----
5656project (rayx-core VERSION ${RAYX_VERSION} )
57+
5758file (GLOB_RECURSE SOURCE ${PROJECT_SOURCE_DIR} /src/*.cpp)
5859file (GLOB_RECURSE ALPAKA_SOURCE
5960 ${PROJECT_SOURCE_DIR} /src/Shader/*.cpp
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ enable_testing()
77set (BINARY rayx-core-tst)
88file (GLOB_RECURSE SOURCE *.h *.cpp)
99add_executable (${BINARY} ${SOURCE} )
10+ set_target_properties (${BINARY} PROPERTIES
11+ BUILD_RPATH "$ORIGIN;$ORIGIN/lib;$ORIGIN/../lib" # also $ORIGIN/../../lib/$<CONFIG> will be added automatically by CMake for multi-config generators
12+ INSTALL_RPATH "$ORIGIN;$ORIGIN/lib;$ORIGIN/../lib" # TODO: review if this is necessary
13+ )
1014add_test (NAME ${BINARY} COMMAND ${BINARY} )
1115# -----------------
1216
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ if(Vulkan_FOUND)
1919
2020 add_executable (${PROJECT_NAME} WIN32 ${SOURCE} ${IMGUI_SOURCES} )
2121
22+ set_target_properties (${PROJECT_NAME} PROPERTIES
23+ BUILD_RPATH "$ORIGIN;$ORIGIN/lib;$ORIGIN/../lib"
24+ INSTALL_RPATH "$ORIGIN;$ORIGIN/lib;$ORIGIN/../lib" # TODO: review if this is necessary
25+ )
26+
2227 if (MSVC )
2328 target_compile_options (${PROJECT_NAME} PRIVATE /W4)
2429 if (RAYX_WERROR)
Original file line number Diff line number Diff line change @@ -6,8 +6,14 @@ cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
66
77# ---- Project ----
88project (rayx VERSION ${RAYX_VERSION} )
9+
910file (GLOB_RECURSE SOURCE ${PROJECT_SOURCE_DIR} /src/*.cpp)
1011add_executable (${PROJECT_NAME} ${SOURCE} )
12+
13+ set_target_properties (${PROJECT_NAME} PROPERTIES
14+ BUILD_RPATH "$ORIGIN;$ORIGIN/lib;$ORIGIN/../lib"
15+ INSTALL_RPATH "$ORIGIN;$ORIGIN/lib;$ORIGIN/../lib" # TODO: review if this is necessary
16+ )
1117# ------------------
1218
1319
You can’t perform that action at this time.
0 commit comments