A failed CMake run configuration could be the result of an compiler
update which then would cause CMake to fail.
Make sure to offer an upgrade path to the new Kit compiler values.
Change-Id: Ibabeb853259e23fe012d8b00e3d48979deee61a5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Visual Studio is getting a fair number of updates. This involves also an
update of the Visual C++ toolchain.
This implies changing directory paths from "MSVC/14.39.33519" to "MSVC/
14.40.33807".
The linker "link.exe" is also stored in the same directory as the
compiler "cl.exe".
This commit makes sure that the linker also gets updated, not just the
compiler.
Change-Id: If8cd6e716604bc948ec8990921a14425ebcc7c30
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
If a class is being added to a target that has a variable resulted from
a `file(GLOB|_RECURSE)` call, we skip adding the files to the target.
Do not add the files, just run CMake which would gather the new sources
into the project.
Adding sources to a globbed target will no longer open the
CMakeLists.txt file, since nothing has changed.
CMake will be run after adding, renaming and removing of sources files.
Fixes: QTCREATORBUG-30445
Change-Id: I82e126737789f215a6400f5a43f303dcc57de005
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This fixes renaming of "my/class.cpp my/class.h" via "../class.h" and
resulting into "class.cpp class.h".
"oldRelPathName" was not needed since it was saved in the
"m_filesToBeRenamed" map and it was computed from the new filename. This
was prone to error.
Task-number: QTCREATORBUG-30830
Change-Id: I839fab3bd6a6172f5ebfbaf9a4b6501cd5693fa8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
CMake supports the use of custom startup programs that are provided
in the IDE to simplify execution.
If the build system provides launchers, these are provided as an
additional selection field of the run configuration including an
entry without launcher.
As of cmake version 3.29, the start programs are extracted from
the API of the cmake file. For older cmake versions, a launcher
is initialized from the cmake variable CMAKE_CROSSCOMPILING_EMULATOR,
if available.
Fixes: QTCREATORBUG-29880
Change-Id: I4345b56c9ca5befb5876a361e7da4675590399ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This is useful if projects do not to have "Auto Run" CMake or want to
have Junctions enabled.
Change-Id: I4a636e7bf64fe2d29d15d39fe9aa46807684c716
Reviewed-by: hjk <hjk@qt.io>
This way one could really get a clean build as one would expect when
issuing "Clear CMake Configuration".
Change-Id: I7067bc4f6f858aeb408612eab5e658e637c0c957
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Rename process.h back to qtcprocess.h
MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.
There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have
Simply use a name that doesn't conflict.
Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This way we have fixed small (max 64 bytes) paths for CMake's configure
/ build / install steps.
This allows the user to have longer paths and still compile with MSVC /
GCC MinGW compilers.
Fixes: QTCREATORBUG-26786
Task-number: QTBUG-117413
Change-Id: I0cff6521626dd2ce78d0223d46f0b480e977d5c5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Amends 7a46bbe667 which only used
`cmakeTarget->productType() != ProductType::Other` which excludes OBJECT
libraries.
Now the fix actually includes all targets which are not UtilityType,
which was the intention of 7a46bbe667
Fixes: QTCREATORBUG-29914
Change-Id: If661828e43d5c566c876546f5527c0b670405e47
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Avoid using readAllStandard{Output,Error} mutable methods if possible.
Use non-mutable methods when we are not connected to
readyReadStandard{Output,Error} signals.
Change-Id: I2e830e571b9eab2177fd856bbe06dfc5137d9c01
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Instead of looking after the target name reported by CMake's file api
e.g. mytarget, take the parameter name from the function that created
the target.
This way if the user used ${PROJECT_NAME} to mark the name of the target
for qt_add_executable and qt_add_qml_module, when adding a qml file the
proper function would be picked.
Fixes: QTCREATORBUG-30218
Change-Id: I920f16d9f5a6b8a7a2fddb3ef7e97e0e3bccd464
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
On multi-config systems CMake is reporting "ALL_BUILD" or "ZERO_CHECK"
as targets to add files to.
When issued from menu File > Add New ... the selected target is the
first target namely "ALL_BUILD", which is a utility target and cannot
have source files.
Fixes: QTCREATORBUG-30170
Change-Id: I7617978c01f0a2554a3ec7d52ef9baaa16ed7a84
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
On Windows upon a CMake file change and save during a build, the
reconfiguration would fail due to the inability to save the build.ninja
file.
Fixes: QTCREATORBUG-30048
Change-Id: I68bec70b0a95bc4256b736a1c4caf1b4d706e43b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
In case of having no translations setup with the wizard or
manually later on we just do nothing and fail with adding
the translation file.
This patch minimally changes the CMakeLists.txt so that the
files are not "lost".
Task-number: QTCREATORBUG-29775
Change-Id: I560c8b736ec2a0a8de6e1177317a9172921f4340
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
There are more ways to add translation files to a cmake project,
so support the common ways.
Task-number: QTCREATORBUG-29775
Change-Id: I15f0d7a13303a1845760dbfc830c6f773f634ce0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
..for the major build systems. CMake build system will get further
improvements. For now this only works for adding ts files to the
target after the project had been created with QC's wizard with
some translation already added.
Qbs and qmake just work.
The C++ sources obviously will not change automatically to
integrate translation support for the application.
Task-number: QTCREATORBUG-29775
Change-Id: I80e4c21156f4bb8d5ef0bd6edf805021a55770ee
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
When building using CMake it's possible that single CMakeLists.txt may
contain multiple android executables. In this case android-build
directory mixes the build artifacts from multiple targets. This patch
allows using per-target android-build directories in case if Qt support
this. The QT_INTERNAL_ANDROID_TARGET_BUILD_DIR_SUPPORT cache variable
indicates that Qt has builtin support of this feature and the
QT_USE_TARGET_ANDROID_BUILD_DIR cache variable should be set to TRUE
by user to enable the functionality project-wide.
Task-number: QTBUG-117443
Change-Id: Ic8f576e528ee918a3ebf075a25fa2a414ef85736
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
They are reasonably standardized, and generally usable cross-plugin,
so this can help to avoid a few cross-plugin compiletime dependencies.
Change-Id: Icb2b010c3e12dee69df54ab16f6f8e90d9cffba6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
In case we have no Qt inside the current kit configured the
code model stumbles upon Qt constructs even if
CMAKE_PREFIX_PATH has been used correctly to allow cmake to
pick up a Qt.
Explicitly look into the found packages to see whether Qt
has been found and use this if possible for the codemodel.
This fixes some inline diagnostics as well as finding all
test information inside Qt Test related projects instead of
just the test cases when using a kit without a Qt.
Change-Id: Id3b5d2e818967cd3121948b818c75c4cf463546f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
... to ProjectExplorer::ProjectUpdaterInterface and generalize it
regarding language, but create a convience function for the C++
case, as that's the only user right now.
Also add the self-registering factory boilerplate and adapt all
buildsystems.
Change-Id: If928512609d41c25fad2aa58633c8bffabc4c48f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Wizard summary page does not provide a list to put in failed
files, so ending up inside the build systems addFiles() may
pass in a nullptr. Guard against its access.
Change-Id: Ia858f8029b1b840cc341d87614576f2634b995dc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>