Commit Graph

131 Commits

Author SHA1 Message Date
Christian Kandeler
fec896e712 Utils: Add convenience function for generating a unique Id
Change-Id: I74516ef5077009ebcf1d47c724ca63e502729ede
Reviewed-by: hjk <hjk@qt.io>
2024-07-12 11:47:05 +00:00
Cristian Adam
fa39d0490e CMakePM: Remove per CMake tool "Auto Run" setting
The setting is global for a few Qt Creator versions now, and it was
marked for removal in Qt Creator 13.

Change-Id: Ibca753b53a27ce89cba25a8c55c080e5597c4f57
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-27 09:14:40 +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
Marcus Tillmanns
4e8bdd610b Utils: Remove PresistentStoreCache
It turns out caching the information is unreliable due to a variety of reasons.
We remove the cache for now as its less dangerous than trying to fix each
use case.

Change-Id: I8238166486a2fb29c101f700af1c8d7e4ad7a172
Reviewed-by: hjk <hjk@qt.io>
2024-03-12 14:24:05 +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
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
Cristian Adam
55cccfa59e CMakePM: clang-tidy fix for 'no-automatic-move'
See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-
tidy/checks/performance/no-automatic-move.html

Change-Id: If265c9b0e2aea49e5923f079cd621e10bb958286
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 13:57:34 +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
60de12efd2 CMakePM: clang-tidy fix for "performance-unnecessary-value-param"
Change-Id: Ia22d7c3fe6c29a5e0999145b6c4b281818dd72bf
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 13:57:15 +00:00
Cristian Adam
32b6e6309e CMakePM: Remove remainders of extraGenerator
It was not possible to set the toolset for Visual Studio 2022 generator.

Amends 4f26d802ca

Change-Id: I56caf9c0d66812eb599646a3679602af7372f419
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 10:07:17 +00:00
Cristian Adam
524634f124 CMakePM: Add support for "$ENV{" code completion and help
CMake has a few environment variables that are documented and this
commit adds support for them.

Change-Id: Iaa31bdc97b343581fcf519d19e66bc6ce8ace150
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-10 18:08:13 +00:00
Cristian Adam
7235e977ff CMakePM: Fix concurrent access crash
Change-Id: I9ea11619860d4066cb06dfd4a60def8208f21add
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-28 13:51:31 +00:00
Cristian Adam
05614ab740 CMakePM: Display help details for code completion
The first 1024 bytes from the CMake .rst files are displayed raw data.

A .rst to html or markdown would be needed for nicer user experience.

Change-Id: Ie6adbb404d844ae88b868b465d4125c2177e6cfe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-25 13:41:34 +00:00
Cristian Adam
53b8f0e495 CMakePM: Speed up CMake introspection
By listing files instead of running cmake and asking CMake to provide
the information.

For properties and modules now the information is taken from the active
CMake version and not from the Syntax-highlighting file.

Change-Id: I0974cc816d990fd382d9e855eb08416b50d0368b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-22 15:26:07 +00:00
Cristian Adam
a51380c2fd CMakePM: Add policy support for help and code completion
Change-Id: I82d291639fe890602bba61eded9d1dfd7d38ca41
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-20 21:11:10 +00:00
Cristian Adam
a998269d7e CMakePM: Expand help for variables, properties and modules
Not only CMake functions.

Change-Id: Icd21eb39a55533261f2b5c170a9dbd38a640e3e9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-20 19:54:03 +00:00
Cristian Adam
52e3ab5272 CMakePM: code completion changes for cmake_print_variables|properties
They are CMake module functions and need only certain parameters.

Change-Id: I6e49359470cd228fec985fca2297a50d44c76ded
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-19 16:35:18 +00:00
Cristian Adam
bc1c24eb84 CMakePM: Revamp the CMake code completion
By using KSyntaxHighlighting's metadata from the cmake.xml file.

With this information the code completion has localized arguments for
functions.

