diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-06 20:20:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 20:20:48 +0100 |
commit | 9ddc5ae7bf38a26103f5d788ff2c3de72d795eae (patch) | |
tree | e47d2bf7562a313a025419f8aa6254508760c3b6 /CMakeLists.txt | |
parent | 18ea1f009082a4149d7734af50c8a5919ba128ee (diff) | |
parent | 1122ae87ef9a085ed705a6a8761c6c7ad0f5dce3 (diff) |
Merge pull request #3271 from uklotzde/cmake_install_libdir
CMake: Replace hard-coded install dirs with GNUInstallDirs
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1029e2dbfa..85b3a61e89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -979,6 +979,21 @@ target_compile_definitions(mixxx-lib PUBLIC $<$<NOT:$<CONFIG:Debug>>:NDEBUG> ) +# +# Installation directories +# +set(MIXXX_INSTALL_BINDIR ".") +set(MIXXX_INSTALL_DATADIR ".") +set(MIXXX_INSTALL_DOCDIR "./doc") +set(MIXXX_INSTALL_LICENSEDIR "./doc") +if (UNIX) + include(GNUInstallDirs) + set(MIXXX_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}") + set(MIXXX_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/mixxx") + set(MIXXX_INSTALL_DOCDIR "${CMAKE_INSTALL_DOCDIR}/mixxx") + set(MIXXX_INSTALL_LICENSEDIR "${CMAKE_INSTALL_DATADIR}/licenses/mixxx") +endif() + if(WIN32) target_compile_definitions(mixxx-lib PRIVATE __WINDOWS__) @@ -1017,9 +1032,7 @@ elseif(UNIX) else() target_compile_definitions(mixxx-lib PRIVATE __UNIX__) target_compile_definitions( - mixxx-lib PUBLIC UNIX_SHARE_PATH="${CMAKE_INSTALL_PREFIX}/share/mixxx") - target_compile_definitions( - mixxx-lib PUBLIC UNIX_LIB_PATH="${CMAKE_INSTALL_PREFIX}/lib/mixxx") + mixxx-lib PUBLIC UNIX_SHARE_PATH="${MIXXX_INSTALL_DATADIR}") if(CMAKE_SYSTEM_NAME STREQUAL Linux) target_compile_definitions(mixxx-lib PUBLIC __LINUX__) elseif(CMAKE_SYSTEM_NAME MATCHES "^.*BSD$") @@ -1036,18 +1049,6 @@ target_link_libraries(mixxx PUBLIC mixxx-lib) # Installation and Packaging # include(InstallRequiredSystemLibraries) -set(MIXXX_INSTALL_BINDIR ".") -set(MIXXX_INSTALL_DATADIR ".") -set(MIXXX_INSTALL_DOCDIR "./doc") -set(MIXXX_INSTALL_LICENSEDIR "./doc") -if (UNIX) - include(GNUInstallDirs) - set(MIXXX_INSTALL_BINDIR "${CMAKE_INSTALL_BINDIR}") - set(MIXXX_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/mixxx") - set(MIXXX_INSTALL_DOCDIR "${CMAKE_INSTALL_DOCDIR}/mixxx") - set(MIXXX_INSTALL_LICENSEDIR "${CMAKE_INSTALL_DATADIR}/licenses/mixxx") -endif() - install( TARGETS mixxx |