Commit Graph

128 Commits

Author SHA1 Message Date
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
Orgad Shaneh
a5e98b1fa0 CMake: Avoid redundant copy
Amends commit e8802d92e3.

Reported by Coverity.

Change-Id: Ibc0b1cdf1918d5bfed5104f14098096d158526e2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-21 10:48:58 +00:00
Cristian Adam
e8802d92e3 CMakePM: Add support for "external" arch and toolset
Fixes: QTCREATORBUG-28693
Change-Id: Id36f334c27f26a1f2ce65351de77e18d93b1a064
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-15 11:32:38 +00:00
Eike Ziller
d278135497 Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: I8d73198561f6ff7877d580681ca2a0018b7dc3b1
2023-02-06 10:14:18 +01:00
Cristian Adam
51cbfd77db CMakePM: Improve CMake presets kit config hashing
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>
2023-02-02 15:56:46 +00:00
Eike Ziller
0dfa542bee Merge remote-tracking branch 'origin/9.0'
Conflicts:
	src/plugins/cppeditor/cppcodestylesettingspage.h

Change-Id: I1aa4e2f9efc6d9cf9f284aef1abf148be9b93a60
2023-01-10 15:44:55 +01:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
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>
2023-01-10 09:00:30 +00:00
Cristian Adam
a3153c535d CMakePM: Add default kit configuration hashing
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>
2023-01-06 18:01:32 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
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>
2023-01-06 11:15:13 +00:00
Eike Ziller
3f4c3a3db4 Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/texteditor/texteditor.cpp

Change-Id: I9c8f1331be3f5442f1fd28aeb0a9bc07128629d1
2022-12-20 11:05:01 +01:00
Cristian Adam
70b3388684 CMakePM: Allow relative compiler paths for presets
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>
2022-12-19 11:52:37 +00:00