The Batch Edit dialog is offering the ability to use expanded
variables, but these variables were not expanded upon acceptance.
For the CMake command line they were expanded, but there was a
conflict between what the settings dialog as value had and what
CMake returned via file-api.
Change-Id: Ia4a64e99676c43f7b182e059f9051393aa184c19
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
CMake is setting the UNINITIALIZED type if you forget to set the
type of a variable when you do it from command line.
Qt Creator was setting INTERNAL, which had the effect of not
being displayed in the UI at all, giving the impression that the
value has been dropped.
Change-Id: I9a6b487bf5062d288365938fd7ef99b49de42884
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Since CMake's file-api cache is the only source of truth for
CMake configuration, there is no need to keep track of such
a state.
Qt Creator will issue -D<var>=<value> -U<var> command line
parameters for CMake, which will update the file api json files.
Change-Id: I08e7041a95422549502eb7961f96570225e942fa
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In the context menu of the CMake variables there is now a "Copy"
entry that will copy to clipboard the -D<var>:<typ>=<val> or -U<var>
values.
Task-number: QTCREATORBUG-22482
Fixes: QTCREATORBUG-24781
Change-Id: Iaa70e64fd0593398732ccb8d9036571b308b5f12
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
For the initial CMake parameters one can have an edit dialog. Now it's
possible to batch edit variables also after the project has been
configured.
Change-Id: I406b8e7db16147032a75c82fddf9b7acec85c4bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
CMake's fileapi functionality will save the project structure in json
files in the .cmake/api/v1/reply directory.
When issuing a cmake command with -D variables CMake will update its
CMakeCache.txt file even if cmake will fail.
This commit will rename .cmake/api/v1/reply as .cmake/api/v1/reply.prev
and make a copy of CMakeCache.txt before starting CMake, and if
something fails, replace the existing files with the previous values.
Also make sure the changed values are not dissappearing when the
old .cmake/api/v1/reply gets parsed.
Fixes: QTCREATORBUG-24593
Change-Id: I82141786fea7068699e0f761a8978ba1f3203e47
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Adds the signing settings to iOS configurations.
Adds placeholders for signing flags to the initial CMake arguments, and
updates the CMake configuration when signing settings change.
The new configuration doesn't get automatically applied. Only the "Apply
Configuration Changes" button gets enabled and the user has to press
that explicitly. This seems to be a more general issue affecting the QML
debugging setting too, though.
Task-number: QTCREATORBUG-23574
Change-Id: I3e8d45f565347e1ad2ac274a21b1552f1510e8f4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The next baby step towards full aspectification. Ultimate goal is
to dissolve CMakeBuildSettingswidget completely.
Change-Id: Idb2bb852d1010f69f11ec8ca87c4695361a38b83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
For Qt6/iOS we need to use the Xcode generator, and set
CMAKE_OSX_SYSROOT, CMAKE_OSX_ARCHITECTURES, and the Qt toolchain file
with CMAKE_TOOLCHAIN_FILE.
We also may not automatically add the CMAKE_SYSROOT and
CMAKE_C(XX)_COMPILER_TARGET variables, since this is handled differently
for iOS targets.
With this building, running and debugging on the simulator works, if the
CMake project correctly sets up a MACOSX_BUNDLE_GUI_IDENTIFIER,
MACOSX_BUNDLE_BUNDLE_VERSION, MACOSX_BUNDLE_SHORT_VERSION_STRING and
MACOSX_BUNDLE_LONG_VERSION_STRING.
For the device build the signing and provisioning details are still
missing.
Task-number: QTCREATORBUG-23574
Change-Id: I12be0d102b57d834d7cae06c87842638f693c087
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
CMake has multi-config generators like:
* Visual Studio
* Xcode
* Ninja Multi-Config
The first two have different special targets for "all", "install",
"package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE",
"RUN_TESTS".
All of them need to get the build type passed via "--config <build-
type>" and not via "CMAKE_BUILD_TYPE".
The multi-config generators will use only one build directory.
Fixes: QTCREATORBUG-24984
Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The CMakeCache.txt file has CMAKE_HOME_DIRECTORY pointing to the
project source directory used to configure the project.
When importing a cmake build the CMAKE_HOME_DIRECTORY from
CMakeCache.txt might not point to the same CMakeLists.txt that was
opened as a project.
qt-cmake-standalone-test from Qt6 uses a CMake template project which
does a add_subdirectory with the test source directory, which will not
work if opened standalone.
Normally this is a user error though, so ask the user if this was
intended, before actually importing the build.
Task-number: QTBUG-88776
Change-Id: Ifdd5e1d1cb8a1ef9955d22493eba3a1a55dc689f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
When changing a build configuration's build directory to a directory
with an existing build (i.e. CMakeCache.txt), do not overwrite it, but
just parse it (running CMake as needed to generate the fileapi
response). Do not ask funny questions in that case.
This solves the pattern that you want to use some preconfigured build
but configured the right kit already with the default parameters.
Switching to a different build directory should simply never "kill"
an existing build in any case (and running CMake with the
"initial arguments" basically kills the existing build in the
not-so-uncommon case).
Change-Id: I54ca1f14d72a11a3bfe5b09ce340b28be321f80e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Qt for Android 6.0 with CMake requires QT_HOST_PATH to be provided for
CMake to properly parse and configure the project.
Fixes: QTCREATORBUG-24660
Change-Id: Id5d77f900698ef4d19ec8e37b14e4e3234c74ea4
Reviewed-by: hjk <hjk@qt.io>
This fixes a parsing problem from CMake as it will state:
"Invalid Android STL: cxx_shared." This amends
01b0d4f8f5
Change-Id: I315d36eac889ba53d76055814c6b43a453e1e2f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For convenience, and use it in some places.
Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Introduce bool QtSupport::supportsMultipleQtAbis().
Let AndroidQtVersion respond according to the QVersionNumber.
This allows to replace the version arithmetics in several
places with straight forward (and better findable) function calls.
Task-number: QTCREATORBUG-24471
Change-Id: Ib6e39fd6485a54e08ad66f84d4e2582989043419
Reviewed-by: hjk <hjk@qt.io>
Avoiding string duplication prevents typo-related runtime errors and
allows an IDE to use find symbol rather than plain text search.
Change-Id: I7fba7c7c5cf90c0b371efce3b575537b2708dd0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
It wasn't possible to change the build directory if the old directory
didn't already contain a build.
Amends 7e6e02eb08
Change-Id: I741f6981273a4e04cceabde5b15b5ad951535ef8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Get rid of magic configuration handling in the CMakeProjectManager.
* Use CMakeCache.txt as the sole source of truth, do not keep
a shadow copy of configuration in the .user file
* Have initial CMake arguments that are easy to edit in batch
(Fixes: QTCREATORBUG-18179) used whenever no CMakeCache.txt
file is in the build directory. These allow for any thing that
can be passed to CMake on the command line.
(Fixes: QTCREATORBUG-16296)
* Ask when changes to CMake configuration were not applied
(Fixes: QTCREATORBUG-18504)
* Run cmake with arguments effecting its configuration only when
the CMake settings are changed in the UI, run CMake without any
special arguments in all other cases.
* Get rid of the confusing dialog used to keep settings in sync between
what is in CMakeCache.txt and Creator (Fixes: QTCREATORBUG-23218)
Change-Id: I26d55be7df733f084f5691ecf7d7b4352f58b8e7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
CMake supports this for a while now.
As a side effect this fixes QTCREATORBUG-23738, which was caused by the
radio button hack used to show that only one item could be selected at
a time.
Change-Id: I18cbe6c5ee3872edaf74b9d828bde1ac5bf63563
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The BuildDirManager was used to switch between different
BuildDirReaders. Now that only the FileApiReader is left, that
infrastructure is no longer needed.
Change-Id: I2d339a3407bb633cff6a8f7502b7b09094f63fef
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The build directory going to get set up either in
doInitialize or in fromMap, both using magic hidden in
BuildConfiguration itself.
Change-Id: I1aeb59f56d63f0affd50b45cc937e606af6da7b4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
For this to work, we need to make sure no parsing is triggered before
the project is fully set up. Otherwise it would be QTCREATORBUG-23816
again...
Change-Id: If81f4c6b9c82283abdaa8a635f93ebe0bcaf8159
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Makes the line edit disabled and read-only in that case.
We also need to change the custom context menu from the line edit to the
path chooser itself, because disabled widgets do not show a context
menu, but we still want to see the select & copy, and the special
items for opening explorer or terminal.
Task-number: QTCREATORBUG-23798
Change-Id: Ib653b4eaaedfbe54c614377795ddc52d21ac12c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Keep internals internal, remove some unnecessary includes, add
some that should have been there.
This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.
This patch also moves some code around that ended up being
in the wrong file.
Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Rename some constants to get a bit more consistency into the
naming scheme. I am so tiered of missing a constant due to it
not having _ in the expected places!
Change-Id: Ibb5e82ea4e25ccb559352839b96c8a64394f3085
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Only initialize the CMakeBuildSystem after the
CMakeBuildConfiguration has been fully set up. The "builddirectory"
was still pointing to the source directory, so creater configured
cmake in the source directory, leading to a useless directory being
left in the source tree that does not belong there.
Fixes: QTCREATORBUG-23816
Change-Id: I7c9b6ae1f8d999043e700cd9f2d56418c22f2abf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
I can't spell occurred:-/
Similar typos in 3rd party code (sqlite) has been left in place.
Change-Id: I7cfa9911fc434d42ce3df8e9c7ccb83dc00401e8
Reviewed-by: hjk <hjk@qt.io>
The step list names are computed separately anyway, having an
extra preamble consisting of concatenated build list names on
one line looks unnecessary.
Change-Id: If754c6363042927210dfd09c23f2f494081f8c47
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code. Plus some code cosmetics nearby.
Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
There should not be a need to have the linkQmlDebuggingLibrary Q_PROPERTY
anymore. The property is added for the benefit of the DebuggerAspect, which
can just check relevant BuildConfigurationAspect directly.
Change-Id: Ic47ca9e26911e096564fe77bd14bebe959b4f116
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>