This is for projects that use CMake Presets, and matches the expectations of the users using CMake Presets.
The user can still enable a Kit from the left list of Kits, which is not filtered.
Amends 87c67fc6d7
Task-number: QTCREATORBUG-29535
Change-Id: If97eef867a687c877b1cbd08cd4537fe6459136f
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Since the CMake presets is built upon Imports, when loading the presets
it's better to only use the candidates from preset Kits and not any
matching Kit that could handle the build directory.
This makes working with CMake Presets a bit easier.
Task-number: QTCREATORBUG-29535
Change-Id: I895e2e9162763e4cf3af5cdef5c9d5b228211fab
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.
Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
... which can then live closer to the tested code.
Change-Id: Icd975a76424ea2258c1bb93afdbaabdf1959340a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
One could have a toolchainfile that sets the CMAKE_SYSROOT. We need to
be able to read the value later, and not just from the CMake Presets
cmakeCache array.
Task-number: QTCREATORBUG-29643
Change-Id: I63697219195b043813516c8214329ce583dc0676
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The fact that Qt Creator uses the preset name to create a directory and
then import the directory is an implementation detail.
This changeset will allow characters like ":" to be part of the preset
name.
Task-number: QTCREATORBUG-29643
Change-Id: I84a224b78eb3d2233f80d9bdb8bf4478471349b0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The specification allows this, so we need to support it.
Task-number: QTCREATORBUG-29643
Change-Id: I8bd0a91ba05d2ed27b7a7af2d268539de020826f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
They are marked as obsolete in CMake 3.27 and will be removed in a
future version of CMake.
Fixes: QTCREATORBUG-29603
Change-Id: I6e5d36441d05b87ee4467d13781f53d4269636ad
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Qt Creator would do a compiler probe for CMake presets when the compiler
was not set.
But the same needs to be done when the generator is not set. Otherwise
Qt Creator would set a different generator by default. On Windows is
"Ninja".
This is different from what CMake does from command line.
Task-number: QTCREATORBUG-28693
Change-Id: I96e917b11561a042f9476bad302f3f153e37bafd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
When CMAKE_TOOLCHAIN_FILE and CMAKE_PREFIX_PATH were both set, the later
was ignored.
This resulted in Kits being created without Qt and without Qml
Debugging.
Task-number: QTCREATORBUG-28982
Change-Id: Ib45b4ac8335391f85a0b9c321196597d1c0a7a3f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The CMake presets will be reloaded. The preset kits will get the CMake
configuration cleared (no more CMakeCache.txt)
All the kits will be removed from the project, so that the Kit
configuration wizard will be displayed at the end.
If a normal Qt Kit was configured, the user will get the chance to
import the existing configuration (the initial configuration will be
lost though).
Change-Id: Ieda83098d7716913d7870b67ab522705da4ed93b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
QTC_KIT_DEFAULT_CONFIG_HASH was introduced in order to match the
previous CMake presets kits.
This would hash the Qt and the C/C++ compiler paths.
Unfortunately on Linux CMake would pick "cc" and "c++" by default,
whilst Qt Creator uses "gcc" and "g++". The compilers would match from
the Qt Creator point of view, but the hash values would be different.
On mac there is a similar issue with compiler launchers.
This patchset fixes this by removing the hash and fixes also the issue
of allowing broken CMake presets kits (without any compilers), which
were the reason for introducing the hash key in the first place.
Fixes: QTCREATORBUG-29075
Change-Id: Id8dc081febba7bc7023c98055afc6ebfcdc55542
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Qt6_DIR and Qt5_DIR CMake variables are additionally checked for
existence.
Qt6_ROOT and Qt5_ROOT are taken into consideration for both environment
and CMake variables.
CMAKE_PREFIX_PATH is also returned from the qmake probe. This fixes the
case when qt.toolchain.cmake is used exclusively.
Task-number: QTCREATORBUG-29075
Change-Id: I6e0c3adf7f5d9860a1cb776371e66dea1dfc26cc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This reverts commit ca04d9afcd.
GCC 9 or later is the minimum required version nowadays, so this piece
of code can be more readable.
Change-Id: I939ee6cd62572d23d5b1de8d113472136752a590
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This fixes the case when a CMake variable (CMAKE_PREFIX_PATH) would
reference an environment variable (qt_path) that would contain a CMake
preset macro (${sourceDir}/../qt_install).
Fixes: QTCREATORBUG-28606
Change-Id: Ib6239b13782b2ea854969547af46c3fe82a061f4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Amends a3153c535d
QT_QMAKE_EXECUTABLE was not taken into consideration and this would
result in not matching kits.
Also Visual Studio generator will not have a CMAKE_C|XX_COMPILER values
in the cache.
On Windows there could be paths with "C:" vs "c:" and the hashes again
wouldn't match.
Change-Id: I5da5fafbd29f3d1fd8c9615c41b7659e63c30ff1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.
Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This adds a QTC_KIT_DEFAULT_CONFIG_HASH variable containing the hash of
all the default Qt Creator CMake kit variables:
* CMAKE_C_COMPILER
* CMAKE_CXX_COMPILER
* QT_QMAKE_EXECUTABLE
* CMAKE_PREFIX_PATH
This way when a CMake preset changes any of these CMake variables a new
Kit will be created. Otherwise a previous kit containing different
values will be used.
Fixes: QTCREATORBUG-28609
Change-Id: I77b67e9c8fa15dc3ff2f22c5b63d4ca1c7670fdc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...
While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only
Change was done by running
find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;
Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
You can have a preset with the PATH environment variable modified and
with CMAKE_C|XX_COMPILER CMake variables only as "gcc.exe" and "g++.exe"
Qt Creator now will search in PATH after the compiler file names and
work as expected.
Fixes: QTCREATORBUG-28602
Change-Id: I8520f6fcf5e542600fab08228d04d3709d3a8e8f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>