Set RPATH property instead of adding a link option

This commit is contained in:
2024-05-28 19:59:24 +10:00
parent 1ef509f90f
commit 4fa31fce4e

View File

@@ -15,6 +15,6 @@ target_compile_definitions(Lesson10 PRIVATE $<$<CXX_COMPILER_ID:MSVC>:_CRT_SECUR
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
get_property(SDL3_IMPORTED_LOCATION TARGET SDL3::SDL3 PROPERTY IMPORTED_LOCATION)
if (SDL3_IMPORTED_LOCATION MATCHES "^/Library/Frameworks/")
target_link_options(Lesson10 PRIVATE -Wl,-rpath,/Library/Frameworks)
set_property(TARGET Lesson10 PROPERTY BUILD_RPATH "/Library/Frameworks")
endif()
endif()