Commit Graph

138 Commits

Author SHA1 Message Date
Cristian Adam
bef8cf703d CMakePM: Mark CMake presets registered toolchains as Manual
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>
2024-07-17 14:53:50 +00:00
Cristian Adam
6e79888943 CMakePM: Fix code model for cross-compiler CMake presets
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>
2024-07-15 11:45:22 +00:00
Cristian Adam
a8e2ccdea6 CMakePM: Expand CMake macros in the "vendor" debugger settings
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>
2024-06-18 14:48:21 +00:00
Cristian Adam
a9995e23b1 CMakePM: Allow CMake custom build types
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>
2024-06-04 15:30:37 +00:00
Cristian Adam
968051eb72 CMakePM: Presets: Add ability to register a Debugger via "vendor" field
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>
2024-05-29 15:47:10 +00:00
Eike Ziller
90e1d96019 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	doc/qtcreator/src/overview/creator-only/creator-keyboard-shortcuts.qdoc
	qbs/modules/qtc/qtc.qbs
	src/plugins/remotelinux/linuxdevicetester.cpp

Change-Id: I8434e41dcfbb50f6ed032a3e0af1591eb19b79eb
2024-03-20 15:05:58 +01:00
Cristian Adam
2c598814bb CMakePM: Always set the comiplers from the CMake Preset probe
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>
2024-03-18 11:56:18 +00:00
Eike Ziller
c19f97bd23 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmaketool.cpp
	src/plugins/python/pythonutils.cpp
	src/plugins/qtsupport/baseqtversion.cpp

Change-Id: Ia3e35c763ff9475d17ad922718b54152209893b8
2024-03-14 11:35:07 +01:00
Cristian Adam
52c39d007f CMakePM: Do not crash with CMake presets and no CMake tool
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>
2024-03-13 12:32:54 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
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>
2024-02-28 08:09:05 +00:00
Cristian Adam
c9208932d7 CMakePM: Don't show anything but CMake Preset Kits during initial configure
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>
2024-02-21 13:08:19 +00:00
Cristian Adam
87c67fc6d7 CMakePM: Only display CMake preset Kits in the project setup page
Fixes: QTCREATORBUG-29535
Change-Id: I87c16c24a8548efb4374af342947d342e19cc510
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-02-12 09:55:27 +00:00
Cristian Adam
7454f84901 CMakePM: When using presets only use presets for candidates
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>
2024-02-08 17:36:22 +00:00
Eike Ziller
220237d029 Merge remote-tracking branch 'origin/12.0' into 13.0
Conflicts:
	src/plugins/ios/iosdevice.cpp
	src/plugins/texteditor/bookmarkmanager.cpp

Change-Id: I92931f29c3992054dac84dbfa2dfc0c1bfb31430
2024-02-05 10:52:42 +01:00
Cristian Adam
f00513835b CMakePM: Allow preset name changing for Reload CMake Presets
Fixes: QTCREATORBUG-30237
Change-Id: I9d2f90d9637b91845dfe0ab619c83ff60dbd986a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-30 11:00:26 +00:00
Cristian Adam
76a8966739 CMakePM: Refactor CMakeLists|Cache.txt as constants
Change-Id: I7165fa1d219a0c59bc519a9af1cd194414c4311c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-29 11:50:21 +00:00
Jarek Kobus
11a8c55f38 Various plugins: Remove unused variables
Change-Id: Ie2e5eb38d81a7582c5715654f09f28deb4ab11c5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-29 07:44:39 +00:00
Jarek Kobus
afc67468e6 Process: Get rid of setTimeoutS()
Add an extra arg to runBlocking() function instead.
Use std::chrono::seconds for timeout.

Change-Id: I7c3c21e8f26a2ccbed157d15083d6ef0b4cd2f7e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-22 20:27:51 +00:00
Jarek Kobus
9aa37ee9d9 CMake: Omit a call to setTimeOutMessageBoxEnabled(false)
The false is a default value.

Change-Id: I94eb7c58ed591171de677f1dfc0d80a0c751d36d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-20 19:04:48 +00:00
hjk
d234e71643 All: More ToolChain->Toolchain renamings
And removal of one unused function declaration.

Change-Id: I594e23401d8f247d3be081ce850005574951899d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-01-19 10:29:33 +00:00
hjk
446d79ad67 CMake: Split big plugin tests into smaller pieces
... which can then live closer to the tested code.

