forked from qt-creator/qt-creator
CMakePM: Add support for configure CMake presets
This patchset will add support for version 1 of the CMakePresets feature that has been implemented in CMake 3.19 https://cmake.org/cmake/help/v3.19/manual/cmake-presets.7.html The tests/manual/cmakepresets contains a manual test example for this feature. Task-number: QTCREATORBUG-24555 Change-Id: I93aba1ab4f090613d0b21d970b5b651d12c922af Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
46
src/plugins/cmakeprojectmanager/presetsmacros.h
Normal file
46
src/plugins/cmakeprojectmanager/presetsmacros.h
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utils/environmentfwd.h>
|
||||
|
||||
namespace Utils {
|
||||
class Environment;
|
||||
class FilePath;
|
||||
}
|
||||
|
||||
namespace CMakeProjectManager::Internal {
|
||||
|
||||
namespace PresetsDetails {
|
||||
class ConfigurePreset;
|
||||
}
|
||||
|
||||
namespace CMakePresets::Macros {
|
||||
/**
|
||||
* Expands the CMakePresets Macros using Utils::Environment as target and source for parent environment values.
|
||||
* $penv{PATH} is taken from Utils::Environment
|
||||
*/
|
||||
void expand(const PresetsDetails::ConfigurePreset &configurePreset,
|
||||
Utils::Environment &env,
|
||||
const Utils::FilePath &sourceDirectory);
|
||||
|
||||
/**
|
||||
* Expands the CMakePresets Macros using Utils::Environment as target
|
||||
* $penv{PATH} is replaced with Qt Creator macros ${PATH}
|
||||
*/
|
||||
void expand(const PresetsDetails::ConfigurePreset &configurePreset,
|
||||
Utils::EnvironmentItems &envItems,
|
||||
const Utils::FilePath &sourceDirectory);
|
||||
|
||||
/**
|
||||
* Expands the CMakePresets macros inside the @value QString parameter.
|
||||
*/
|
||||
void expand(const PresetsDetails::ConfigurePreset &configurePreset,
|
||||
const Utils::Environment &env,
|
||||
const Utils::FilePath &sourceDirectory,
|
||||
QString &value);
|
||||
|
||||
} // namespace CMakePresets::Macros
|
||||
|
||||
} // namespace CMakeProjectManager::Internal
|
||||
Reference in New Issue
Block a user