Added support for Generator Expressions $< and function ${ completions.

The project functions/macros and options are also taken into
consideration.

The file completion is using FilePaths and should work remotely.

Change-Id: I79d1360c1249c65c9db65349f326be5d41f0f734
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-18 15:22:39 +00:00
Marcus Tillmanns
77cc79b7b0 CMake: Cache CMakeTool capabilities
Change-Id: Ie81347a7864abeeb64aa2af6dee3f9def241fed8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-09-12 09:29:50 +00:00
hjk
8d0aa34bfc Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 08:00:02 +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
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
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
Cristian Adam
2f39b51bdc CMakePM: Make "Autorun CMake" a global setting
The "Autorun CMake" is only visible in the Tools settings page when
the user clicks on CMake tool.

This is not very visible and it doesn't have to be per CMake version.

Change-Id: I57ded0b2e6a3ecb731bb8bc1495b6b61bc04c8b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-05 14:37:50 +00:00
Cristian Adam
a0afd51f3f CMakePM: Add "CMake Install" deployment step
This commit adds a "CMake Install" deployment step, which is using
"cmake --install" command.

"cmake --install" command has been added in CMake 3.15, this is why the
minimum CMake version has been updated to 3.15.

Note that CMakeBuildSystem::makeInstallCommand is still using cmake --
build --target install due to a CMake bug regarding "Ninja Multi-Config"
generator, which doesn't intall all binaries via "cmake --install".

Fixes: QTCREATORBUG-25880
Change-Id: I504674c380055d8ef136d344a78b80c17ecf9765
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-19 13:57:43 +00:00
Eike Ziller
68388a38dd Merge remote-tracking branch 'origin/9.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp

Change-Id: I154a9ababa9e166cb06e98652d481fe6234f6399
2022-11-03 13:44:37 +01:00
Marcus Tillmanns
6936f23328 CMake: Fix settings display not updated
Fixes: QTCREATORBUG-28267
Change-Id: Icf2fb7e5d7a8cd44d7a61ade36be41106aba2138
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-27 13:11:29 +00:00
Christian Kandeler
13f40f5471 Utils: Add sorted() function
For simpler calling code.

Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 14:29:45 +00:00
hjk
09fb8d403b CMake: Use correct device environment for remote cmake binaries
Change-Id: Id2fccab7f2d051406b0f2b0bbf3c118198f6ed32
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:47:00 +00:00
Jarek Kobus
5ab100a2b9 CMakeProjectManager: Limit the usage of std::make_pair
Make the code less verbose.

Change-Id: I8dc194f0cb4ed38c4c117482a7011019444edc40
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-30 15:12:34 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Cristian Adam
5edbf915a4 CMakePM: Fix registering CMake as version 0.0.0
When importing a CMake build, the CMake version that's used in the build
could be registered as "CMake 0.0.0". This is obviously wrong.

Fixes: QTCREATORBUG-26999
Change-Id: I1401106806c4356516e8235a3767d9615e4d428d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-06-29 12:41:34 +00:00
David Schulz
153ff77a6b Utils: use cleaned stdout all over the place again
Amends 5ee880ce5e

Change-Id: Ie0202db7d8455372c3697087d9571db6706b45a1
Reviewed-by: hjk <hjk@qt.io>
2022-06-17 13:04:42 +00:00
Artem Sokolovskii
c23aa1c656 CmakeProjectManager: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464
Change-Id: Iabe3a621efa56282bf1511f540c98fdf5d8da270
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-20 12:55:20 +00:00
Marcus Tillmanns
2c4553366c docker: Correctly initialize Kit during autodetection
* Added returning the Id after detecting CMake so it can be set in the autodetected kit
* Trying to keep autodetect from adding the same Qt installation twice if qmake is linked in /bin and /usr/bin
* Added FIXME for RunControlPrivate::runConfiguration as it is used after free in rare cases
* Fixed IosCompilerDetector to not just run if a device is set
* Fixed QnxCompilerDetector to not just run if a device is set
* Fixed auto-detected debuggers not being set as auto-detected, as they now can be removed from the device screen

Change-Id: Ia7772c454d70e147e4326efacc4a6a888fa26782
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-12 14:15:45 +00:00
Eike Ziller
cd8c4ced81 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ic02df53b880d0861d9d9ea0df3e0d381ae99f350
2022-03-11 09:50:48 +01:00
hjk
95510a842e CMake: Drop two use of HostOsInfo::isXXXHost
More friendly to docker.

Change-Id: I3eeb859cc880fa24c2b1c74caf5a06ec4f27cb2f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-03-10 12:18:43 +00:00
Jarek Kobus
8e0ae8ba96 QtcProcess: Limit the inclusion of qtcprocess.h
Move the rest of QtcProcess enums to processenums.h.
Move ExitCodeInterpreter into processenums.h.
Remove superfluous Utils:: prefix.

Change-Id: Iaa596f353d33d6930085a621b114cc15a35caa80
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 13:30:39 +00:00
Cristian Adam
d408e4c22c CMakePM: Add "variable" link to CMake offline/online documentation
This way an user can find quickly a CMake variable if needed.

Change-Id: Ie885a34321cf2ce31ee662659e669de88b28801c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 15:34:07 +00:00
Cristian Adam
68cb80f276 CMakePM: Add options link to the CMake offline/online documentation
This way a user can quickly find out which options can be used.

Change-Id: I6347759689a4a1431a82ff9414da0c79e357eb45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 13:12:15 +00:00
Christian Stenger
4bea534c62 CMakePM: Do not register qch files from device
Change-Id: Ie6f8ce74d500d18b69fd5017ddd820356515c21a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-07 13:26:56 +00:00
hjk
f8c7d2e848 Docker: Rework auto-detection and removal of kit items
- Use more uniform messages for the different kinds of items
- Remove all auto-detected items

Change-Id: I0b0df0bca484337039432b163bd8e19593b1cd22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 12:55:53 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
953ea730b8 Utils: Merge QtcProcess and SynchronousProcess
Keep SynchronousProcess as type alias for a transition period.

Change-Id: I2540b6cecc17eb46f40ed57d27589011693728f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 06:31:57 +00:00
hjk
6d688f3199 CMake: Display cmake version on the cmake settings page
Mostly for informational purposes. Helpful e.g. to check whether
an auto-detected cmake binary from a docker device matches
expectations.

Change-Id: I546b0ab6edc240cc779bbf0560e00165cb524fcb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-21 16:21:47 +00:00
Cristian Adam
0e613918b6 CMakePM: Always create build directories
Having two configurations for a project, one in /tmp and one in the
right build directory is confusing and for big projects can take some
time.

Fixes: QTCREATORBUG-25532
Change-Id: Ib0dad267117b3c025d668646ef076b0f77bff166
Reviewed-by: hjk <hjk@qt.io>
2021-06-10 13:42:14 +00:00