Change-Id: Icd975a76424ea2258c1bb93afdbaabdf1959340a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-15 17:04:37 +00:00
hjk
d2ca6afb8f ProjectExplorer: Some more Toolchain renamings
Change-Id: If8bdfd5e49a031a511bc0e062727495a12d2d3bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-14 14:22:47 +00:00
hjk
27ef041d28 ProjectExplorer: Some more ToolChain->Toolchain renamings
Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-12 08:14:59 +00:00
hjk
ddf39cd0dc ProjectExplorer: Rename various items in the Toolchain class
Change-Id: I544763d3b4d521f6bbed0dc5a767c15c49055a19
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-04 15:10:08 +00:00
hjk
c463f944e9 ProjectExplorer: Rename ToolchainManager signals and members
Change-Id: I5195cb785f91dbaafdeeb8bb8c71939a6e3ff9e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-27 16:45:02 +00:00
hjk
b5937836f4 ProjectExplorer: Rename ToolChainManager to ToolchainManager
Plus the private and some comments.

Change-Id: I95d72d77f25cb1c969a1a6148e7186150a697d1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-27 16:33:34 +00:00
hjk
3bbda8f9da ProjectExplorer: Rename Tool{C,c}hainKitAspect
Change-Id: I74460b6402ab00f972c208023f03fac617982a11
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-27 13:35:28 +00:00
hjk
c28fb1fdbe ProjectExplorer: Rename ToolChain to Toolchain
Change-Id: Ibb520f14ff3e2a6147ca5d419b9351c50c141063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-24 15:18:24 +00:00
Cristian Adam
5e3d14e2e9 CMakePM: Allow CMAKE_SYSROOT to be taken from the CMake preset probe
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>
2023-10-24 09:13:50 +00:00
Cristian Adam
43121fa574 CMakePM: clang-tidy fix for 'perf*-unnecessary-copy-initialization'
Change-Id: I9c407f7254328e7278096239f6f3946c34e873d5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 13:57:20 +00:00
Cristian Adam
2e2248e80e CMakePM: Allow invalid file characters as part of preset names
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>
2023-10-17 11:37:57 +00:00
Cristian Adam
16b147d563 CMakePM: Expand macros in cmakeExecutable CMake preset value
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>
2023-10-17 06:36:29 +00:00
Cristian Adam
4f26d802ca CMakePM: Remove support for extra generators
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>
2023-09-14 10:30:06 +00:00
hjk
4e0c4b0f23 CMake: Rename cmakekitinformation.{h,cpp} to cmakekitaspect.{h,cpp}
Follow up after renaming the contained classes.

Change-Id: I9393c367abdd4eac487e17676c98a357ff33c98c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-22 05:56:39 +00:00
hjk
aa25fdcc69 QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp}
Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 08:59:52 +00:00
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
Cristian Adam
e33b8137df CMakePM: Handle qml debugging for CMake presets
Fixes: QTCREATORBUG-29311
Change-Id: I437d008a3625156e6a42f2ecaee71744bd9098f6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-07-06 14:08:14 +00:00
Cristian Adam
fe8c276d11 CMakePM: Auto detect generator when not specified in presets
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>
2023-07-05 14:02:48 +00:00
hjk
adcf52e0c4 Fix some more *::count() deprecation warnings
Change-Id: Ib7d1552a6f7b167e15beb7ca1ef26c7d57e090e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-07 07:29:34 +00:00
Eike Ziller
55dadd4f95 Merge remote-tracking branch 'origin/10.0' into 11.0
Change-Id: I27e2c1c764f955d14bfece6cd580b4c2d2988396
2023-05-25 08:29:27 +02:00
Cristian Adam
0d3d4892c6 CMakePM: Fix Qt detection for Presets with toolchain file
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>
2023-05-24 13:59:14 +00:00
Cristian Adam
9ff0cf7306 CMakePM: Add action to reload CMake Presets
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>
2023-05-15 15:13:23 +00:00
Cristian Adam
8854f53a42 CMakePM: Fix duplicated CMake presets kits
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>
2023-05-04 15:19:44 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
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>
2023-05-04 05:52:16 +00:00
Cristian Adam
3dd4b98c0c CMakePM: Better Qt import detection
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>
2023-05-03 11:38:07 +00:00
Cristian Adam
e2f83c74f4 Revert "CMakePM: Fix compile for gcc 7"
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>
2023-05-02 15:25:22 +00:00
Cristian Adam
45faec05e5 CMakePM: expand macros for all configure cacheVariables
Fixes: QTCREATORBUG-28982
Change-Id: Iabbf39b815ed7477a9d272a320308f320a31adbc
Reviewed-by: hjk <hjk@qt.io>
2023-04-17 15:03:53 +00:00
Cristian Adam
40a22963be CMakePM: Fix presets with macros in CMAKE_BUILD_TYPE
Fixes: QTCREATORBUG-28893
Change-Id: Ifc4927a31c6a30c3c8ab083d8724207202c75aa1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-15 09:15:16 +00:00
Cristian Adam
05d9742a96 CMakePM: Expand CMake preset macros also for environment vars
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>
2023-03-11 08:56:06 +00:00