File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -520,9 +520,25 @@ if (UNIX AND NOT APPLE)
520
520
set (SHM_LIB -lrt )
521
521
endif ()
522
522
523
- if (APPLE )
524
- cmake_policy (SET CMP0042 OLD )
525
- endif ()
523
+ # Ensure the default behavior: don't ignore RPATH settings.
524
+ set (CMAKE_SKIP_BUILD_RPATH OFF )
525
+
526
+ # Ensure the default behavior: don't use the final install destination as the
527
+ # temporary RPATH for executables (ensure we can run tests and programs from
528
+ # the build directory).
529
+
530
+ set (CMAKE_BUILD_WITH_INSTALL_RPATH OFF )
531
+ # Include any custom library paths in the final RPATH.
532
+
533
+ set (CMAKE_INSTALL_RPATH_USE_LINK_PATH ON )
534
+ # Install libs with names like @rpath/libmongoc-1.0.0.dylib, not bare names.
535
+
536
+ set (CMAKE_MACOSX_RPATH ON )
537
+
538
+ # https://cmake.org/cmake/help/v3.11/policy/CMP0042.html
539
+ # Enable a CMake 3.0+ policy that sets CMAKE_MACOSX_RPATH by default, and
540
+ # silence a CMake 3.11 warning that the old behavior is deprecated.
541
+ cmake_policy (SET CMP0042 NEW )
526
542
527
543
if (MSVC )
528
544
add_definitions (-D_CRT_SECURE_NO_WARNINGS )
You can’t perform that action at this time.
0 commit comments