Commit Graph

3443 Commits

Author SHA1 Message Date
David Schulz
2aac4cc07f CMake: honor use jom instead of nmake setting
Only search for the jom cmake generator if this setting is
enabled.

Change-Id: Id8eed91d47f1f6ca2375fe0d169b21168c5ca4ff
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-23 12:59:43 +00:00
Christian Kandeler
1c6e4fbd32 Merge output formatters and output parsers
Now only one piece of code needs to be written to both linkify output in
an output pane and create tasks for it in the issues pane.
The calling sites are also simplified. For instance, until now, build
steps had to feed their output parsers manually and then push the
created tasks up the signal stack in parallel with the actual output,
which the build manager relied upon for cross-linking the output pane
content. Afterwards, the output would get forwarded to the formatter
(and parsed for ANSI escape codes a second time). In contrast, a build
step now just forwards the process output, and task parsing as well as
output formatting is done centrally further up the stack.
Concrete user-visible improvements so far:
    - File paths in compiler/linker messages are clickable links now.
    - QtTest applications now create clickable links also when run
      as part of a build step, not just in the app output pane.

Task-number: QTCREATORBUG-22665
Change-Id: Ic9fb95b2d97f2520ab3ec653315e9219466ec08d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-23 08:47:08 +00:00
Tobias Hunger
bf1bbbac05 CMake: Remove some unnecessary code
The build directory going to get set up either in
doInitialize or in fromMap, both using magic hidden in
BuildConfiguration itself.

Change-Id: I1aeb59f56d63f0affd50b45cc937e606af6da7b4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-22 12:12:37 +00:00
Tobias Hunger
5bb5c7b904 CMake: Make sure a CMakeBuildConfiguration always has a CMakeBuildSystem
For this to work, we need to make sure no parsing is triggered before
the project is fully set up. Otherwise it would be QTCREATORBUG-23816
again...

Change-Id: If81f4c6b9c82283abdaa8a635f93ebe0bcaf8159
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-22 12:09:14 +00:00
Tobias Hunger
ca4c578532 CMake: Update minimum CMake version to 3.7
Tealeaf reader mode has been removed, so require at least
CMake version 3.7 (which comes with server-mode).

Change-Id: I1ce8cdd08f226446ccca5882d1cb2171019b3409
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-22 11:59:21 +00:00
Tobias Hunger
f51f3c897e CMake: Do not crash without a supported CMake
Do not crash when a CMake < 3.7 (no server-mode and no file-api) is
used.

Change-Id: I72a4ce6bb81d4fcf3d59508c72e46f422a8a00c0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-22 10:38:27 +00:00
Tobias Hunger
69b0a2cafc PathChooser: Allow for chooser-only selection of files/directories
Makes the line edit disabled and read-only in that case.
We also need to change the custom context menu from the line edit to the
path chooser itself, because disabled widgets do not show a context
menu, but we still want to see the select & copy, and the special
items for opening explorer or terminal.

Task-number: QTCREATORBUG-23798
Change-Id: Ib653b4eaaedfbe54c614377795ddc52d21ac12c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-21 13:18:43 +00:00
Tobias Hunger
9b78b9f766 CMake: Fix WS in cmaketool.cpp
Change-Id: Iffd3a7b8f53989c6756acb084e00543eba6d564c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-21 10:13:23 +00:00
Eike Ziller
4fcfb7aea6 Merge remote-tracking branch 'origin/4.12'
Change-Id: I97e4fe727ca9560f2a1f4b93abcfb9fda091364e
2020-04-21 09:26:50 +02:00
Tobias Hunger
82a7adf624 CMake: Remove dead member from CMakeBuildSystem
Change-Id: Iffdc3d67c2309c1cdc427b383c023d8c98eac037
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-20 13:36:49 +00:00
Tobias Hunger
43895c87a2 CMake: Fix WS only
Change-Id: I2ab4d5e3998ee550cdc00e27a314ae3109c8225b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-20 13:20:59 +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
d0e0ffd2d2 Revert "CMake: Pass on extra files to code model"
This reverts commit 4d3eea6884.

Reason for revert: QTCREATORBUG-23876

Change-Id: I1b438d13cbdf64870e7cc9f7432665d773f58369
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-20 10:05:08 +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
Eike Ziller
602d690bab Merge remote-tracking branch 'origin/4.12'
Change-Id: Ie35e9959693b6f6f78509eea5b259d6493ef87f2
2020-04-17 08:09:55 +02:00
Christian Kandeler
6f32538c5d ProjectExplorer: Split up the IOutputParser class
For symmetry with Utils::OutputFormatter.

Task-number: QTCREATORBUG-22665
Change-Id: I148fed69dba042ad3ef26e080829c31cd3f357fd
Reviewed-by: hjk <hjk@qt.io>
2020-04-16 10:40:33 +00:00
Tobias Hunger
4d3eea6884 CMake: Pass on extra files to code model
Pass on extra files that are not compiled according to CMake
(== headers) to the code model, so that it has the information
which build system these files are associated with.

