diff --git a/CMakeLists.txt b/CMakeLists.txt index 0db849796..3c5eb068f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,11 @@ include (CTest) enable_testing() +############################################################################### +# Provides install directory variables as defined by the GNU Coding Standards. +include(GNUInstallDirs) + + ############################################################################### # Forbid in-source build. diff --git a/share/cmake/utils/CompilerFlags.cmake b/share/cmake/utils/CompilerFlags.cmake index 34c2a7bfd..1fe5591c3 100644 --- a/share/cmake/utils/CompilerFlags.cmake +++ b/share/cmake/utils/CompilerFlags.cmake @@ -98,8 +98,8 @@ if (UNIX AND NOT CMAKE_SKIP_RPATH) # (i.e. a binary loading a dynamic library) and then from the current directory # (i.e. dynamic library loading another dynamic library). if (APPLE) - set(CMAKE_INSTALL_RPATH "@loader_path/../lib;@loader_path") + set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR};@loader_path") else() - set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib;$ORIGIN") + set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR};$ORIGIN") endif() endif() diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index 31e40962a..fc6e6471a 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -173,8 +173,6 @@ if(NOT WIN32) # Install the pkg-config file. - include(GNUInstallDirs) - set(prefix ${CMAKE_INSTALL_PREFIX}) set(exec_prefix "\${prefix}") set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")