Commit Graph

125 Commits

Author SHA1 Message Date
hjk
109ec1e443 CMake: Hide CMakeManager implementation in .cpp
Change-Id: Ia66d73cd060d17c2d25a1d5b89155ab4e7a6b62b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-01-26 12:31:05 +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
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
55b5b8a975 CMakeProjectManager: Fix connection to save tools settings
Amends 4e23f2a6eb.

This should actually not be needed in the end, and rather steered
by the auto registration and settings page apply.

Change-Id: I7f94e776fec4394f539e32e5c527c367251654a8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-23 10:47:10 +00:00
hjk
4e23f2a6eb CMakeProjectManager: Hide kit aspect factory implementation
Also avoid re-instantiation of factories in the build configurations.

Closer to the setups of the other kit aspect(factories).

Change-Id: I1b74a68287b63ee94ff18106d3a00b23624a601b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-22 12:56:12 +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
e9266f53ec CMakeProjectManager: Rename some of the KitAspect related classes
... and split out the static interface.

Change-Id: I28cdb2765a00d1bd19790f46a3b2b0da8690e929
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-11 07:00:37 +00:00
hjk
c326f049dc CMake: Prepare postponing formatter settings creation
This is still an overall quirky setup.

Change-Id: I7c1d22267bb76d434fe2f9b77ed8d0bfef5ac952
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-27 12:08:01 +00:00
hjk
3e155919eb CMake: Use current pattern to access main settings page
Change-Id: I95c556bebe1d583879b6702f727d9a859b9a4bcb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-07 12:57:27 +00:00
hjk
9dad4ab9d4 CMakeProjectManager: Rework CMakeFormatter
Use PagedSettings, make setup more local, remove Q_OBJECT

Change-Id: I9e91f9e63ed8ad15749323bd039d118562dba1a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-15 11:21:45 +00:00
hjk
72e30b69c5 CMake: Use new PagedSettings
More compact.

Change-Id: Ie800e52b98d23e1acd1deba9d6b6e5f778c016bb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 15:22:39 +00:00
Jarek Kobus
7ce40a7691 CMakeLocatorFilter: Remove the old matchesFor() implementation
Since the base class vanished, rename the filters so that they have
the common prefix now.

Change-Id: I164c7c17229f5c5b05649afe9e7aa79069a82f82
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-10 12:34:42 +00:00
Alessandro Portale
9db70d8810 Translations: Fix stray QApplication::translate() calls
For references to the module-own context, use Tr::tr().
For references to other modules, use the right context name (with "::"
prefix).

Change-Id: I6dce8f1ceccb23c44d93f1826402cd3be8e98e5a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-08 08:32:42 +00:00
hjk
87c3f08e52 CMake: Move settings storage closer to class implementation
Simpler in use.

Change-Id: I8cc929001035974b9b73566b206410bfd77f73a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-23 14:49:45 +00:00
hjk
118b84ffd6 Use simpler Plugin::initialize() when feasible
Change-Id: I567965d266f20526bda9f823e31a04b354d53fb1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-20 12:13:10 +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
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
92ab0c7f13 CMake: Fix startup warning
Accessing MimeDatabase for text/x-cmake before plugins are initialized

There is not much use for using QMimeType internally anyway, since they
are effectively only used as strings.

Amends ac2ca7244a

Change-Id: I4d7b1bb2f0ad4e857409e3ef287f5b9abe052193
Reviewed-by: Xavier BESSON <developer@xavi-b.fr>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-12 15:26:29 +00:00
Xavier BESSON
ac2ca7244a Beautifier for CMake files
Fixes: QTCREATORBUG-25773
Change-Id: I30df110512553b28894427e4d473814400153923
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-09 15:23:31 +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
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
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
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +00:00
Cristian Adam
531288a715 CMakePM: Group CMake settings into one category page
CMake settings were split in two places, which complicates things.

Now they are both into one settings category, just like other build
systems Qbs, Meson.

Change-Id: I55f434d83604c9b3be111fc89014b720ee72b513
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-08 19:02:42 +00:00
Eike Ziller
2e09518e9c Pass the new node in ProjectTree::currentNodeChanged
Avoids some roundtrips asking for ProjectTree::currentNode()
which traverses the project tree every time.

Change-Id: I650728eab5a47a7f4760cf88844a4b7106365255
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-28 06:55:51 +00:00
hjk
beda749326 CMake: Aspectify CMakeSpecificSettings
Change-Id: I2e094c5a392964fdaf49ac30c2e0ae0f57a3b11d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-26 12:40:08 +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
fae66e781a CMake: Use IOptionPage convenience pattern
du -s .obj: 108344 -> 106748

Change-Id: I3c3ce0af0f0ba2e32e349d38e8a0a24feeb57485
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-14 11:01:29 +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
923027537a Cmake: Cleanup initialization
Change-Id: If3ee26bb7d6995405f706bd9c78460fb744b5136
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-10-29 14:28:50 +00:00
hjk
07a918c89a Unification of desktop run configurations, step 1
First step, move {DesktopQt,Qbs,CMake}RunConfiguration{,Factory}
into the same new files.

This only moves down to QtSupport, not ProjectExplorer, as there
are in all three cases direct dependencies on QtSupport. Long term
I would expect them to move further down.

Change-Id: Ib16b19df7f3f642ed7f7db89a1f6904601d976ba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-08-07 10:35:41 +00:00
Tobias Hunger
d9cf17bbda CMake: Add locator filter to open CMake target definitions
Add a "cmo" filter to the locator that will open the CMake target
definition in the editor.

Note that this is based on the target data extracted from cmake. For
tealeaf-reader and server-mode this information is guessed based on
the targets source directory (plus CMakeLists.txt). These modes will
just open that file.

