exiv2/cmake/mainSetup.cmake
Luis Diaz Mas 17ad919ec2 CMake: Add RPATH configuration for Linux/Solaris
Note that this RPATH setup is following a recommendation from the CMake
documentation:
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling#recommendations
2018-08-17 10:28:08 +02:00

23 lines
704 B
CMake

# In this file we configure some CMake settings we do not want to make visible directly in the main
# CMakeLists.txt file.
include(GNUInstallDirs)
include(CheckFunctionExists)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
if (UNIX)
if (APPLE)
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_INSTALL_RPATH "@loader_path")
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
endif()