By default, "cmake" seems to strip "rpath" settings from executables. This breaks things. This patch is an attempt to fix the problem. --- cmake-3.9.3.old/Modules/CMakeGenericSystem.cmake +++ cmake-3.9.3/Modules/CMakeGenericSystem.cmake @@ -27,7 +27,7 @@ # basically all general purpose OSs support shared libs set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) -set (CMAKE_SKIP_RPATH "NO" CACHE BOOL +set (CMAKE_SKIP_RPATH "YES" CACHE BOOL "If set, runtime paths are not added when using shared libraries.") set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL "If set, runtime paths are not added when installing shared libraries, but are added when building.")