For fileapi the information is accurate and based on the backtrace
that comes with the target information. "cmo" will open the exact
file/line from the backtrace here.

Task-number: QTCREATORBUG-18553
Change-Id: I4ee0eb25d1d763bd0d8033e506bf85cb2bc1f2dc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-25 12:22:05 +00:00
Tobias Hunger
979b0463e8 CMake: Split up cmake's locator filter
Split up CMake's locator filter into a part that contains all
the logic to find targets and a part that handles the action.

This is so that the code used to search for targets can be reused
later.

Change-Id: Ife6c9fe6a6f1955bedaa1b9298630c052e17c33f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-24 14:58:13 +00:00
Tobias Hunger
efc89ff60d CMake: Rename CMakeLocatorFilter to CMakeTargetLocatorFilter
Make virtual function implementations final while touching the file.

Change-Id: I94c44ee3efbc9beb39789dd198ee607791a9a44d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-24 14:57:59 +00:00
hjk
a5148b5363 ProjectExplorer: Rename ProjectTree::findCurrentNode to currentNode
For consistency, it's straight forwards access, similar to
currentProject, not much to search and find.

Change-Id: I7ce696bdc24b6a8713d6f11e02443a6f94c605f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 17:10:39 +00:00
hjk
841bbfa7bf ProjectExplorer: Switch order of template parameters
... of SimpleRunWorkerFactory.

This requires being explicit about the SimpleTargetRunner worker
default, but makes the template re-usable for current users of
RunWorker::registerWorker() which I would like to phase out now,
for less variations in the RunWorkerFactory setup.

Change-Id: I32638437e5bb29f143650f5fde706711ab25accf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-02 09:46:48 +00:00
Christian Stenger
5944c7f0f6 CMakePM: Fix order of initialization
CMakeToolManager instance must be created first to avoid connects
to a nullptr.

Change-Id: If8738a26d58c80ffc9a63193240895f1bc9a87ae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-20 05:47:40 +00:00
hjk
1bc10248c0 ProjectExplorer: Introduce a SimpleRunWorkerFactory template
... and use in as replacement for RunConfiguration::addRunWorkerFactory.

It is still convenient to have a simple way to set up run worker
factories for the typical "just run for this configuration" case,
but it's even better if it follows the nowadays predominant pattern
of keeping factories in the plugin's pimpl.

Also, it turned out there were two copies of
QmlProjectRunconfigurationFactory code, one is enough.

Change-Id: I0b28c4ea18d0f52165a49f6133dc8687a3b9c7cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-19 15:56:17 +00:00
hjk
fb4d8b5a01 ProjectExplorer: Make kit aspects self-register
Also, construct the KitManager implicitly when the first
KitAspect is created. Ramp-down is still explicit and
somewhat odd.

Change-Id: If1506e1d0789ecabbaad2d8008851d0b42c5218b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-18 14:14:28 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Alessandro Portale
17f169c291 CMakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using

Change-Id: I6a272bc3b75835840b3d6cbe83be6f50f94bbedb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-11-25 07:50:15 +00:00
Tobias Hunger
05fb67fee7 ProjectExplorer: Use unique_ptr to store KitInformation
Change-Id: I406b6bed005fb7455e6ee41d81a2f314584a051a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-11 08:29:19 +00:00
Pawel Rutka
190c5083b7 Add Specific settings page to CMakePLugin and create checkable dialog box for user after add new file action
Change-Id: If5702764fa81f2fdda3ef59780b217e47643b030
Reviewed-by: pawelrutka <prutka13@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 10:49:45 +00:00
hjk
9a3dff8934 CMake: Pimpl CMakeProjectPlugin and avoid use of global object pool
Follows the recent pattern.

Change-Id: Ib91fb8e6ab343b5e595b9ed470daa3e55999f37c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-02-20 12:40:46 +00:00
hjk
b2a16190e8 Use project id uniformly as project context
The possibly intented flexibility e.g. to have different project types
share the same idea of a common context was never used, in all cases
we had a 1:1 relation ship between project ids and ids that were used
as context. This led to oversights like the one fixed in 60fb35a2.

This patch here uses the project id unconditionally as context and
drops all context ids. If we'll ever have the situation where the
original flexibility was needed, Project::projectContext() could be
made virtual and overridden were needed.

Also, the context was never modified for any given project, so the
updating machinery is not needed.

Change-Id: I3f7fac0ed5e4704e126558987c48577f26082dfd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-12-20 12:35:14 +00:00
Tobias Hunger
45046f7071 ProjectNodes: Do not derive Project Nodes from QObject
That should save some memory per node, and since creator has a lot of nodes
(e.g. opening the LLVM project adds about 1 000 000 nodes) this should be
noticeable:-)

Calling update inside ProjectTree::currentNode() and rename it to
findCurrentNode() to make sure it is an still existing pointer.
Also, try to reduce the somehow more expensive currentNode() calls
and sprinkle some const around that usage.

Change-Id: I6a7c5db01a71d53d39544d3013cad557d5b96cdc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-08-01 11:24:53 +00:00
Eike Ziller
9443f7104b Remove the need to create ISnippetProvider subclasses
Change-Id: I1810aaa945136d9726a66dad41377429a6adc8e1
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-25 12:03:08 +00:00
hjk
c1bfc5d8ec ProjectExplorer: Follow up on too-much-magic in IProjectManager
Use a ProjectManager::registerProjectType<Project>(MimeType) function,
removing cryptic IProjectManager object ownership.

Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 10:41:33 +00:00
Eike Ziller
d64e17ad55 Move mimetype definitions to plugin specs
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
  registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
  handle a mime type if it was enabled

Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 13:54:59 +00:00