CMake has a few environment variables that are documented and this
commit adds support for them.
Change-Id: Iaa31bdc97b343581fcf519d19e66bc6ce8ace150
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
I needed to add more members to the structure, and will get static
analyser to complain that the number of bytes is to high.
Amends 3984108c0c
Change-Id: I162b9ef615dc7f6f76b08c5599eed24488bf7e88
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
If Boot2Qt devices are registered, their CMake tool would often end up
as the default. Instead now we only auto select a cmake tool on the
local machine.
Change-Id: I677ab06ae88ff36209e691ea0fadb356436e973c
Reviewed-by: hjk <hjk@qt.io>
The pointer contains the parent class passed with "this" and will never
be null.
Coverity-Id: 1568097 Dereference after null check (FORWARD_NULL)
Coverity-Id: 1568100 Uninitialized pointer field (UNINIT_CTOR)
Coverity-Id: 1568111 Dereference before null check (REVERSE_INULL)
Change-Id: I40e32d162689c749d498c4a63c073c0e336a3626
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If projects are using a local "cmake" directory containing
Find<Package>.cmake modules the common practice is to use something like
this:
## Add paths to check for cmake modules:
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
This commit makes sure that these packages are taken into consideration
for code completion.
Change-Id: I152ccce0c97ab2385eda93ff6bc5fc4e7cefb6c4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This way code completion will have Qt6 package suggestions for
find_packages.
Change-Id: I9ab64425f850a0d990e77a559ce9f121bc9cf2d7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
... and not for every function. Just the CMake files.
Change-Id: I6e361f4913f8334942a3135adaa0480fdc0cee31
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Check more often for canceled future.
Make more functions static.
Fixes: QTCREATORBUG-27729
Change-Id: I8dd787acea6343008c7515fb6a4fdfde50b37aee
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
On the session switch we are busy waiting for the running async task,
started before by the FileApiReader::endState(). This blocks the main
thread for considerable amount of time. E.g. when switching
between sessions both containing Qt project, it may block
the main thread up to 10 seconds.
Instead, we employ the future synchronizer and move the awaiting
to the shutdown phase.
The next patch is going to limit the awaiting in shutdown phase.
Task-number: QTCREATORBUG-27729
Change-Id: I956ed26edcd699d8a4e2b9309d109963f1d4bb20
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This way we'll get:
[cmake]
[cmake] Elapsed time: 00:05.
And not the other way around.
Change-Id: Ica7352cd112b9017c8a39b98618be69494527be9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This was the first one reported by CMake, and we need to make sure it's
also included.
Change-Id: I5becfffc1afb35a4f69fd26d8563aa1ea6eaea60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
With this one could easily filter the "[cmake] " messages from all the
messages in the "Generate Messages" pane.
Change-Id: I690650f0ccb0372c9361b95cfec41809737720d7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This is usually the case when using a custom CMake API e.g.
qt_add_executable.
The topmost function is highlighting the error now, presenting the
callstack in the tooltip.
Change-Id: Ic8b8f60e8fe94d88dfa0b384639172370382a421
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This way the popup message is not spanning the whole screen.
Testable with find_package(Qt7 REQUIRED).
Change-Id: I3f1943b603baa02c55f2f8f63c75908468e69d9a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
To improve the speed of parsing the result of a remote
cmake call, we move the file fetching and parsing into a
mapped concurrent call.
We also first uniquify the list of files to remove duplicates.
Fixes: QTCREATORBUG-29618
Change-Id: I18108928ba3b5f4f8ec3d5610b216c5ccf060877
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This is where the user would expect it.
It is an action, so the user can assign a keyboard shortcut if needed.
Change-Id: I4c6db3b1dafb5fb173a07c21d271715310a2b091
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Let's say you move the mouse left and right on the keyword, we shouldn't
flicker showing the same tooltip to the new position.
Change-Id: I45b69578d377384422535ce5f33f81bc916a42e2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
No need to cache the value of the CMakeTool, since it causes issues with
the update mechanism.
Task-number: QTCREATORBUG-29683
Change-Id: Id5925b9a90d6010aa09b4a2f7b5ed3d447f5cd7a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Avoid calling not-thread safe functions from inside
the CMakeFileCompletionAssist::performAsync().
Move calling these functions before the asyncRun, collect
the needed data inside the PerformInputData structure
and pass it to the other thread instead.
Fixes: QTCREATORBUG-29683
Change-Id: I56127163a47339bc45d47f3a7d2c76d518b640f7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Check that the function operating upon is "include" and then match the
word under cursor with a file from the project.
Change-Id: Ia0131f08515c56582a1fb02a59d6b2e41ac04288
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
The CMake snippets do have comments with the origin of the snippet and
this patchset allows navigation to the url in question.
Change-Id: I6eb2565e8f7b9100a1cc19dbf8ccda430c698613
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
For example find_package(ZLIB QUEIT) will result in the package
variables ZLIB_LIBRARY ZLIB_INCLUDE_DIR.
The variables are available for both code completion and navigation.
Change-Id: I4ea6090f44a980dc91632fcabbda16987b0f0285
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
They were available via Ctrl-K and "cmo <target_name>". But they should
be working also in the text editor.
Change-Id: Iaad72b784485364776b67d6dfdef7ba73dd2df70
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This allows e.g. Qt6::Core to be specified as argument for
target_link_libraries and navigation via F2.
Also fixes a bug introduced with
695952f84b which removed the project
specific features due to project being nullptr.
Change-Id: I5efa28c498d337e6bab564533a5445e6c364b26b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
To be able to parse the rst help files from CMake
Change-Id: Ibec21e8571324276d2080f81728b1268581601d0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reuse it in CMakeEditor and CMakeFileCompletionAssistProvider.
Amends d04585b519
Change-Id: I8dbd59c815e017404ff215ca1ff68740d6653e91
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The first 1024 bytes from the CMake .rst files are displayed raw data.
A .rst to html or markdown would be needed for nicer user experience.
Change-Id: Ie6adbb404d844ae88b868b465d4125c2177e6cfe
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
By listing files instead of running cmake and asking CMake to provide
the information.
For properties and modules now the information is taken from the active
CMake version and not from the Syntax-highlighting file.
Change-Id: I0974cc816d990fd382d9e855eb08416b50d0368b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Will be done in the CMake editor. No need to slow the project loading
when you don't do any editing of CMake files.
Initially I wanted to have it already loaded when code completion is
done, but doing once when a CMake editor is opened is better.
Change-Id: I1eda2a64e708bfa4fab5ab749059a08769800eba
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>