Commit Graph

182 Commits

Author SHA1 Message Date
Cristian Adam
6b6b1198dd Utils: Fix inverted logic for checkableDecider
`BoolAspect::checkableDecider` was used only in CMakeProjectManager for
askBeforePresetsReload and askBeforeReConfigureInitialParams.

Now the checkbox with "Ask before presets reload" would also match with
the display of the message box.

Change-Id: I45fc7a977dbeb13df051375bd3dac36e7be7bdc4
Reviewed-by: hjk <hjk@qt.io>
2023-06-29 14:59:07 +00:00
Eike Ziller
3825b9f2cc CMake: Some UI/tr fixes
Avoid the order "Label [ ]" for checkboxes, we changed all cases to the
standard "[ ] Label" because it looks very ugly and confusing the other
way around. Also move the corresponding directory setting to the next
row, which is not ideal but still looks better.

Improve message about reloading presets.

Change-Id: Ibcd26e24a2a4cd3ea5ca819f74e78edb40f46072
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-06-15 10:02:36 +00:00
hjk
d740a355bb Utils: Rework CheckableMessageBox
Remove function overloads, thes are hard to read, to use and to extend.
I'd even argue this should be a plain default ctor and a few setters +
exec(), pretty much like Process::start() nowadays.

Move "decider" magic into a structure that can be filled ad-hoc outside
checkablemessagebox.cpp paving the ground for:

...removing  aspect dependency from CheckableMessageBox, Instead, add a
convenience function to BoolAspect.  Arguably, the latter is not needed
and could be done on the user side.

Use pointers instead of mutable references for in-out parameter.
Makes the "specialness" visible on the user side.

Pass ICore::settings() centrally as done elsewhere to reduce line noise
on the user side.

Change-Id: Ibb366353d1ea35401723fd05ce05672617a0a8fd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-22 06:40:13 +00:00
Marcus Tillmanns
1fc2459b62 Utils: Unify CheckableMessageBox and make it look more native
Change-Id: I5690c16f38cfd2058e01441283bec28d44cadf75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-17 08:01:13 +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
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +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
hjk
e42d24fca9 CppEditor: FilePathify some of the refactoring operations
... and adjust surrounding code.

Change-Id: I1d36e5a0c6ba14a1d9b8fd59340f1bb2a1e45ad1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-16 14:27:50 +00:00
Jarek Kobus
d0e24654f6 CMakeProjectManager: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Remove some unneeded lambda return type specifiers.

Change-Id: I9695367d66a151f2611554b9fe5897c1bac7ef5c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 15:28:50 +00:00
Orgad Shaneh
da0cb254b2 CMake: Support Build File also from header files
Fixes: QTCREATORBUG-26164
Change-Id: Iaa2fdd34cffad07be668ca7142a8ffa2c373d325
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-12 17:28:49 +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
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
Cristian Adam
63fcd6812b CMakePM: Disable "Run CMake" menu entry while building
Configuring a project during build is a recipe for disaster.

Fixes: QTCREATORBUG-26606
Change-Id: I041d9bd76315647439100cadba809d6664d268fa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-26 15:58:22 +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
Tasuku Suzuki
3bd490acdb Improve grouping and order in the build menu
Build related menu items are sorted by tasks, then configurations.
e.g.
+ Build
  + Build All Projects
  + Build All Projects for All Configurations
  ...
  + Rebuild All Projects
  + Rebuild All Projects for All Configurations
  ...
  + Clean All Projects
  + Clean All Projects for All Configurations
  ...

This patch changes the order to configuration > task like below

+ Build
  + ...
  + qmake / cmake
  + -
  + Build All Projects
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build Project
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build Subproject
  + Deploy
  + Rebuild
  + Clean
  + -
  + Build File
  + -
  + Build All Projects for All Configurations
  + Rebuild
  + Clean
  + -
  + Build Project for All Configurations
  + Rebuild
  + Clean
  + -
  + ...

Change-Id: I95844e51d2ae164ed9f29fdb1c51509611c514fe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-25 14:57:37 +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
Eike Ziller
c5a70e7daa CMake: Use new MessageManager API
Flash when CMake is started, write all other output silently.
This avoids re-popping up the general messages pane all the time.

When an error occurs, that is put into the issues pane, so no need
to pop up the general messages pane for that either.

Task-number: QTCREATORBUG-24430
Change-Id: I07ae4182cbc43147fbb343b360baf9da7e65f224
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-04 10:52:52 +00:00
Leena Miettinen
bced4a746c CMake: Fix UI text capitalization and punctuation
Change-Id: Id4adc0671357c646cbed5df3667addfc95130b73
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-02 11:20:05 +00:00
Tobias Hunger
346b28f5f9 CMake: Add a command to trigger parsing of CMake reply file
Add a command to trigger the parsing of a given CMake file-api
reply file. This is important to have to help with debugging file-api
issues like QTCREATORBUG-24044.

Change-Id: Iadaa5cf01b9b6ddddf4e6ad669bb05928c6f29a5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-06-11 12:35:47 +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
021cab2048 Utils: Introduce FilePath::operator/(const QString &)
Including some random uses.

This mimics  std::filesystem::operator/(std::filesystem::path).

