CMake: Set CMAKE_RUNTIME_OUTPUT_DIRECTORY based on CMAKE_INSTALL_BINDIR

Instead of hardcoding bin/, we should use the INSTALL_BINDIR directly
to reflect the intent of the way we're doing the settings.

This should have the benefit of fixing the build when a distro sets the
GNUInstallDirs variables to exciting values, like on NixOS.
This commit is contained in:
Andrew Kaster 2023-08-12 18:21:38 -06:00
parent aa741a1544
commit a0a1411ec9
Notes: sideshowbarker 2024-07-17 05:05:51 +09:00

View file

@ -80,7 +80,7 @@ include(GNUInstallDirs) # make sure to include before we mess w/RPATH
# Mirror the structure of the installed tree to ensure that rpaths
# always remain valid.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")