Commit Graph

49 Commits

Author SHA1 Message Date
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +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
2c4553366c docker: Correctly initialize Kit during autodetection
* Added returning the Id after detecting CMake so it can be set in the autodetected kit
* Trying to keep autodetect from adding the same Qt installation twice if qmake is linked in /bin and /usr/bin
* Added FIXME for RunControlPrivate::runConfiguration as it is used after free in rare cases
* Fixed IosCompilerDetector to not just run if a device is set
* Fixed QnxCompilerDetector to not just run if a device is set
* Fixed auto-detected debuggers not being set as auto-detected, as they now can be removed from the device screen

Change-Id: Ia7772c454d70e147e4326efacc4a6a888fa26782
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-04-12 14:15:45 +00:00
hjk
16c25d99c8 Docker: Provide a means to select search paths for auto-detection
A combobox in the device dialog to select between the (docker image's)
system path and a semicolon-separated set of user defined paths.

Use it for cmake and gdb detection; qmake and toolchains currently missing.

Change-Id: I3c478ca914a1bf02dcb69ebcb9ea6e358d24aaf9
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-14 11:15:21 +00:00
Christian Stenger
1cc50c8dcc CMakePM: Prevent device cmake becoming default
When auto-detecting cmake on device ensure any found
cmake will not end up as default cmake as this would
update even desktop related kits to use this if they
had no cmake configured before.

Change-Id: I27960fc1f76d95bd7ddef6bff40f163aa46a610d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-09 13:48:07 +00:00
hjk
57a90b019f Utils: Introduce a FilePath::searchInPath() convenience function
Diverts to searchInDirectory(). Use it in some places.

Change-Id: I9e5642f0ae0ed4dd9fb9f34bcaa11a25bd26c690
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:56:24 +00:00
hjk
a78665ede7 Utils: Rename FilePath::searchOnDevice to searchInDirectories
Makes it a bit clearer that there's no magic path use or similar
beyond this point.

Change-Id: I86c06850d16bf777db05ad23b540d8096926c059
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-12 08:29:09 +00:00
hjk
cb23530798 Docker: Add a button to list auto-detected kit items
Helps to understand what's going on.

Change-Id: I5b8c591cbd60227cf250932c8654063236eec05f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 06:44:21 +00:00
hjk
d06c670504 Utils: Introduce a FilePath::withNewPath() convenience method
It's effectively the mirrored version of onDevice() with an
equally odd name which is a bit more straightforward to use
in some cases.

Change-Id: I0cfedeb58871a857c93144e2a0d734bad1bcd887
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 11:13:14 +00:00
hjk
f8c7d2e848 Docker: Rework auto-detection and removal of kit items
- Use more uniform messages for the different kinds of items
- Remove all auto-detected items

Change-Id: I0b0df0bca484337039432b163bd8e19593b1cd22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 12:55:53 +00:00
hjk
a4c05f585f Docker: Move some cmake detection logic to cmake plugin
This make the code better re-usable from other places that
wish to put a cmake version into a new kit.

Change-Id: I1ef7770a7f8efa36e88b2f3862b011fecd38de98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 09:41:30 +00:00
hjk
6d26f4f5b0 CMake: Allow autodetected tools to associate themselves with kits
Change-Id: I5b48ddf36ba1b9c4eb6476017be63c4d43b60627
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 13:57:36 +00:00
hjk
8ffeecc633 Docker: Simple Auto-detection for cmake binaries
Change-Id: Ia7e6f648c99c87786604cb8801c1408b9e231d3d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 08:10:03 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +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
e38ccf16cd CMake: Make use of CMake-provided .qch files
* Have UI to select a .qch file location in CMake Tool setup
* Auto-detect CMake's .qch file in its default location (relative
  to the cmake executable)
* Register the .qch files with the HelpManager

Task-number: QTCREATORBUG-21338
Change-Id: I4057eec42c39535012d9f0daf788fc62ef20d544
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 10:40:03 +00:00
Eike Ziller
b61a5b759b CMake: Remove unused function
Change-Id: I6b793e0cb01b989f3087dcefe091b77bcfebe370
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-08-12 12:54:19 +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
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
Tobias Hunger
abc177efbc CMake: Use SettingsAccessor to read/write CMakeTools file
Change-Id: Idcb0d97c8ef4037ea97d8498f935f8631ca30bc5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-10 09:00:14 +00:00
Tobias Hunger
58ebcbe0ec CMake: Use unique_ptr to store CMakeTools in CMakeToolManager
Change-Id: I4dfb76b40e22da745b80c359d544fa2b6d3dac52
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-10 09:00:06 +00:00
Tobias Hunger
ccfb7c6aa4 CMake: Make handling of default CMakeTool more consistent
Change-Id: Idc2ba2c51122855f0b335f89ca5f916dea7665c5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-03 08:33:37 +00:00
Tobias Hunger
a15a7052c4 CMake: Simplify CMakeTool registration in CMakeToolManager
Change-Id: Ida5e6aea8c39ef21f535e06c8fed11b130f875e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-02 09:54:34 +00:00
Tobias Hunger
2127f96f5f CMake: Remove CMakeTool::addCMakeTool method
Change-Id: I9c6abb58711acc14ae78d79b6f077034389c0a6f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-02 09:54:26 +00:00
Tobias Hunger
dca645f4c0 CMake: Fix header-related issues in CMakeToolManager
Just reorder some lines, make it clearer where the headers are actually
used.