This helps a bit with the AutoTest plugin, which wants to scan
files (incl. headers) for tests and needs information on which
build system target will build that test.

This patch fixes e.g. Google Test detection for CMake projects --
but *only* if the header files are actually listed in
CMakeLists.txt. If that is not the case, then the CMake plugin
has no way of knowing which target will build tests.

Task-number: QTCREATORBUG-23843
Change-Id: I1117c63dd052ec29a3bce6cce24c3389eedb2df7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-04-16 09:56:01 +00:00
Orgad Shaneh
d3ebd70ab2 CMake: Fix GCC warning
cmakeparser.cpp: In member function ‘virtual ProjectExplorer::IOutputParser::Status CMakeProjectManager::CMakeParser::doHandleLine(const QString&, Utils::OutputFormat)’:
cmakeparser.cpp:143:1: warning: control reaches end of non-void function [-Wreturn-type]
  143 | }
      | ^

Change-Id: I876e096d965444b9b72ef0dddcbc52e7a201eb02
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-04-14 10:32:36 +00:00
Eike Ziller
deb0eaf795 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I34c3d1fd5be90537e37d15e00b1a0d455d1bf81d
2020-04-14 09:47:38 +02:00
hjk
79b680e7f0 Utils: Rename PathChooser::{f,setF}ileName() to {f,setF}ilePath()
It's returning a FilePath, so it's a better fit.

Keep the old versions as inline function now to ease downstream migration.

Change-Id: I535887928018f42b92895c8b0c82527f0d55e5ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2020-04-09 17:30:23 +00:00
Christian Kandeler
45ba9fcd53 Output parsers: Replace the chaining approach
Use "flat" aggregation instead.
This is another step towards the formatter/parser merger.
Along the way, also fix some some subclasses (mostly in BareMetal) that
erroneously forwarded handled output to other parsers.

Task-number: QTCREATORBUG-22665
Change-Id: I12947349ca663d2e6bbfc99efd069d69e2b54969
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 14:49:32 +00:00
Eike Ziller
fa517bd72a Fix build
Amends 13daf11d03

Change-Id: Id29430cd41d522cd5b4b8b1767b4d29a68c97dd5
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 13:35:51 +00:00
Tobias Hunger
13daf11d03 CMake: Simplify BuildDirParameters
Remove some useless bool, Creator would crash if that was ever set.

Change-Id: I148cad6b6139332a6010698f075b584c87dec338
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 12:22:50 +00:00
Tobias Hunger
a53308cde6 CMake: Do not create .cmake directories in source dir
Only initialize the CMakeBuildSystem after the
CMakeBuildConfiguration has been fully set up. The "builddirectory"
was still pointing to the source directory, so creater configured
cmake in the source directory, leading to a useless directory being
left in the source tree that does not belong there.

Fixes: QTCREATORBUG-23816
Change-Id: I7c9b6ae1f8d999043e700cd9f2d56418c22f2abf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-09 12:22:32 +00:00
Tobias Hunger
34f5e14afe CMake: Remove CBP parser that was used in tealeaf mode
Change-Id: I27be82673800be981c5f60ce0f157ae2b8cfd1e4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-09 12:22:11 +00:00
Cristian Adam
a1e61fd4b9 CMakeProjectManager: (re)Fix clang code model when CMake PCHs are used
CMake gives the path to the cmake_pch.h[xx] file as relative path
to source directory. Making it absolute fixes the code model.

Fixes: QTCREATORBUG-22888
Change-Id: Ia969ead16bb99a05c955ae96f03596ef25db63ba
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-09 10:16:18 +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
Christian Kandeler
98fb412e6e IOutputParser: Replace std{Out,Err} with a single parameterized function
Another step towards parser/formatter unification.

Task-number: QTCREATORBUG-22665
Change-Id: I6de86b3aee2c54585cdd4b06d21b0ea67300aeac
Reviewed-by: hjk <hjk@qt.io>
2020-04-08 09:31:33 +00:00
Tobias Hunger
a6dad316c2 CMake: Remove dead code from BuildDirParameters
Change-Id: Iae900ad0a3b901d2e83a2ea8eb2895b5627897fc
Reviewed-by: hjk <hjk@qt.io>
2020-04-08 07:04:13 +00:00
Christian Kandeler
7745eacc7a Output parsers: Generalize the search directory concept
All parsers can now have search directories, not just the GnuMakeParser.
This allows us to get rid of the "task mangling", removing another
instance where the order of parsers in the chain mattered.

