Commit Graph

83 Commits

Author SHA1 Message Date
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
Tobias Hunger
e5f4cfbeb8 CMake: Do not default to CodeBlocks extra generator
Now that CMake without server-mode or file-api are no longer
supported in Qt Creator, there is no more need to push for the
CodeBlocks extra generator which was required for the
"tealeaf" reader only.

Change-Id: Iec280d960b9f50ee6f9b954ecc532745a62213f5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-03-05 12:50:18 +00:00
Orgad Shaneh
4dcc480865 Merge remote-tracking branch 'origin/4.12'
Change-Id: I5de0b3e1940998d4aca79b1698ef408ae4d43e69
2020-03-05 11:32:27 +02:00
Eike Ziller
abd4d68696 Merge remote-tracking branch 'origin/4.11' into 4.12
Change-Id: I00ccdc2c79176799fe9d20ecfe42c260796d7d97
2020-03-05 09:36:40 +01:00
Tobias Hunger
8e47fc18a6 CMake: Pick Ninja generator when installer added ninja
Pick the Ninja CMake generator when the installer has installed
the ninja binary.

Task-number: QTCREATORBUG-23650
Change-Id: I966b369513e7d489161b210819832f1bbbb5a0fc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-05 08:31:46 +00:00
Eike Ziller
61dc14b67f Merge remote-tracking branch 'origin/4.12'
Change-Id: I3e7049da2c3da6f784e3cb3407c22ada556e5d24
2020-02-26 08:35:05 +01:00
Kai Koehne
fda9955df0 Globally disable WindowContextHelpButtonHint
Do set the global application flag AA_DisableWindowContextHelpButton
to avoid having to unset the default WindowContextHelpButtonHint
in every single dialog.

AA_DisableWindowContextHelpButton was added in Qt 5.10.

Change-Id: I21fe8bc5ddfa4c01ec7a799b04bfb6ff1c9d6d86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-25 13:26:44 +00:00
hjk
3f68292dbe ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChain
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code.  Plus some code cosmetics nearby.

Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 15:59:12 +00:00
hjk
0334b6e491 ProjectManager: Add convenience Task subclasses
For Compile, BuildSystem and Deployment. Unclutters user code and reduces
binary size.

Change-Id: Ia18e917bb411754162e9f4ec6056d752a020bb50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-20 10:11:59 +00:00
Alessandro Portale
b619c60ff7 CMakeprojectManager: Use Utils::ElidingLabel in GeneratorKitAspect
Don't stretch the kit options page horizontally more than required.

Change-Id: I8eb3855ae48a8a172741b1c42f79b9e05cc7eb42
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-22 11:35:07 +00:00
Tobias Hunger
b489bfd615 BaseQtVersion: remove qmakeProperty(...) getter
Qt 6 will not use qmake to identify a Qt version, so this can not
be part of the public interface of BaseQtVersion anymore.

Provide getters for the information actually read via qmakeProperty(...).

Use the getters whenever possible.

Change-Id: Iadbee80b75e4f8b06caf90e7ed69fae2029b4dd7
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 11:46:43 +00:00
Alessandro Portale
718af236de CMakeProjectManager: Export CMake*Aspect and CMakeConfigItem
Allow other plugins to set CMake specific Kit options.

Change-Id: I038e9fabc3d2cb8cc463adafebecd51b21ef3d05
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-09-26 15:06:41 +00:00
Eike Ziller
ff503740ce Run CMake via canonical path instead of warning
Running CMake via a non-canonical path (including '..' in the path, or
via a symlink) can result in funny errors.

de6faa0f15 added a warning for that
condition. Unfortunately the auto-detection of CMake can return a path
to a symlink (e.g. for CMake from brew on macOS). Also it is helpful to
use a symlink to e.g. manage different CMake versions.

Instead of warning about the condition, and forcing the user to resolve
it manually, simply run CMake via its canonical path when actually
running it from Qt Creator.

Change-Id: I95623b45c5436a6d61c1419b7aba23e2a73a0650
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-08-12 12:54:28 +00:00
Tobias Hunger
de6faa0f15 CMake: Better warnings for strange/invalid CMake binaries
Warn when cmake is configured to use a non-canonical path. This might
trigger problems in CMake itself.

