X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=8af98b10977a7fa8f33e695a2d606af944da4eb3;hp=e4f5d617b985b9eb83ba9027925868cf232eeccd;hb=f9cd845a9119e0abf450a91d8802f5c1822dd638;hpb=bad087a1b604c92c7c0bf3cf818b81d26e15c1c4 diff --git a/CMakeLists.txt b/CMakeLists.txt index e4f5d617..8af98b10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -388,6 +388,31 @@ endif() # This needs to come after setting up KDE integration, so we can use KDE-specific paths include(QuasselInstallDirs) +# RPATH and output settings +##################################################################### + +# Build artifacts in a well-known location; especially important for Windows DLLs +# (which go into RUNTIME_OUTPUT_DIRECTORY and can thus be found by executables) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + +# These RPATH settings allow for running directly from the build dir +set(CMAKE_SKIP_BUILD_RPATH FALSE) +set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE ) + +# Set install RPATH only if libdir isn't a system directory +if (IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}") + set(libdir "${CMAKE_INSTALL_LIBDIR}") +else() + set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +endif() +list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${libdir}" is_systemdir) +if ("${is_systemdir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${libdir}") +endif() + # Various config-dependent checks and settings ##################################################################### @@ -468,7 +493,6 @@ add_subdirectory(icons) add_subdirectory(pics) add_subdirectory(po) - # Set up and display feature summary #####################################################################