Task-number: QTCREATORBUG-22665
Change-Id: Id0d55522ae6800afd9f50ff36546224b0d8bb382
Reviewed-by: hjk <hjk@qt.io>
2020-04-07 15:20:22 +00:00
Christian Kandeler
b15d1951a2 ProjectExplorer: Let IOutputParser handle newlines
This makes IOutputParser structurally more similar to
Utils::OutputFormatter, which makes it simpler to explore possibilities
of somehow uniting these two related classes.

Task-number: QTCREATORBUG-22665
Change-Id: Ibb12ab6c8c785d863b9a921102a929864d0a5251
Reviewed-by: hjk <hjk@qt.io>
2020-04-07 08:13:58 +00:00
Christian Kandeler
cddaecfe21 ProjectExplorer: Clean up IOutputParser interface
- Remove unneeded/unused functions.
- De-virtualize where possible.

In particular, after untangling a number of self-referential
redirections, it became apparent that the outputAdded()
infrastructure was entirely unused.

Change-Id: I51e1beed008df2727b42494b087efa476342397e
Reviewed-by: hjk <hjk@qt.io>
2020-04-03 10:57:06 +00:00
Tobias Hunger
b30aa7fda5 CMake: Use BuildDirectoryAspect for UI related to Build Directory
Do not re-create the UI yourself.

Change-Id: I8e7610ee6717105a3e05743d0451a3c6732197c5
Reviewed-by: hjk <hjk@qt.io>
2020-03-23 13:16:34 +00:00
Tobias Hunger
10e79cebc9 BuildSystem: Add buildConfiguration() method
Add a buildConfiguration method that returns the saved
BuildConfiguration or the active BuildConfiguration if none is
set.

Change-Id: I8af25aa1037f59a0091900bac7eb84fed9e5fbb0
Reviewed-by: hjk <hjk@qt.io>
2020-03-23 13:16:15 +00:00
Tobias Hunger
a596421ffc BuildSystem: Clean up use of BuildSystem::(kit|target|project)
Change-Id: I4852689cb54d02bb278f9cd596f1de506a43fc04
Reviewed-by: hjk <hjk@qt.io>
2020-03-20 13:10:01 +00:00
Tobias Hunger
9e0a1b3621 BuildConfiguration: Add helper to create a build directory
Use the helper in CMake. Everything else does not seem to directly
create directories.

Change-Id: I50fba8c461471a1bcd0f9c187a857730c35e4f8f
Reviewed-by: hjk <hjk@qt.io>
2020-03-20 13:09:45 +00:00
Tobias Hunger
5de0e81d8b CMake: Fix typo in symbol names
I can't spell occurred:-/

Similar typos in 3rd party code (sqlite) has been left in place.

Change-Id: I7cfa9911fc434d42ce3df8e9c7ccb83dc00401e8
Reviewed-by: hjk <hjk@qt.io>
2020-03-19 17:50:21 +00:00
Eike Ziller
22cdc47077 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp

Change-Id: I4a90920e52dbbe9eb46aef3437ee3c5a6e7b31c6
2020-03-16 08:30:33 +01:00
Leena Miettinen
4354ea8df9 CMake: Fix UI text according to the guidelines
https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html

Task-number: QTCREATORBUG-23683
Change-Id: I56af56e745fe4237e1bb9df94f8cd423585e63a4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-03-11 10:06:41 +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
995ba78fae Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
2020-03-04 08:15:50 +01:00
hjk
b0b50257ec ProjectExplorer: Pass extra project files as QSet
They are available in some cases as such, and consumed as such.

Change-Id: I9866c7d7bd817fb19a8b11a0efbe583ed55fe393
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-03 09:17:20 +00:00
hjk
1e8f262322 CMake: Compile fix
Amend 7dd8858fa2.  Was not unusused after all.

Change-Id: I18c5f5033ebd8b3e19ebdf4718465d6b4ba6acf4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-02 12:13:04 +00:00
hjk
7dd8858fa2 CMake: Remove unused CMakeBuildConfiguration::emitBuildTypeChanged()
Change-Id: I4cb93a7f89ff4bcada2083bebd8e9e96770f4818
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-03-02 11:12:11 +00:00
Andre Hartmann
d76a2f4fcd Deduplicate elapsed time formatting
While it's nice to see my code spreading,
I still prefer to have it at one place.

Change-Id: I7bdb13c47ed7e96227deeb14b0a8070aa40148de
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-29 18:21:47 +00:00
Cristian Adam
bafa0d9495 CMakeProjectManager: Add elapsed timer
Change-Id: I1e7bcd60cae0193b4d16f20175b76550aaefbf9c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-28 12:33:13 +00:00
hjk
fbd1574a85 ProjectExplorer: Fix use of build step list preamble messages
The step list names are computed separately anyway, having an
extra preamble consisting of concatenated build list names on
one line looks unnecessary.

Change-Id: If754c6363042927210dfd09c23f2f494081f8c47
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-28 11:48:35 +00:00