Each call of CppModelManager::updateSourceFiles detaches the current
snapshot.
The extra compilers where set up and triggered individually, and
resulted in individual updateSourceFiles calls with the single result
file of the extra compiler. For Qt Creator this would lead to 200
calls in quick succession after project load, potentially leading to a
freeze of multiple seconds.
Instead of updating the result files of the extra compilers individually
after project load, integrate the update into the regular project source
file update. So we end up with only a single call of updateSourceFiles.
For this the project updater needs to trigger the extra compilers, and
wait for all to finish as well as the regular project part update,
before
triggering the parser.
Task-number: QTCREATORBUG-25783
Change-Id: I34f6df0fc0f96bcb42ee65019bee39cf49176c1f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This simplify the interface by removing a possibly wrong choice
ensures it works also on remote paths.
Change-Id: I01e198958900a91b99dcf2dbb491a593485493ba
Reviewed-by: David Schulz <david.schulz@qt.io>
The following variables:
"CMAKE_C_COMPILER",
"CMAKE_CXX_COMPILER",
"QT_QMAKE_EXECUTABLE",
"QT_HOST_PATH",
"CMAKE_PREFIX_PATH",
"CMAKE_FIND_ROOT_PATH",
"CMAKE_PROJECT_INCLUDE_BEFORE",
"CMAKE_TOOLCHAIN_FILE"
will be checked to see if the existing values have the same values
from the initial cmake parameters list.
Only the CMakeCache.txt values that do not exist on the file system
will be updated.
If not, the updated value will be presented in the dialog for upgrade,
or marked as bold in the settings dialog.
CMAKE_PROJECT_INCLUDE_BEFORE is dependent on Qt Creator version / path
and needs to be updated.
Fixes: QTCREATORBUG-24443
Change-Id: I1eeb44df3a7914051084ef405af5f5621cc5a4e2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The ctest information regarding the test case itself cannot be as
adequate as the information coming from the code model.
Nevertheless depending on the used mechanism we might end up in
places that will not be helpful when using the test tree to open
files of ctest. Try to get closer to the real declaration source
if we can.
Change-Id: Ia9d217f0cdc6de6230d89dd342b60856cf1312b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This will allow for the Qt Creator's CMake build only qtcreator
target to be selected as runnable.
Similar to qmake's qtc_runnable or Qbs's qtcRunnable features.
Fixes: QTCREATORBUG-25908
Change-Id: I6416873d0ad9cfec4960d98fc4b289ec98cc58b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The file system scanning was already in a thread, but creating a tree
from the flat list of file nodes was still done in the main thread.
Creating the tree looks for and creates folder nodes as needed for each
file node, which is not that big of a deal but still takes 1/3 of a
second for the Qt Creator source tree.
Task-number: QTCREATORBUG-25783
Change-Id: I28948ed3ff5233f6fc4b86e93da94d882b81e231
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reduces lock-up in main thread after loading projects
Task-number: QTCREATORBUG-25783
Change-Id: Ie769074f1689698379bd6fd60f74957086cfce37
Reviewed-by: hjk <hjk@qt.io>
Depending on the size of projects and the underlying toolchain we
may end up with no tests as the timeout for the ctest run was just
too small.
Fixes: QTCREATORBUG-25851
Change-Id: I5617987a9e43b16c02a2c0b4afd598a3ff909299
Reviewed-by: David Schulz <david.schulz@qt.io>
If tests are not set up using add_test() but are supported
by ctest due to a different registering mechanism we failed
to get these right.
Expect also tests configured differently and just omit the
respective file information.
Fixes: QTCREATORBUG-25847
Change-Id: I16fcbec1a3a262f7d77ffdf15e4114e5a15e3757
Reviewed-by: David Schulz <david.schulz@qt.io>
Having two configurations for a project, one in /tmp and one in the
right build directory is confusing and for big projects can take some
time.
Fixes: QTCREATORBUG-25532
Change-Id: Ib0dad267117b3c025d668646ef076b0f77bff166
Reviewed-by: hjk <hjk@qt.io>
Qt Creator 4.15 added the "<File System>" project node containing all
the files in the source directory.
Qt Creator for its "find extra compilers" step needs only the files
from the project and not all the files in the system.
Task-number: QTCREATORBUG-25783
Change-Id: I5d33d5296f67ab3f321c232e5071f32e56d29101
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>