Change-Id: I0b0f5cf0d962fd33d4cbb9be96645a0b4a21ee03
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-09 07:48:22 +00:00
Tobias Hunger
a8b96a8240 CMake: More logging of parsing starting/stopped
Change-Id: I52dad9260c21e03add513f7229148635ae76236a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-10 09:16:22 +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
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
Orgad Shaneh
b500119fd7 CMake: Support building a single file
Fixes: QTCREATORBUG-18898
Change-Id: I0ec24b20bfa8d43093b6e6681ddd752fbdea2088
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-29 20:09:24 +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
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
02533e61cf CMake: Fix project parsing notification
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.

Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-06 09:53:40 +00:00
Tobias Hunger
08677c0b01 CMake: Quieten soft-assert on small project loads
The directory tree scanner and the project parsing work independently of
each other. Add logic to combine these two sets of results into one
parsing state.

Change-Id: I46e94f0e866b40ee7225235c536c742cecf11b45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-26 14:31:25 +00:00
Leena Miettinen
8410c0bbad CMake: Fix UI text capitalization
Change-Id: I590343937f8fbe0df2c664e0e7e4c2ce353c1897
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 12:31:04 +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
hjk
50d1690854 ProjectManager: Centralize "File not found handling"
That's the only error that was ever checked for, in all nine
project manager. In the hypothetical case that we'll need something
else than the name of a file to identify a "project file", we'd
probably need to touch the signature anyway. Until then, remove
the duplication.

Change-Id: Iba00b8f71309a908e2d29c0a58c50b685eca0cae
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 16:14:35 +00:00
hjk
4d3d2d0dfb ProjectExplorer: Remove Project manager parameter from some constructors
Can be done generically when creating projects. The only wart is
the use from BaseQmakeProjectWizardDialog::writeUserFile.

Change-Id: Ie98c9f88ec142e82443e204a0075e3ae9e163752
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 14:56:21 +00:00
hjk
8b5b1f1de7 CMake: Move CMakeProjectManager::findCbpFile to tealeafreader.cpp
That's the the only user of that code.

Change-Id: Iabc6a1fa9a4ad05c467e8ed64386d3185de25f02
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 11:59:07 +00:00
hjk
18fe7b3c7e CMake: Remove unused function CMakeManager::createXmlFile
Change-Id: I084b5dd4f07d709fdf5a1fd65884df8c741bbb86
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-27 15:24:28 +00:00
Alexander Drozdov
dfaf01614d CMake: make project file system tree scanner persistent
Project source tree is a same for all build configurations so it is
a good idea to keep it persistent between CMake runs, configurations
switches and so on. It safes a lot of time for big projects.

Move more operations to the scanner thread:
 - Nodes filtering: skip .user files on top level of the project, skip
well-known extensions and octet-streams: In most cases these are not
required to be shown in the project tree.
 - Nodes sorting

Fix small memory leak: we have .user in the scanner result. After this
node filtered out, but is not feed (old code at the
BuildDirManager::generateProjectTree()). Now .user file skips during scan
without memory allocation at all.

Allow user manually rescan project tree by call Build -> Rescan project
tree. It runs CMake and Tree Scanner together: in most cases only CMake
run requires but time to time (VCS update) full rescan also required.

Change-Id: I4a6e6c897202da557509291c79932dd7751860e5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-13 21:16:56 +00:00
Tobias Hunger
683b965297 CMake: Encapsulate BuildDirManager in CMakeBC
This will make it easier to introduce a new type of BuildDirManager
to accommodate cmake server-mode.

Change-Id: I989aab9df44dff1cfdff226ef97bb30bb092ffdd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:59 +00:00
Alexander Drozdov
93c1840740 CMake: omit configuration dropping on cache clear
Setting CMake configuration to the provided by the Kit, drops all users
settings to the default one. CMAKE_BUILD_TYPE too.

Change-Id: I8be556f553376273933872a74e47937df5a74f30
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-17 22:26:31 +00:00
Tobias Hunger
d122c34c96 CMake: Add ability to force CMake cache clear
Some CMake parameters changes requires to clear cache and run CMake
from scratch. Add ability to force it from the CMake configuration
dialog.

This change based on the work of Alexander Drozdov.

Change-Id: I21d8e12eec7e1f7bca560f44c43f25e4f333fcf0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-10 15:22:55 +00:00
Tobias Hunger
5c5e5a3aae CMake: Remove "Prefer Ninja" checkbox on CMake Tool page
This is no longer needed now that the generator is a property of the
Kit.

Change-Id: Ife35fd9207c805a4ead1e067603df1bfc77e6855
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 11:06:24 +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
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
f539ff1fcf CMake: Document all arguments passed to cmake
Do not leave out -Csomething (set by the kit) or the generator used
(set by the wizard).

Change-Id: I41cfb935da2877deaa26ae84bfdd96948fa20763
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-11 15:33:41 +00:00
Tobias Hunger
8146402e05 CMake: Use Qt5-style connects
Change-Id: I5ec451b55237fcceca86f0134ae081b435dab5c5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-08 13:33:44 +00:00
Tobias Hunger
1d6c960f05 CMake: Avoid passing CMakeManager around
Change-Id: I96d7f3785767d1d56ca27a2d0af778edf98d63e1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-01-08 12:50:26 +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
e26617c3ed CMake: Simplify setup of CMakeOpenProjectWizard
The information is contained in the BuildInfo, so there is no
need to provide it a second time.

Change-Id: I512d148e36996130fab6d8e007dd16d5acebaebb
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-01-08 12:17:24 +00:00
Tobias Hunger
ca6144f0d6 CMake: Fix cmake preloadCache file support
* Make it work at all again for cmake configurations without a
  preloadCache file
* Fix the KitInformation to provide the getters/setters like all
  the other KitInformation do
* Use those setters consistently
* Remove useless conversion from QString to QByteArray and back

Change-Id: I8fc43b3531da2c04034c89b29915a29c331fe064
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2015-10-29 16:21:18 +00:00