Skip to content

Commit

Permalink
examples: mac: apply workaround for rpath on cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Fomenko, Evarist M committed Aug 13, 2020
1 parent 8186817 commit 089a877
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/CMakeLists.txt.in
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ function(maybe_configure_test name kind)
configure_file(template.vcxproj.user ${name}.vcxproj.user @ONLY)
endif()
elseif(APPLE)
# When LIBRARY_PATH is set (e.g. when using compiler env. scripts)
# cmake may stop passing `rpath` linker option. The hack below adds the
# LIBRARY_PATH to DYLD_LIBRARY_PATH to make the executable find its
# dependencies.
# TODO: the problem may be in older version of cmake (2.8.11), revisit.
set_property(${kind} ${name} PROPERTY ENVIRONMENT
"DYLD_LIBRARY_PATH=${CTESTCONFIG_PATH}:$ENV{DYLD_LIBRARY_PATH}")
"DYLD_LIBRARY_PATH=${CTESTCONFIG_PATH}:$ENV{LIBRARY_PATH}:$ENV{DYLD_LIBRARY_PATH}")
endif()
endfunction()

Expand Down

0 comments on commit 089a877

Please sign in to comment.