Change-Id: Iec5cf98e7cfad7ee1bdd98df85df38b03c54dff4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:43:11 +00:00
Tobias Hunger
1c014c7573 CMake: Remove handling of legacy settings for CMake
Remove the code that reads CMake tool location from the Qt Creator settings
and then removes them from there.

This code was added in QtC 4.1 to ease transition to the (back then) new
cmaketools.xml settings file.

Change-Id: Ice96628159f4171716882cfdefc8991ec2341556
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:43:03 +00:00
Tobias Hunger
9c1fd4c2aa CMake: Move CMakeTool merging into separate function
Change-Id: I7c70e0aa09def8c7483d183791a76e56be18a0a4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:42:51 +00:00
Tobias Hunger
f5d51dcb69 CMake: Simplify restoration of CMakeTools a bit
Change-Id: If62acc96bb64e8e0c2767e35d4f2bca43cc23c65
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:42:41 +00:00
Tobias Hunger
be7109d732 CMake: Move code around a bit
Change-Id: I6129ee26ddd6ef2af713ad249dc884e63c1d5d6e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:41:56 +00:00
Tobias Hunger
88438a0e79 CMake: Small simplification
Change-Id: Ib89f95febeb45628e99e3c6a473853da4dcde3d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-29 13:41:49 +00:00
Tobias Hunger
8128d89a0b CMake: Remove cmake autodetectionhelpers
No user in-tree and the Ubuntu SDK for which this code was added
is no more.

Change-Id: I5b0c5f6faccf1adb451c4043378a204bfc350e50
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-27 13:07:43 +00:00
Tobias Hunger
73f617ab34 CMake: Simplify code
Emit signal in addCMakeTool method directly instead of later.

Change-Id: I4640ffdf76d22f80a8c1ee14f8d79cc7885ddd70
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-06-01 14:03:19 +00:00
Eike Ziller
f42ea09b74 Do not construct settings/resource paths from QSettings object
These paths are controlled by ICore.

Add ICore::installerResourcePath() to replace constructions with
settings(SystemScope)
Replace constructions with settings()->fileName() by usage of
ICore::userResourcePath().

Change-Id: I5a9fa9d09f2563c39dc5d11a4586da825c62f9ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-11 10:42:09 +00:00
Tobias Hunger
3d8be750b9 Environment: Use Utils::FileName for path() and related methods
Update users accordingly.

Change-Id: I9432e82308e9d0630514c6c8632aeb6b6ee0cf90
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-27 07:37:26 +00:00
Orgad Shaneh
f10af21922 CMake: Fix auto-detection on Windows
Recent CMake installer (3.9) installs the executable in CMake/bin.

Change-Id: I3912badc0907c91044e76b3155e924dd985819f1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-14 10:01:15 +00:00
Jake Petroules
e3285ce85d Auto-detect CMake in standard paths on Windows and macOS
Change-Id: I8ae765eaed5bc234347e01fe81c208b77c1c32ec
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-06-23 17:41:13 +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
fa17e27b7f CMake: Delay initialization of CMakeTools
Do not run cmake 5 times during startup. Delay that as far as possible.

Also add a supportedGenerators() method while visiting the code anyway.

Fix up and simplify the other cmake help output parsers.

Change-Id: I6622d552ffe559bf099b4b278618676a045e350e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-27 12:43: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
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
ca29cbfc8a Consistently use Utils::FileNameList
Consistently use Utils::FileNameList in favor of QList<Utils::FileName>

Change-Id: Iafbb466c882bfd91c25c9e78f107d401bfdb6d55
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-11-16 08:33:02 +00:00
Daniel Teske
ca8b43f6c8 Cmake: Fix autodetection of cmake on Windows
By using some of the infrastructure in Utils::Environment. Due to
wanting to find all cmake executables in PATH and not just the
first one, we need some custom code.

Change-Id: If3161d712b9f6e659450a3d0647f83344e68ba5d
Task-number: QTCREATORBUG-14740
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-07-17 10:25:25 +00:00
Daniel Teske
21d547998f Fix leaking of CMakeTools
Change-Id: I36d3d19cbd0bccc3ee74f8aae1622dbed22aa45a
Task-number: QTCREATORBUG-14727
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-07-15 14:56:04 +00:00
Benjamin Zeller
255b5850e2 CMakeProjectManager: Support mapping chroot include paths
Provide a way for plugins to map include paths into a build chroot.
Plugins can register a path mapper if required, otherwise the paths
are not touched.

Change-Id: I621982831fa354d6d0f558a6c1dce4e014421f12
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-04-21 09:58:53 +00:00
Eike Ziller
c8da2438ec CMakeSettings: Do not break most of other settings
Just do not return early, which then missed a settings->endGroup() call.
Fixes a regression introduced by
99e9643dea

Change-Id: I102eb76e3381012cddb73c1132b6443dd2cd592f
Task-number: QTCREATORBUG-14139
Task-number: QTCREATORBUG-14140
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-03-16 10:52:59 +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