Skip to content

Commit

Permalink
Set BUILD_RPATH relative to build directory to ensure portable builds
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin committed Oct 22, 2024
1 parent 7b55b73 commit f110374
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/Spt3gIncludes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ macro(add_spt3g_library lib_name)
file(REMOVE ${SPT3G_MODULE_DIR}/libspt3g-${lib_name}.dylib)
list(APPEND SPT3G_LIBRARIES ${lib_name})
set(SPT3G_LIBRARIES ${SPT3G_LIBRARIES} PARENT_SCOPE)
set_target_properties(${lib_name} PROPERTIES BUILD_RPATH "\$ORIGIN")
install(TARGETS ${lib_name} EXPORT ${PROJECT_NAME}Config LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endmacro(add_spt3g_library lib_name)

Expand All @@ -65,6 +66,7 @@ macro(add_spt3g_module lib_name)
endif()
target_link_libraries(${mod_name} PUBLIC ${lib_name})
set_target_properties(${mod_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${SPT3G_MODULE_DIR})
set_target_properties(${mod_name} PROPERTIES BUILD_RPATH "\$ORIGIN/../lib")
endmacro(add_spt3g_module lib_name)

macro(add_spt3g_test test_name)
Expand Down

0 comments on commit f110374

Please sign in to comment.