diff options
author | Volker Krause <vkrause@kde.org> | 2021-03-22 15:38:36 +0200 |
---|---|---|
committer | David Faure <faure@kde.org> | 2021-11-23 17:22:51 +0100 |
commit | c5a034a6b5218ebc9f7eb38387c9d91fa3e4134d (patch) | |
tree | 9eb80f208475098fc883e5a2fd28478caf67f73d /kde-modules/KDESetupPrefixScript.cmake | |
parent | aa219585ffdf8962c0b1087848b18fef8b6206b7 (diff) | |
download | extra-cmake-modules-c5a034a6b5218ebc9f7eb38387c9d91fa3e4134d.tar.gz extra-cmake-modules-c5a034a6b5218ebc9f7eb38387c9d91fa3e4134d.tar.bz2 |
Split KDEInstallDirs into a 5 and a 6 variant
This factors out large parts of the common code into separate modules,
and adds a backward compatibility wrapper.
The 6 variant drops some deprecated variables where possible, but otherwise
is the same as the 5 variant. It still lacks a replacement for the paths
depending on ECMQueryQMake though.
Diffstat (limited to 'kde-modules/KDESetupPrefixScript.cmake')
-rw-r--r-- | kde-modules/KDESetupPrefixScript.cmake | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kde-modules/KDESetupPrefixScript.cmake b/kde-modules/KDESetupPrefixScript.cmake new file mode 100644 index 00000000..31da2683 --- /dev/null +++ b/kde-modules/KDESetupPrefixScript.cmake @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2014-2015 Alex Merry <alex.merry@kde.org> +# SPDX-FileCopyrightText: 2013 Stephen Kelly <steveire@gmail.com> +# SPDX-FileCopyrightText: 2012 David Faure <faure@kde.org> +# SPDX-FileCopyrightText: 2007 Matthias Kretz <kretz@kde.org> +# SPDX-FileCopyrightText: 2006-2007 Laurent Montel <montel@kde.org> +# SPDX-FileCopyrightText: 2006-2013 Alex Neundorf <neundorf@kde.org> +# +# SPDX-License-Identifier: BSD-3-Clause +# +# Prefix script setup code shared between KDEInstallDirsX.cmake, not public API. +# + +configure_file(${CMAKE_CURRENT_LIST_DIR}/prefix.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh @ONLY) + +find_program(FISH_EXECUTABLE fish) +if(FISH_EXECUTABLE) + configure_file(${CMAKE_CURRENT_LIST_DIR}/prefix.sh.fish.cmake ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh.fish @ONLY) +endif() + +option(KDE_INSTALL_PREFIX_SCRIPT "Installs ${CMAKE_INSTALL_PREFIX}/prefix.sh that sets up the necessary environment variables" OFF) +if(KDE_INSTALL_PREFIX_SCRIPT) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh DESTINATION ${CMAKE_INSTALL_PREFIX} PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ) +endif() + +if(NOT KDE_INSTALL_USE_QT_SYS_PATHS) + message("Installing in ${CMAKE_INSTALL_PREFIX}. Run ${CMAKE_CURRENT_BINARY_DIR}/prefix.sh to set the environment for ${CMAKE_PROJECT_NAME}.") +endif() |