Skip to content

Commit 9ac176b

Browse files
committed
Fix RPATH for CMake<3.16
1 parent 2a0f6ba commit 9ac176b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cmake/LSLCMake.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,18 @@ function(installLSLApp target)
7171
endif()
7272

7373
# Set runtime path, i.e. where shared libs are searched relative to the exe
74-
set(LIBDIRGENEXPR "../$<IF:$<BOOL:${LSL_UNIXFOLDERS}>,lib/,LSL/lib/>")
74+
# CMake>=3.16: set(LIBDIR "../$<IF:$<BOOL:${LSL_UNIXFOLDERS}>,lib/,LSL/lib/>")
75+
if(LSL_UNIXFOLDERS)
76+
set(LIBDIR "../lib")
77+
else()
78+
set(LIBDIR "../LSL/lib")
79+
endif()
7580
if(APPLE)
7681
set_property(TARGET ${target} APPEND
77-
PROPERTY INSTALL_RPATH "@executable_path/;@executable_path/${LIBDIRGENEXPR}")
82+
PROPERTY INSTALL_RPATH "@executable_path/;@executable_path/${LIBDIR}")
7883
elseif(UNIX)
7984
set_property(TARGET ${target}
80-
PROPERTY INSTALL_RPATH "\$ORIGIN:\$ORIGIN/${LIBDIRGENEXPR}")
85+
PROPERTY INSTALL_RPATH "\$ORIGIN:\$ORIGIN/${LIBDIR}")
8186
endif()
8287

8388
if(LSL_UNIXFOLDERS)

0 commit comments

Comments
 (0)