From c5a034a6b5218ebc9f7eb38387c9d91fa3e4134d Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Mon, 22 Mar 2021 15:38:36 +0200 Subject: 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. --- kde-modules/KDESetupPrefixScript.cmake | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 kde-modules/KDESetupPrefixScript.cmake (limited to 'kde-modules/KDESetupPrefixScript.cmake') 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 +# SPDX-FileCopyrightText: 2013 Stephen Kelly +# SPDX-FileCopyrightText: 2012 David Faure +# SPDX-FileCopyrightText: 2007 Matthias Kretz +# SPDX-FileCopyrightText: 2006-2007 Laurent Montel +# SPDX-FileCopyrightText: 2006-2013 Alex Neundorf +# +# 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() -- cgit v1.2.1