forked from qt-creator/qt-creator
CMakeProjectManager: Add package manager auto-setup
Adds CMAKE_PROJECT_INCLUDE_BEFORE as initial CMake parameters with a path to a auto-setup.cmake script that will run conan install if a conanfile.txt is found in the prject. A project can have a local QtCreatorPackageManager.cmake file that will be loaded if exists. The auto setup can be controlled via the following CMake variables: * QT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP * QT_CREATOR_SKIP_CONAN_SETUP * QT_CREATOR_SKIP_VCPKG_SETUP conan.cmake is taken from https://github.com/conan-io/cmake-conan which takes care of the conan specific compiler cruft. License is MIT. Fixes: QTCREATORBUG-25362 Change-Id: I70a6e1abc5600851d048f1590ca24204ce52a503 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
#include "cmakeconfigitem.h"
|
||||
#include "cmakekitinformation.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeprojectplugin.h"
|
||||
#include "cmakespecificsettings.h"
|
||||
#include "configmodel.h"
|
||||
#include "configmodelitemdelegate.h"
|
||||
|
||||
@@ -674,6 +676,14 @@ static QStringList defaultInitialCMakeArguments(const Kit *k, const QString buil
|
||||
initialArgs.append(QString::fromLatin1("-DCMAKE_BUILD_TYPE:String=%1").arg(buildType));
|
||||
}
|
||||
|
||||
Internal::CMakeSpecificSettings *settings
|
||||
= Internal::CMakeProjectPlugin::projectTypeSpecificSettings();
|
||||
|
||||
// Package manager
|
||||
if (settings->packageManagerAutoSetup())
|
||||
initialArgs.append(QString::fromLatin1("-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%1")
|
||||
.arg("%{IDE:ResourcePath}/package-manager/auto-setup.cmake"));
|
||||
|
||||
// Cross-compilation settings:
|
||||
if (!isIos(k)) { // iOS handles this differently
|
||||
const QString sysRoot = SysRootKitAspect::sysRoot(k).toString();
|
||||
|
||||
Reference in New Issue
Block a user