From 81388eedaabbfd4eead5e4542852a648118679f0 Mon Sep 17 00:00:00 2001 From: Dan Church Date: Tue, 11 Oct 2022 13:44:04 -0500 Subject: [PATCH] Use GNUInstallDirs for installation paths --- CMakeLists.txt | 9 ++++----- Source/Core/DolphinNoGUI/CMakeLists.txt | 2 +- Source/Core/DolphinQt/CMakeLists.txt | 2 +- Source/Core/DolphinTool/CMakeLists.txt | 2 +- Source/DSPTool/CMakeLists.txt | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dc09a3bb6..95c1289bfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,15 +128,14 @@ include(CheckVendoringApproved) include(DolphinCompileDefinitions) include(DolphinDisableWarningsMSVC) include(DolphinLibraryTools) +include(GNUInstallDirs) include(RemoveCompileFlag) # Enable folders for IDE set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Set up paths -set(bindir ${CMAKE_INSTALL_PREFIX}/bin CACHE PATH "bindir") -set(datadir ${CMAKE_INSTALL_PREFIX}/share/dolphin-emu CACHE PATH "datadir") -set(mandir ${CMAKE_INSTALL_PREFIX}/share/man CACHE PATH "mandir") +set(datadir ${CMAKE_INSTALL_FULL_DATADIR}/dolphin-emu CACHE PATH "datadir") add_definitions(-DDATA_DIR="${datadir}/") if(CMAKE_SYSROOT) @@ -1016,9 +1015,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD") DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) # Install manpages install(FILES Data/dolphin-emu.6 - DESTINATION ${mandir}/man6) + DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) install(FILES Data/dolphin-emu-nogui.6 - DESTINATION ${mandir}/man6) + DESTINATION ${CMAKE_INSTALL_MANDIR}/man6) endif() # packaging information diff --git a/Source/Core/DolphinNoGUI/CMakeLists.txt b/Source/Core/DolphinNoGUI/CMakeLists.txt index f21955d809..202a612b5d 100644 --- a/Source/Core/DolphinNoGUI/CMakeLists.txt +++ b/Source/Core/DolphinNoGUI/CMakeLists.txt @@ -36,5 +36,5 @@ if(USE_DISCORD_PRESENCE) endif() set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-nogui) -install(TARGETS dolphin-nogui RUNTIME DESTINATION ${bindir}) +install(TARGETS dolphin-nogui RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index a9e07afe0b..25958e4e4e 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -626,7 +626,7 @@ if(APPLE) /usr/bin/codesign -f -s "${MACOS_CODE_SIGNING_IDENTITY}" --deep --options=runtime --entitlements "${CMAKE_SOURCE_DIR}/Source/Core/DolphinQt/DolphinEmu.entitlements" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/Dolphin.app" || true) endif() else() - install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir}) + install(TARGETS dolphin-emu RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM) diff --git a/Source/Core/DolphinTool/CMakeLists.txt b/Source/Core/DolphinTool/CMakeLists.txt index 5e545225ec..fdca81a148 100644 --- a/Source/Core/DolphinTool/CMakeLists.txt +++ b/Source/Core/DolphinTool/CMakeLists.txt @@ -25,4 +25,4 @@ if(MSVC) endif() set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} dolphin-tool) -install(TARGETS dolphin-tool RUNTIME DESTINATION ${bindir}) +install(TARGETS dolphin-tool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/Source/DSPTool/CMakeLists.txt b/Source/DSPTool/CMakeLists.txt index 56fbee9e01..7656bc8ce6 100644 --- a/Source/DSPTool/CMakeLists.txt +++ b/Source/DSPTool/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(dsptool DSPTool.cpp StubHost.cpp) target_link_libraries(dsptool core) if(NOT APPLE) - install(TARGETS dsptool RUNTIME DESTINATION ${bindir}) + install(TARGETS dsptool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif()