Commit Graph

106 Commits

Author SHA1 Message Date
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
hjk
6d723dfa6f ProjectExplorer: Remove arguments from node change signals
This discourages storing the pointers needlessly. The items
are still easy accessible by the static ProjectTree::currentNode()

Change-Id: I3c0cd019e9fdc382afacbc9d9de3b97d5f58ae1e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-24 13:17:46 +00:00
Tim Jenssen
6bf4157491 CMake: fix not disconnected build action
The old code was disconnecting all signals from CMakeProjectPlugin
to m_buildTargetContextAction. The result was more and more triggered
actions.

Change-Id: I8d7db5852c03d5388870a7460efb3a8a28fd0749
Reviewed-by: Florian Apolloner <florian@apolloner.eu>
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-12 10:20:54 +00:00
Tim Jenssen
b91632e642 CMake: fix crash while clicking context menu
It crashed if the root project had some error
and I tried to build a subproject.

Change-Id: I13dc620402a5f79e507e7da3fedb5eb09a4112da
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-12 10:20:35 +00:00
Tobias Hunger
53d45de8a0 CMake: Allow to build target from context menu of CMakeTargetNodes
Change-Id: I0457abd6dabea1699272482eb5f7fbb3ca097310
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-15 09:30:59 +00:00
Tobias Hunger
9252a3ae44 CMake: Add fileoverlay icons for cmake project files
Change-Id: Id9b8aa9b1902e6f88ca4e8bde2e5f20281a77437
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-11-10 16:05:59 +00:00
Tobias Hunger
59bab5e0ac CMake: Add CMakeSnippetProvider
This allows to define snippets for CMakeLists.txt files. They can not
be used yet:-/

Change-Id: Iad68632798ecfe04018d08d284f9b5a8b0e564ee
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-23 12:12:37 +00:00
Tobias Hunger
859bf2c5ce CMake: Do not run a cmake wizard all the time
Do not push the cmake running straight into the face of the user. Do it
in the background instead.

This needs some follow-up patches to become really useful.

Change-Id: I3457178b33e3f14bdeac25005a773d17abb73b65
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:04:45 +00:00
Tobias Hunger
18afa34587 CMake: Add CMakeConfigurationKitInformation
Add CMakeConfigurationKitInformation and supporting classes.

This KitInformation can hold CMake settings that are to be applied
for all configurations when this kit is used. It contains e.g.
the Qt version and toolchain configured in the kit by default, but
can be extended to hold more.

The UI will warn if the toolchain or Qt version set up in CMake
does not match up with those used by the Kit, but it will allow
the user to proceed.

Change-Id: I73f06a6535ce14de323130d74af83b9cb2ec0f0f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-12 13:31:10 +00:00
Tobias Hunger
593ed52c94 CMakeProjectPlugin: Clean up some headers
Change-Id: I8ded721395b72bb1c1e6a563f7ebb98389d39236
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-12 11:12:37 +00:00
Tobias Hunger
a764bb49d8 CMake: Add CMakeGeneratorKitInformation
Change-Id: I877c248c7b93268281fc68e814e479d24b844d5f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-12 11:02:16 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
b2b6d3c526 CMake: Semi-automatic cleanups
* Shorten header guards
* Use override and auto where possible
* Remove useless destructors, etc.
* Remove private slots sections, unify private: sections
* Use member initialization where it makes sense

Change-Id: I00eaf6d706adc16859176d1b68c631d3336bb39f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-01-08 12:17:41 +00:00
Tobias Hunger
e4cdad309d CMake: Move MakeStep to CMakeBuildStep
Change-Id: I2a3432acd90cc27fb444ab30c3239497a51e01df
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-01-08 08:46:58 +00:00
Tom Deblauwe
f6fcfb4c9a CMake: add preload cache cmake script file per kit
Change-Id: I51c33610f2eb300ef5de2e565c567d799eddc9cf
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-26 12:37:54 +00:00
Benjamin Zeller
bebcf69ce9 CMakeProjectManager: Provide way for plugins to autodetect cmake tools
This patch adds support for plugins to register a callback/lambda
to autodetect CMakeTools that would not be found by the default auto-
detection function. Without this feature the CMakeToolManager would
drop autodetected CMakeTools otherwise on every start.

Change-Id: I23b146e5b9acc60018ac87ea4b6cc7573fa0dd30
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-09 16:15:28 +00:00
Benjamin Zeller
1e2d266541 Make CMakeTool known to the Kits
This patch adds support for binding a specific CMakeTool to a Kit.
When creating a new Kit or loading a existing one without a valid
CMakeTool, the default CMakeTool will be set.

Change-Id: I28d0843a01c583c4b31fc680a0ec556b40cd9c0d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-03 12:47:36 +00:00
Benjamin Zeller
99e9643dea Make it possible to register multiple cmake instances
This patch add the CMakeToolManager, a central repository for cmake instances.
One instance is always the currently used "default". By that its possible to
switch between different cmake installations. The next step will be adding
it to the Kits.

Change-Id: I310fdd805e0ed239077a5632303e891dbd1d9ea1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-02-24 09:54:43 +00:00
Eike Ziller
5a3a940ad3 Use new mime database
Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-17 13:00:07 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00