Show this warning in the Kit as well as in the CMake options page.

Also complain other issues in the CMake options page.

Task-number: QTCREATORBUG-22583
Change-Id: I841341db8305f9152543487ce9ceeab2eca0b2b9
Reviewed-by: hjk <hjk@qt.io>
2019-08-05 15:13:40 +00:00
Tobias Hunger
6790238d91 CMake: Do not warn when fileapi-enabled cmakes have no Codeblocks
Do not warn when fileapi-enabled cmake tools do not have the
Codeblocks extra-generator set in the Kit. This is only necessary
for the tealeaf-reader.

Change-Id: Id3aa9df2ec5aa8c2de8b0a5bef8c751e54d72b42
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-25 12:15:40 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
33ea685a91 Directly construct KitAspect::toUserOutput return values
Less dependent on used type and actually saves cycles.

Change-Id: I87344172c330198e98c11205a80862b3b30271e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-28 07:22:55 +00:00
hjk
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +00:00
Eike Ziller
534fcfcd45 Fix Qt version for auto-detected kits
Fixes a regression in d4565be655 that
leads to all desktop Kits being assigned a default desktop Qt version,
even though the installer registered these kits with a specific Qt.

Implementations of KitAspect::setup may not unconditionally override an
existing value, since it is called on the kits restored from the install
settings. This is needed because the installer registers toolchains and
debuggers by referring to them via an ABI ("this kit has a debugger that
can handle this specific ABI"), since the installer doesn't know e.g.
about installed MSVC toolchains itself.
That's why ToolChainKitAspect and DebuggerKitAspect may modify an
existing value in their "setup" method. If this should be moved
somewhere else, e.g. "fix", should be investigated, but in a separate
refactoring.

Change-Id: Ibd99e4da03cd7130c49294f4ac79cd8e346fb1b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-07 13:24:24 +00:00
Christian Kandeler
d4565be655 ProjectExplorer: Drop KitAspect::defaultValue()
The functionality of this function overlapped with KitAspect::setup(),
leading to unclear responsibilities and resulting in bugs such as the
one fixed by 776d54e435.
Therefore, we drop the defaultValue() function, merging its
implementation with setup() where applicable.

Change-Id: Iefa9c3df8b76e97ddf9ad388516621f7ea6558d4
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 14:47:18 +00:00
hjk
470ce8a856 ProjectExplorer: Move use of some knowledge from KitAspectWidget to KitAspect
Essentially a follow-up to 09a7d2bd45.

Change-Id: I4dd9d64eec77ddf9cdccbac808e9a0978b9986bf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-12 13:41:09 +00:00
Christian Kandeler
09a7d2bd45 Move some knowledge from KitAspectWidget to KitAspect
The authoritative source of information about a KitAspect is the
KitAspect itself, not the associated widget.

Change-Id: I72d3d0425b845457846a940350bab59f1ff0cc2c
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 15:15:04 +00:00
Christian Kandeler
ce19540b77 Move KitAspectWidget definitions alongside their KitAspects
A KitAspectWidget class is tightly coupled with the respective
KitAspect, and no one else ever needs to see any KitAspectWidget
subclass at build time.

Change-Id: I1883af3b054c225e1ff5dd913118715bfdbaacfc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 14:39:29 +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
Robert Loehning
4032f6383a Fix frequent typo
can not -> cannot

Change-Id: Ie872ada1bc9b4ed64bffb667c2e44dbb13b4ad11
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-10-23 09:30:20 +00:00
Eike Ziller
c8c6b28e22 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h

Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
2018-05-28 16:10:23 +02:00
Eike Ziller
6e66b2a078 Remove some lambdas from Utils::transform calls
It is often possible to user (member) functions or members directly.
That improves readablility and potentially reduces the total number of
symbols.
Also use qobject_container_cast at places where it is appropriate.

Change-Id: Ia2591bca356591e001e2c53eeebcf753e5bc3c37
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-05-28 13:45:20 +00:00
Tobias Hunger
88b065db3f CMake: Do not crash when deleting cmake tools
Do not crash when the cmake tool that was used to parse the project
gets removed.

Change-Id: Ieda3ae2025dbcfb1f90d9bd01c5f0ed960756c6a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-28 12:36:33 +00:00
Tobias Hunger
3874b6b6ec KitInformation: Improve robustness to nullptr passed as kit
All the KitInformation methods need to gracefully handle a kit that is
a nullptr. Ensure this is indeed the case.

This might fix the actual trigger for QTCREATORBUG-19469.

Change-Id: Id78ac8a26c1be908f41a425ff1935b86888e4b8b
Reviewed-by: hjk <hjk@qt.io>
2018-02-13 08:46:35 +00:00
Robert Loehning
9e066c7b17 Move HTML out of translated strings
Change-Id: I4664427086619f33e9a882eb3f0a5f2f52e1b42a
Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-24 10:18:28 +00:00
Ulf Hermann
47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Tobias Hunger
8b956868bb CMake: Register a feature for CMake-capable kits
This in theory enables to fix QTCREATORBUG-16204, but for that the wizard needs logic to adapt
the required features for the listed kits. That is still missing.

Task-number: QTCREATORBUG-16204
Change-Id: Ia01c11bb8c8567a9fc65b06912d6836b70a0195c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-04 13:27:30 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Tobias Hunger
4f40d7778d CMake: Introduce project importer for cmake projects
Change-Id: Ie215e1c3f0286f6d98d10865e2b0a16b01391cd5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-10 10:34:07 +00:00
Filippo Cucchetto
4b1f8f3609 ProjectExplorer: Added support for registering custom languages
Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-23 11:19:11 +00:00
Eike Ziller
b1f1ccb32e Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: I3484b668f9323ed0c05de99f8dfed07c9e65ab98
2017-01-11 09:29:37 +01:00
Konstantin Podsvirov
ec6587ceb6 CMake: Allow CodeBlocks for NMake Makefiles JOM
Change-Id: I280deb2131959cc538c4af4b7e9b9e07b4f41b80
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Konstantin Podsvirov <konstantin@podsvirov.pro>
2017-01-04 10:09:57 +00:00
Tobias Hunger
5698736284 CMake: CMakeConfigurationKitInformation::setup fix
CMakeConfigurationKitInformation::setup did override the existing value
when it was called. That is not intended, the setup method should only
set a value if none exists.

Change-Id: I86d386982311020dc3dbb3a705e1ff87ad02e09c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-21 14:24:28 +00:00
Eike Ziller
8f0ddff1cc Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/shared/qbs

Change-Id: I5050baa31f4a892d00cd6f7e088d1b597921474d
2016-12-05 10:55:35 +01:00
Tobias Hunger
cae9f70d75 CMake: Do not forget cmake generator information on load
Task-number: QTCREATORBUG-17311
Change-Id: I3439933e396f74a092c9b46aaced0a73c33c4407
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-02 15:33:32 +00:00
Tobias Hunger
c49a0dd502 CMake: Fix generator warning for server-mode cmake tools
Do not warn on wrong extra generators if cmake supports server-mode.

Make the massage point out the missing server-mode while at it.

Change-Id: I643c77fbebe4ba9a7ea6fee28422283118d145dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-15 16:33:35 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Tobias Hunger
156282a97f CMake: Use QT_INSTALL_PREFIX for CMAKE_PREFIX_PATH
QQT_INSTALL_LIBS does not work as intended. That was not obvious since
Qt Creatod adapts the PATH, which had a similar effect, but breaks when
trying to build the project outside Qt Creator.

Change-Id: I36c7caf69a157ae0d4e3dc500265042fd5964681
Reviewed-by: Florian Apolloner <florian@apolloner.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-08 12:08:36 +00:00
Orgad Shaneh
410211e090 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ibb932efece05a5f5613823fbc79c5b7601c73905
2016-11-02 16:52:58 +02:00
Leena Miettinen
447a4a45b8 CMake: Fix UI text capitalization
"Generator" is written in lower case in the existing strings.

Change-Id: Ibef67f3f8c4a0aa5a0fa04f68e6b10fb2251d3ef
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-01 14:28:13 +00:00