Skip to content

Commit 70ce28b

Browse files
committed
fix(linux): set rpath property
1 parent cc2fa8f commit 70ce28b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmp_compressonatorlib/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,12 @@ endif()
129129
# TODO: More libraries should be linked like this when building so that we don't have to constantly repeat source file includes
130130
# Not just for CMP_Compressonator, do the same for the Framework and all other libraries
131131
target_link_libraries(CMP_Compressonator PUBLIC CMP_Core CMP_Framework)
132+
133+
# Set RPATH so the library can find its dependencies at runtime
134+
# // https://duerrenberger.dev/blog/2021/08/04/understanding-rpath-with-cmake/
135+
if(UNIX)
136+
set_target_properties(CMP_Compressonator PROPERTIES
137+
INSTALL_RPATH "$ORIGIN"
138+
BUILD_WITH_INSTALL_RPATH TRUE
139+
)
140+
endif()

0 commit comments

Comments
 (0)