If CMake is being triggered when C/C++ parsing is running, make sure
to cancel() the C/C++ parsing before running CMake.
The C/C++ parsing is issued after the CMake project is loaded,
so for a subsequent CMake run there is no need to have the
system busy with C/C++ parsing and at the same time run CMake.
Change-Id: Ib9a2e057a90d9572e904ff449666bb9b12d1accc
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This way projects can have access to all CMake parameters that were
issued from Qt Creator.
Previously the initial run was skipped, only the subsequent changes
were picked up.
Change-Id: I7a2262cdb9754ff666f78fd2e39663466f494f5f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The future that would trigger the result of a cmake api file parsing
would not be removed if the stop parsing would be triggered.
This could be triggered by fast switching between build configurations.
It could also lead to forever parsing states having the project's
wheel always spinning.
Fixes: QTCREATORBUG-25588
Fixes: QTCREATORBUG-25287
Change-Id: I4f92806ebdb703b4910952cd8db1e52816daf9cf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Check if asyncScanForFiles returns true, which means it added
a future, which then can be used for Core::ProgressManager::addTask
Task-number: QTCREATORBUG-24564
Change-Id: I347c027e676023a782e7d4822fe2d51385888a64
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Do not use a pattern to address tests when running selected. Instead
get their respective test number and use this.
This avoids executing unchecked test cases that match a shorter selected
one. Beside this it shortens the commandline which might be also a
benefit on Windows.
Change-Id: Ic1c0cf8eedab478564f04fb494679eca4521f402
Reviewed-by: David Schulz <david.schulz@qt.io>
add_custom_target will be set as UTILITY target, which one might
want to reference as "cm <target>" or "--target <target>".
Filter out instead the "_autogen" and "_autogen_timestamp_deps".
Fixes: QTCREATORBUG-25726
Change-Id: Ia73d6e87e4b230114d068649964792ff3f626378
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
CMake will reconfigure itself if you have modified the CMakeLists.txt
files. Qt Creator needs to reparse the file-api json structure even
if the "Auto-run CMake" is being disabled.
"Auto-run CMake" will run CMake when the project files themselves
have been changed e.g. modify and then save.
CMake will use ninja / make to reconfigure itself, generate the file-api
structure and Qt Creator needs to keep up.
Change-Id: I12d8683b86f35bd6e0ebccec5300cd7ae8dce0b2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In the build target list there is no reason to have <target>_autogen
or <target>_autogen_timestamps targets.
Also do not sort the target list, so that the special targets stay
at top (all, clean, install etc)
Change-Id: I3107150bb40d68cc95246d4d09abc300a6e3d3fc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
- use newer approach to settings page layout building
- no SHOUTING enums
- namespaces
- proper dialog parent for message
Change-Id: I7adfb7487d502b8fd706c4a0c5645f4d2153e39c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Also remove the CMakeCache.txt.prev, .cmake/api/v1/reply, and
.cmake/api/v1/reply.prev which might cause problems in
case of CMake configuration failure.
Change-Id: I24f049e5e0338b78393b68ab3680276388ffc6bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
For single configuration projects if you change the build type
aspect you will change the CMAKE_BUILD_TYPE variable.
When switching the build directory the existing CMAKE_BUILD_TYPE
will be set as build type aspect.
Fixes: QTCREATORBUG-25451
Change-Id: I13519e95c316c556cc1348fba6121637d2fd4275
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
QUL uses module mapping for theming of QtQuick.Controls: during
code-generation the compiler is pointed to the Controls implementation
it should use. This is done by rewriting any import of QtQuick.Controls
with the given module name. The CMake build scripts will write a file
for each target to the directory "qml_module_mappings" in the build dir,
and those files will contain the mappings used.
Fixes: QTCREATORBUG-25356
Change-Id: I3f74897836dde7717b03bd6dffa46dcc0689ffdd
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
QUL does not have separate QML import paths, but (re-)uses the include
paths for this purpose. Support this behavior by adding all include
paths to the QML import paths before handing the project information off
to the QML code model.
Change-Id: Ic2e39ab69ac27776f5070b7b8b7c66d53a83210b
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Show the CMake parameters that would be passed in a mono space font, one
option per line.
Change-Id: I462792736960b33fea669b5b753c89d21cd087fd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Although QUL has merged the QML import paths and the include paths, the
convention for C/C++ is to have the headers for a project under a
subdirectory of the include path, and do imports relative to the include
path. For example:
#include <qul/SomeHeader.h>
The QML code model doesn't know about this convention, so for the kit
has to supply an extra QML import path for this case.
Change-Id: I82d4375dd8a1f510180f81b011a715dee8c10d60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Replace the call to SynchronousProcess::run() by asynchronous
call that invokes a process.
This change may be tested by applying the additional patch
mentioned in QTCREATORBUG-25385 description.
Don't call the SynchronousProcess::run() from the main thread when
the Quit event was already scheduled for qApp, since the Quit event
will get removed from the awaiting queue by a call to
QEventLoop::exec().
Fixes: QTCREATORBUG-25385
Change-Id: I8af39552443bfa9b3af6e31ddce85a01b91bbbd8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If the use has forgotten to click "Apply Configuration Changes"
button in project settings but it tries to build or run the
project, then the "Apply Configuration Changes" dialog box pops
as a reminder.
Change-Id: I26728ee3c79af72125be3bede759620c2cf3d7a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The parameters sent to CMake are also saved as qtcsettings.cmake,
this allows Android Multi-ABI CMake projects apply the settings
for all ABIs.
This was part of 196b0da08a
Task-number: QTCREATORBUG-25183
Change-Id: I6d4f210247d5377cab855a1a051cf7aa815192c7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
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>
Qt 6.0 + CMake: The name for the Android deployment settings file needs
to be determined by using the build key of the current run configuration
rather than by using the display name of the project root node.
Since in contrast to qmake/Qbs, CMake does not supply us with the file
name and we have to contruct it ourselves. Therefore, it makes sense to
move the value into the Android plugin.
This change adds AndroidQtVersion::androidDeploymentSettings which lets
qmake and Qbs still provide the value as before while handling the CMake
fallback.
Fixes: QTCREATORBUG-25209
Change-Id: I12314d06a45d6e045cb654d9140f9d2ed4602f67
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This code path (CMakeBuildSystem::buildCMakeTarget) is taken
when building a specific target, such as when activating
Build > Build for Run Configuration. Building via e.g. Ctrl+B
takes a different code path, so this shouldn't be called more
than necessary.
Fixes: QTCREATORBUG-25276
Change-Id: I362bafda43460eaeac9cbf0f053bf457a76702f1
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>
CMake settings can avoid to create the build directory
automatically. If this is the case the ctest call fails
due to missing information that is present inside the
build directory.
In this case we need to use the temporary directory that
is used before the build directory is created.
Change-Id: Ie6581e53a671c3e5ad71474d9706285d29bd37a8
Reviewed-by: David Schulz <david.schulz@qt.io>
Fixes opening a new project without existing build folder, changing
some configuration values, and pressing apply or choosing Run CMake.
extraCMakeArguments contains the arguments needed to apply any changes
done in e.g. the CMake configuration list in projects mode.
When pressing Apply, the build directory gets created, and CMake run
with REPARSE_FORCE_INITIAL_CONFIGURATION. But we may not remove
REPARSE_FORCE_EXTRA_CONFIGURATION which might even just have been added
a few lines above after asking the user via mustApplyExtraArguments().
Amends af4e74a972
Task-number: QTCREATORBUG-24936
Change-Id: I5e5547611262490ebdebb30dc1bfc690f1cdedde
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
When opening and configuring a project, Qt Creator first tries to
configure the project in a temporary directory (if the build directory
doesn't exist anyhow). This is nice if you just open a project for
browsing, and the initial arguments are set up correctly for parsing a
project.
But if the user starts changing the configuration, either by changing
variables and applying the change, or by choosing a "QML debugging and
profiling" option, we should create the actual build directory and do
the configuration there.
Otherwise we have issues with redoing the correct configuration in the
actual build directory later on.
Fixes: QTCREATORBUG-24936
Change-Id: I54013a14f68eb7785e866cc2a9c09bbc43b44233
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>
If you have a project with subdirs, changing and saving on of the
subdirs CMakeLists.txt would just "reparse" the existing project
data again.
Instead run CMake first, so the change actually takes effect.
Change-Id: Ia2b0f8b5681f10d426229470fdc420b3234eccec
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Show an error icon in the CMake settings, and instead running CMake with
unsupported parameters show an error in the Issues pane.
Arguably it should not be possible to select an unsupported CMake
version in the kit settings at all (neither manually nor automatically
when setting up kits), but this is the less intrusive change for now.
Fixes: QTCREATORBUG-24553
Change-Id: I32caa2ce93d28cbd9db90e2004d60da93d32c68c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Gather some more information of a CMake based project to be
able to provide this later on to the AutoTest plugin.
Task-number: QTCREATORBUG-23332
Change-Id: I2beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: David Schulz <david.schulz@qt.io>
If a CMake project cannot be parsed by CMake, it is practically unusable in
Qt Creator. According to discussion in QTCREATORBUG-24677, a virtual
folder with the project's file system view is added to the project
manager as a convenience feature.
Fixes: QTCREATORBUG-24677
Change-Id: I48775bb89c704d3f7e5bb21ec6481bd5cc0f4b6c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>