Commit Graph

2739 Commits

Author SHA1 Message Date
Cristian Adam
213c879882 CMakePM: Skip default build types for CMakePresets
If a preset has a build directory set, that build directory and build
type should be displayed in the initial configuration dialog.

Change-Id: I884471cb4d482c92ab091a4043d642828318b4d2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-10 14:09:04 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
0d13cfe652 CMake: Remove the restriction that the reply file cannot be remote
It would be remote on "real remote" builds.

Task-number: QTCREATORBUG-28242
Change-Id: Ic37e5c6ec30064aec825d2322d25843a526b6ac4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-07 09:49:06 +00:00
hjk
0e3d1064e6 CMake: avoid running into some code path that breaks later
When trying to configure a CMake project on a remote linux device,
there's currently PATH=/some/local/dir/for/ninja added on the ssh
command line, which won't work with the remote cmake.

Change-Id: I97adb58e4c8b33f74edcc37a7b2cfb00c764b829
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-06 14:59:10 +00:00
Marcus Tillmanns
8d80623a0f CMake: Delay restoration until devices load
If the devices have not loaded yet, trying to restore
a remote cmake will result in errors.

Change-Id: I08a802441d64b203388334e5cbb6b962d1f0d213
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-06 05:16:36 +00:00
Cristian Adam
ab7a472b94 CMakePM: update CMakePresets macro replacement function
Moved to a handcrafted function instead of using regex.

This way the Visual C++ Ninja only preset can be processed.

Change-Id: I9b303ee1765db05544d81db7d3b8d9e5223f5f42
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-05 17:54:35 +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
hjk
3b84a408df CMake: Allow parser to run remotely
Change-Id: I3953d459177790fd652ab69c083b0dd0f1d29031
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:46:51 +00:00
hjk
efbab2e7c4 CMake: Be a bit more specific on what is not reachable
Change-Id: I5d521a9562d36850c264e1af48b46e16c642fde9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-30 15:31:16 +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
Cristian Adam
ee4c998ff3 CMakePM: Add supprot for CMakePresets version 3
This includes Condition and toolchainFile

https://cmake.org/cmake/help/v3.21/manual/cmake-presets.7.html

Task-number: QTCREATORBUG-24555
Change-Id: I1026390af67b2be1aa0c3b02b654fc19442d3c89
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 08:34:07 +00:00
Cristian Adam
45a275e054 CMakePM: Use architecture and toolset for project import
This fixes issues with Visual C++ generator, which needs the right
parameters to pinpoint the right compilers.

Also use CMAKE_TOOLCHAIN_FILE for qmake detection.

Change-Id: I6edc84c7ed1a892fbc5545ff61dc06ac20720f0a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 08:34:00 +00:00
Christian Stenger
58a4cd0804 CMakePM: Fix nullptr access
Amends 1b1fc43954.

Change-Id: Idfcf5bb2c58f37f366cb739475c7ba2d56d76e48
Reviewed-by: hjk <hjk@qt.io>
2022-09-30 07:11:24 +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
Marcus Tillmanns
1b1fc43954 CMake: Convert paths to device
The values coming from a CMakeConfig do not contain
the device they are relative to.
This transforms the FilePath to be relative to the device
that the cmake executable was run on.

Change-Id: I7bfdf065ddb4acfc751ac6456f1c32398393e2ad
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-29 14:04:39 +00:00
hjk
55ed34ced8 CMakeProjectManager: Use QList in PresetsData
Less impedance when interfacing the rest of the code.

Fixes

     warning: comparison of integer expressions of different signedness:
     ‘std::vector<....>::size_type’ {aka ‘long unsigned int’} and
     ‘qsizetype’ {aka ‘long long int’} [-Wsign-compare]

Change-Id: If5e1e770e2ed170aa4259963fa7ca0d6642190d9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-29 10:44:34 +00:00
Eike Ziller
a254a9ba54 Merge remote-tracking branch 'origin/master' into work
Change-Id: I2235a55a599aaeca5d2b5377300a044b66c17da9
2022-09-29 12:03:13 +02:00
hjk
cfc9f6d2f3 CMakeProjectManager: settings page code cosmetics
Change-Id: I657fa72d5b625877dc1deec229f6f5c7c16358fd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-29 07:55:07 +00:00
hjk
c22fcef5ce CMakeProjectManager: Avoid direct QFileInfo use in cmaketoolsettingsaccessor
Change-Id: I0fe6fc9b84cb810f43d7f0d737afa5fa299ac724
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-29 06:02:56 +00:00
Cristian Adam
e02f4a0518 CMakePM: Add support for build CMake presets
This patchset will add support for version 2 of the CMakePresets
feature that has been implemented in CMake 3.20

