Commit Graph

538 Commits

Author SHA1 Message Date
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
6685f0255d Utils/all: Move mime constants into a central place
They are reasonably standardized, and generally usable cross-plugin,
so this can help to avoid a few cross-plugin compiletime dependencies.

Change-Id: Icb2b010c3e12dee69df54ab16f6f8e90d9cffba6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:59:26 +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
9c8acbf40e CMakePM: Fix MSVC assertion with tests/manual/cmakepresets
Change-Id: I5f06d69b444e453456f2dd9822006b535d3f7843
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-06-12 13:10:30 +00:00
Eike Ziller
f2c1455025 Tr: Wrap file paths with ""
Change-Id: Iee0e941ff503ff485e8e9c0d9fe3e52eea9042d5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-26 13:50:07 +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
dc18d4b9ee CMakePM: Display presets as part of the project outline
Fixes: QTCREATORBUG-28966
Change-Id: Iae0f77956bf6f4682ea8a25e08d05de3331c7420
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-12 10:21:53 +00:00
Eike Ziller
7724f8653f Merge remote-tracking branch 'origin/10.0'
Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
2023-05-05 10:39:47 +02:00
Cristian Adam
65a1637d61 CMakePM: Fix presets transitive inheritance
Fixes: QTCREATORBUG-29076
Change-Id: Ibe4c3eebb3fcebeabafc485949a19e696ecad2de
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-27 08:00:53 +00:00
Eike Ziller
4e6877753a Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/android/androidrunnerworker.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp

Change-Id: I1628528dbc0ffe874b49bbe022da5933b1348057
2023-04-18 12:53:45 +02: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
hjk
7e63574764 CMake: Disable the default "install into temporary host" deploy step
This is not needed with the new option in the actual cmake build step.

Change-Id: I3bf8bd4ed96c44223ad401406a168d3c8d07fa23
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-06 10:07:48 +00:00
Eike Ziller
0d8d4322b4 Merge remote-tracking branch 'origin/10.0'
Change-Id: Ie591b7130b33a042509e56701384f8ff4d9cb7f8
2023-03-16 11:57:01 +01:00
Christian Kandeler
76d2e7a4f3 ProjectExplorer: Add infrastructure for source -> binary mapping
Task-number: QTCREATORBUG-28815
Change-Id: Ib692981e92f5a395dbe400c2cd48042479f12c78
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-16 09:50:48 +00:00
Cristian Adam
15e1a64764 CMakePM: Add include presets support
Fixes: QTCREATORBUG-28894
Change-Id: I9359cb85c230f2db02f08427af9832f168a32c41
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-14 14:47:28 +00:00
Cristian Adam
2eb9338be0 CMakePM: fix presets sort assert with MSVC in debug mode
Amends 9deef74d9e

Change-Id: Id4e7fcbfa6bdc8ac65afc2c93510e8389d7e7fe4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-02 16:50:21 +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
9deef74d9e CMakePM: Allow presets inherits for deeper hierarchies
Fixes: QTCREATORBUG-28498
Change-Id: Idea5cdec6ad6acfba289dd77632770b7dfbf64f2
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-12-02 16:23:46 +00:00
Cristian Adam
61fcdcb4a1 CMakePM: Do not crash with invalid build presets
If a build preset doensn't reference a configurePreset, the preset is
invalid but Qt Creator crashes.

Task-number: QTCREATORBUG-24555
Change-Id: Ibf5dd7f1bb165d8b7f392e6a1aaa043548bb0f7a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-11-19 12:55:40 +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
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
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
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
8d99df9a7c CMakePM: remove unused headers, enforce sorting of headers
Used clangd hints.

Change-Id: Iade4de67c1d2e5fdd1a880c5603b31203170ebbe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-11 08:43:09 +00:00
hjk
f974488128 ProjectExplorer: Move makeInstallCommand()
... from Project to BuildSystem.

More direct and less use of Target::activeBuildConfiguration().

Change-Id: I148381d23be0f9ab0750ed1440e1b2b3e25aded0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-06-13 10:22:40 +00:00
hjk
e2e5d67bc3 ProjectExplorer: Use FilePath in installRoot machinery
Helps to get path delimiters right.

Change-Id: Ifaab593a530c667488b7b5e6546041d8c212ece8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-10 14:03:09 +00:00
hjk
eb886ad40b ProjectExplorer: Use CommandLine in MakeInstallCommand
Instead a FilePath/QStringList pair.

Change-Id: I55340795266699e448ec1e17681a5e788eaae37a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-06-10 14:02:50 +00:00
hjk
ebf3144f22 CMake: Shift remaining data to buildsystem
Change-Id: I04518a21ce571399c89608d2e59e746f8e6e0d4a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-05 12:10:28 +00:00
hjk
33a385c4d6 CMake: Shift multiconfig storage from build config to build system
Change-Id: I6f9b6c590975caeea4ad92c61f354d81d4d90431
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 13:35:30 +00:00
hjk
13807ff021 CMake: Drop use of FilePath::mapToDevicePath()
That's implicit in .onDevice() since c82e3cf6a8, doing it twice
is not good.

Change-Id: I8c1d5d31d155d3a7c4af8bd874fbba5ab3e8cf72
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-27 14:24:32 +00:00
David Schulz
665285b981 Docker: Map build directory to device in cmake calls
Change-Id: Ibcd2e1aebac337e880a28a2a22b35d8ca60b6dcf
Reviewed-by: hjk <hjk@qt.io>
2021-10-26 07:38:55 +00:00
Cristian Adam
3922b1a917 CMakePM: Add issue icon and tooltip description on project failure
If a project fails to load it will be displayed with a warning icon.

