By default are marked as Autodetected, which is not the case for CMake
presets.
Fixes: QTCREATORBUG-31255
Change-Id: I5c3da7c6e7c68a8a2e80e415393010121b33efb4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
CMake Project Manager is using a small CMake project as a compiler probe
when a CMake preset is being setup. Now this CMake project is saving
more variable as cache variables.
These CMake variables could be only visible inside the CMake preset
probe project via a CMake toolchain file.
CMAKE_SYSROOT was important to be set in the Kit. The CMAKE_C|
XX_COMPILER_TARGET variables are set to override the original triplet
for the code model.
Fixes: QTCREATORBUG-31249
Change-Id: I3c3294b839629c22ce760596b92b2b393eed6a8b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Qt Creator will use the CMake macro expander for the "vendor" string
entries.
This would allow the following CMake preset snippet to work as a CMake
preset user would expect it to:
```
"vendor": {
"qt.io/QtCreator/1.0": {
"debugger": {
"DisplayName": "LLDB Dap 18.1.7 Debugger",
"Abis": ["arm-darwin-generic-mach_o-64bit"],
"Binary": "$env{HOME}/llvm/clang/bin/lldb-dap",
"EngineType": 1024,
"Version": "18.1.7"
}
}
}
```
Change-Id: I4ea5ce0b004ff05cebbe3e0ce4b6bcc09c716322
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
CMake can have custom build types. Qt Creator can rename existing build
types.
This changeset allows having a custom build type like for example:
* CMAKE_BUILD_TYPE=MyRelease
* CMAKE_CONFIGURATION_TYPES=MyDebug;MyRelease
Fixes: QTCREATORBUG-30014
Change-Id: I3d81d9ff867bfaab29aaf1741606f9c586da82e0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This adds "Debugger" as a dependency for the CMake Project Manager.
The "vendor" field of a configurePreset can look like:
```
"vendor": {
"qt.io/QtCreator/1.0": {
"debugger": "C:/Qt/Tools/mingw1120_64/bin/gdb.exe"
}
}
}
```
or with all the DebugItem details as:
```
"vendor": {
"qt.io/QtCreator/1.0": {
"debugger": {
"DisplayName": "GNU gdb 11.2.0 for MinGW 11.2.0 64-bit",
"Abis": ["x86-windows-msys-pe-64bit"],
"Binary": "C:/Qt/Tools/mingw1120_64/bin/gdb.exe",
"EngineType": 1,
"Version": "11.2.0"
}
}
}
```
Fixes: QTCREATORBUG-30836
Change-Id: Ia89ff29ce5fad713ee8617477ec798bd86f2f811
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
In cases when a CMake project is using a CMake preset with a toolchain
file, the CMAKE_C|XX_COMIPLER value was not set in the CMakeCache.txt.
This commit makes sure that the cache from the CMake preset probe
contains CMAKE_C|XX_COMPILER values.
Task-number: QTCREATORBUG-30474
Change-Id: I63ac6fe2b043e49dda98e286b6d85950e34be920
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
If no CMake is found, show an error message (reusing an existing
translated string).
Fixes: QTCREATORBUG-30505
Change-Id: I6e3037ee97dfba21791191483fffab769a451125
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 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>