File indexing completed on 2024-05-05 04:39:24

0001 /*
0002     SPDX-FileCopyrightText: 2020 Igor Kushnir <igorkuo@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <interfaces/icore.h>
0010 #include <interfaces/iruntime.h>
0011 #include <interfaces/iruntimecontroller.h>
0012 
0013 #include <QByteArray>
0014 #include <QString>
0015 
0016 namespace Config
0017 {
0018 namespace Old
0019 {
0020 inline constexpr const char* projectRootRelativeKey = "ProjectRootRelative";
0021 }
0022 
0023 inline QString globalBuildDirIndexKey() { return QStringLiteral("Current Build Directory Index"); }
0024 inline constexpr const char* buildDirOverrideIndexKey = "Temporary Build Directory Index";
0025 inline constexpr const char* buildDirCountKey = "Build Directory Count";
0026 
0027 //the used builddir will change for every runtime
0028 inline QString buildDirIndexKey()
0029 {
0030     const QString currentRuntime = KDevelop::ICore::self()->runtimeController()->currentRuntime()->name();
0031     return globalBuildDirIndexKey() + QLatin1Char('-') + currentRuntime;
0032 }
0033 
0034 namespace Specific
0035 {
0036 inline constexpr const char* buildDirPathKey = "Build Directory Path";
0037 // TODO: migrate to more generic & consistent key term "CMake Executable"
0038 // Support the old "CMake Binary" key too for backwards compatibility during
0039 // a reasonable transition period. Both keys are saved at least until 5.2.0
0040 // is released. Import support for the old key will need to remain for a
0041 // considerably longer period, ideally.
0042 inline constexpr const char* cmakeBinaryKey = "CMake Binary";
0043 inline constexpr const char* cmakeExecutableKey = "CMake Executable";
0044 inline constexpr const char* cmakeBuildTypeKey = "Build Type";
0045 inline constexpr const char* cmakeInstallDirKey = "Install Directory";
0046 inline constexpr const char* cmakeEnvironmentKey = "Environment Profile";
0047 inline constexpr const char* cmakeArgumentsKey = "Extra Arguments";
0048 inline constexpr const char* buildDirRuntime = "Runtime";
0049 }
0050 
0051 inline QByteArray groupNameBuildDir(int buildDirIndex)
0052 {
0053     return QByteArrayLiteral("CMake Build Directory ") + QByteArray::number(buildDirIndex);
0054 }
0055 
0056 inline constexpr const char* groupName = "CMake";
0057 
0058 } // namespace Config