https://cmake.org/cmake/help/v3.20/manual/cmake-presets.7.html

Task-number: QTCREATORBUG-24555
Change-Id: I08934243cc04487d38c4b59c2ad4a4a8d0484492
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-28 21:24:53 +00:00
hjk
21c5d3499b CMakeProjectManager: Compile fix
Amends bcadea228.

Change-Id: I4f85780ffa6c7c79c70c096b457065f95e96355f
Reviewed-by: hjk <hjk@qt.io>
2022-09-26 16:15:11 +00:00
hjk
985c8b1a43 ProjectManager: Return FilePaths from ProjectImporter::importCandidates
Proliferates FilePath use a bit further. Actual changes to the
individual importers are left for further patches.

Change-Id: Ie7c6b2e3f4ac7d0eca6d2f56d30fb23354bb404b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-26 16:02:55 +00:00
hjk
bcadea2285 CMake: FilePath-ify CMakeProjectImporter
Change-Id: Ifffd3328afae60a4015d88e36b3e60b4ee492c3b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-26 15:16:36 +00:00
Cristian Adam
5a156395c4 CMakePM: configure presets review fixes
Amends 2ab1e76ca9

Change-Id: Id10f0d4da6a60223d68af3cea6c5263f7c8c62f2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-26 12:04:37 +00:00
Eike Ziller
e3f375925d Prefer project's Qt version for context help
To avoid additional dependencies, let the QtSupport plugin register a
function for filtering help URLs, and add information about the
originating file path to the help items created by the context help
handlers. The filter hook then finds out the corresponding project,
active target, and corresponding Qt version, and filters the help URLs
accordingly.

With the default setting in "Kits > Qt Versions > Register
documentation", only the highest versioned documentation set within a
major Qt version is registered, so context help now shows the highest
versioned help from Qt 5 or Qt 6 depending on active target. If that is
changed to "All", context help now shows documentation from exactly the
version that is currently used by the project.

Fixes: QTCREATORBUG-10331
Change-Id: I7d87793737cc5ab7d228ee4bfe568d7e8343ee7d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-26 09:24:55 +00:00
Marcus Tillmanns
df859d891d Filepath: Add ::isSameDevice
Change-Id: I3990429b59759d5f72ed95e3a0d1723d3bb7bb82
Reviewed-by: hjk <hjk@qt.io>
2022-09-20 10:11:33 +00:00
Marcus Tillmanns
dabd9a175e CMake: Make sure source/build directories are reachable
Change-Id: Iea4547807b3a59eb9a8cb70d51d9015dbc8013e3
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 12:16:54 +00:00
Alessandro Portale
a917770053 Replace QtSupport::QtVersionNumber with QVersionNumber
Task-number: QTCREATORBUG-27786
Change-Id: I71a44709c264829f629c9dfce702076eda297a77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 12:08:39 +00:00
Alessandro Portale
528c44ba8a CMakeProjectManager: Remove margins around CMakeBuildStep widget
Change-Id: I9b2a1a615f987c3dff9b5fcb29b0a10c5417f752
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-16 05:57:37 +00:00
Cristian Adam
2ab1e76ca9 CMakePM: Add support for configure CMake presets
This patchset will add support for version 1 of the CMakePresets
feature that has been implemented in CMake 3.19

https://cmake.org/cmake/help/v3.19/manual/cmake-presets.7.html

The tests/manual/cmakepresets contains a manual test example for this
feature.

Task-number: QTCREATORBUG-24555
Change-Id: I93aba1ab4f090613d0b21d970b5b651d12c922af
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-14 11:50:49 +00:00
Eike Ziller
2c51e4bc17 FilePath: Return optional bytearray for file contents
For differentiating between "error" and "empty file".

Change-Id: I2c019ceac625e7be3180afa4d47ae3a24df91c1d
Reviewed-by: hjk <hjk@qt.io>
2022-09-12 11:57:04 +00:00
Marcus Tillmanns
d956ddee71 CMake: Use correct CTest binary if cmake is remote
Change-Id: Ic0ad52a754ccd39bca2e406a324f9e27ec9bc9bd
Reviewed-by: hjk <hjk@qt.io>
2022-09-08 11:48:37 +00:00
Marcus Tillmanns
ef11da3629 Fix: Initial CMake run does not have PATH set
If certain tools are not in the systems base PATH, as can be the case
on macOS where Ninja might be located in /usr/local/bin, the initial run
of cmake for a new/clean project would fail as the PATH (and the rest
of the environment variables) would not be set for a freshly initialized
CMakeBuildConfiguration.