If the CMake configuration fails and the backup configuration is
restored, the project is also marked with a warning icon.

Change-Id: I95ccc5d171f5b789fe317fbb1da9e13dcd81a5dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-23 08:50:24 +00:00
Cristian Adam
8ed5836746 Project: Remove knowsAllBuildExecutables feature
This is feature is no longer needed.

Change-Id: Ia0798402fcb4c06fb4dd38225359738306211176
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: hjk <hjk@qt.io>
2021-07-01 15:49:01 +00:00
Cristian Adam
2d08b296b7 CMakePM: Remove wishlist comment
The comment is no longer valid.

Change-Id: Ica19e26039e147ccdd77559cc85bfcb5e784b68c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 17:45:13 +00:00
Cristian Adam
20366297ed CMakePM: Keep always created run configurations up to date
Qt Creator will do an update of run configurations after a project
configuration.

If an always created target was no longer existing, it shouldn't be
part of the run configuration.

For some reason this was not the case for CMake projects.

With this patchset if a target's name is changed, the previous target
name is no longer part of the run configuration.

Fixes: QTCREATORBUG-25906
Fixes: QTCREATORBUG-24914
Change-Id: I086a2540eaad9039e41fb48194d5901c7be22be8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:06 +00:00
Cristian Adam
242f2dbeaa CMakeProjectManager: Use buildDirectory instead of "."
When issuing cmake --build "." as an user I don't get to see which build
directory is being actually built.

To make things worse in project settings the build directory field is
disabled and cannot be copied.

Change-Id: Idf862ba1df68cde55e9785c934f67393da6c1616
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-26 11:32:47 +00:00
Cristian Adam
6cbdae8070 CMakeProjectManager: Support for multi-config generators
CMake has multi-config generators like:

  * Visual Studio
  * Xcode
  * Ninja Multi-Config

The first two have different special targets for "all", "install",
"package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE",
"RUN_TESTS".

All of them need to get the build type passed via "--config <build-
type>" and not via "CMAKE_BUILD_TYPE".

The multi-config generators will use only one build directory.

Fixes: QTCREATORBUG-24984
Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-21 09:31:30 +00:00
Tobias Hunger
5350288e45 CMake: Fix includes all over the CMake plugin
Keep internals internal, remove some unnecessary includes, add
some that should have been there.

This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.

This patch also moves some code around that ended up being
in the wrong file.

Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-20 10:05:24 +00:00
Tobias Hunger
74a07f906f CMake: Rename some constants
Rename some constants to get a bit more consistency into the
naming scheme. I am so tiered of missing a constant due to it
not having _ in the expected places!

Change-Id: Ibb5e82ea4e25ccb559352839b96c8a64394f3085
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-17 13:24:43 +00:00
hjk
3c41b91d44 ProjectExplorer: Settle on fixed set of build step lists
Even if the implementation allowed different lists than 'build'
and 'clean', that's the only set that has been used, ever.

If really needed, this could be re-instated, but for now having
them fixed removes part of the neeed for a two-phase construction
and helps to simplify user code.

Change-Id: I3df09a1829a7d020ef8963d358ea80f8d199ba13
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-12-06 14:49:59 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
hjk
6a878c7293 ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the
shift of BuildSystem owner ship as a Project will have potentially
multiple BuildSystem instances (one per BuildConfiguration), but
still be responsible for creating them with the Targets.

Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-25 09:01:52 +00:00
Tobias Hunger
e23f96e98c CMake: Do not delay on manual request to run cmake
Change-Id: I116cf3b41fefbe17237437e8ad4ec0fe91bbf31d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-10-10 08:13:45 +00:00
Eike Ziller
9cc45fe1fb CppTools: Move RawProjectPart to ProjectExplorer
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 06:22:12 +00:00
Tobias Hunger
b7e4046a17 ProjectExplorer: Add BuildSystem class
Add a class to abstract out the BuildSystem from the Project.

Thie idea is to make a Project have-a BuildSystem, so that
it can stop being one.

The Projects in the different ProjectManagers will get much
simpler that way (and many will only consist of a constructor
with some setter calls) and handles all the interactions
between the rest of Qt Creator and the project.

The complex code to interact with the build systems is then
separate from that.

Change-Id: I3bbb000bb1aed91f0b547ac493f743ede8afb8cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-29 07:28:04 +00:00
Tobias Hunger
d115276b34 CMake: Move code from CMakeProject into CMakeBuildSystem
Introduce BuildSystem to implement functionality common to all
build systems out there. This includes things like delaying the
parsing by 1s.

The actual CMake specific code is then moved into a derived
class CMakeBuildSystem.

Change-Id: I84f4344430f19a44e16534db294382c436169ed5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-13 13:13:02 +00:00
Tobias Hunger
ae345003aa ProjectExplorer: De-virtualize some more virtual methods
Use setters/getters for the bool flags in
Project::needsBuildConfigurations() and
Project::hasMakeInstallEquivalent.

Change-Id: I5ce937c3a5e8e0db627cda02a9007f8c28ccda0c
Reviewed-by: hjk <hjk@qt.io>
2019-08-13 10:24:30 +00:00
Tobias Hunger
a90b1c26b1 CMake: Remove CMakeProject::buildTargetTitles
The only user can also get this information from the relevant
CMakeBuildConfiguration.

Change-Id: I80e176ef0a8bc427f6adbf75b20e29f38d7b949f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-08-12 14:23:58 +00:00