This change fixes that by calling
updateAndEmitConfigureEnvironmentChanged at the end of the build system
initialization.

Change-Id: Ib2ebe4da60a6284548eabed124240212178c67e1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-09-06 06:04:47 +00:00
Eike Ziller
9c708b79ce Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/remotelinux/killappstep.cpp

Change-Id: I4360e7d0f2c2ac258613933de81e8a9c40387379
2022-09-02 10:12:40 +02:00
hjk
7cfc3d26bc Utils: Replace FilePath part setters
... by a combined version. This will make it easier to store the parts
in one QString object.

Change-Id: Ie85a77e3957c78a30e49998fe2e617af35a8ad17
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-01 07:59:29 +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
Cristian Adam
f866b03b19 CMakePM: Do not use displayName for build directory
This code path was used when adding a new build type from settings via
Add -> RelWithDebInfo and it would be expanded to "Release-with-Debug-
Information".

On Windows this can lead to long paths and problems.

Change-Id: Ie6ab74414778a2e723bfa08d6765292dfe6bce22
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-31 09:27:50 +00:00
Eike Ziller
904c368858 Projects: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: I2217f13336ec816d28bd447ccd14a405bff2a3a7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-29 13:39:16 +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
Eike Ziller
64247bf571 Merge remote-tracking branch 'origin/8.0'
Reverts/comments out parts of 45f93a817a,
which needs to be resolved in a follow-up commit.

 Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakesettingspage.cpp
	src/plugins/python/pythoneditor.cpp
	src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
	src/plugins/scxmleditor/common/colorsettings.cpp

Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
2022-08-19 12:48:27 +02:00
Alexander Akulich
7c7fdf6460 CMakeSettingsPage: Reload data on CMake executable path edit finished
This fixes missing/outdated 'Version' information and maybe useful
for more data later.

Ammends commit 057bb3095b

Change-Id: I2d3976fd396ec440e3fa7b67af008175ab4c9048
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-08-18 21:13:20 +00:00
Cristian Adam
d86d278044 CMakePM: Add configure environment widget
CMakePresets have the concept of modifying the configure process
environment variables.

Qt Creator had only one "build environment".

Change-Id: I131d54971b4bf7e5f87e680f817f93868d62ab29
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-16 18:56:36 +00:00
Christian Stenger
b3f1c73aef CMakePM: Change default for package manager include
Change-Id: I003e315139fea643d19f15e8eb2f3b950fab79d5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-08-11 13:38:00 +00:00
David Schulz
5db3d507dd Revert "CMake: Reload item data on CMake executable path changed"
057bb3095 makes it impossible to type in dir separators and so a valid
path to a cmake executable in the Path field of the cmake settings page.

This reverts commit 057bb3095b.

Change-Id: I3edbdced8eaac15f34ca43acf1e86f4be6cd9be7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-08-10 10:12:38 +00:00
hjk
ed8c775def Merge remote-tracking branch 'origin/8.0'
Change-Id: Icbb87ac8bcee5fb86042d3863a973573510651b4
2022-08-05 08:50:27 +02:00
Marcus Tillmanns
cd252e4d90 warnings: Fix -Wdeprecated-copy
Change-Id: Iec5f5edf3752372fd7a0ce94dc26cbf7e75dd8f4
Reviewed-by: hjk <hjk@qt.io>
2022-08-04 10:22:21 +00:00
Alexander Akulich
057bb3095b CMakeSettingsPage: Reload item data on CMake executable path changed
This fixes missing/outdated 'Version' information and maybe useful
for more data later.

Change-Id: Ibf302a424d8a3c289d37fc0fabc00ab22e4bde97
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-08-03 21:02:20 +00:00
hjk
df358c7833 ProjectExplorer: Remove unneeded #include in projectexplorer.h
And fix side effects.

Change-Id: Ib6f0c5618092f80204b409edec0a92004f2350d2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-27 11:56:09 +00:00
hjk
58c5b126d3 Utils: Settle on lowerSnakeCase for LayoutBuilder::Setter
Change-Id: Icfe487d8c7712cc8ad28f0f61e8ae4778a356fc3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-27 08:40:12 +00:00
hjk
b97c495d2b Utils: Make the second parameter to LayoutBuilder::attach() an enum
More explicit and more potential options (e.g. "treat grid as form")
than a bool.

Change-Id: I89413efe30410160c38b0e524ba64288dde2332e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-26 11:52:16 +00:00