The only user can also get this information from the relevant
CMakeBuildConfiguration.
Change-Id: I80e176ef0a8bc427f6adbf75b20e29f38d7b949f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We may neither run "/some/path/CMake.app" nor
"/some/path/CMake.app/Contents/MacOS/CMake",
so add a missing workaround for the latter, and use the "resolved"
executable path for the retrieval of version info and capabilities.
Change-Id: I6fed8cc478c0d0b9946a934fd83126e157bde992
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Could no longer unset "Autorun" for CMake tools. Broke in
de6faa0f15
Change-Id: I0b6e9e64de591e1128ff0dabf4eedb40e1a3748c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
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>
When the filesystem scan takes longer than the cmake parsing, then
resetData() was called on BuildDirManager by the CMakeBuildConfiguration
before the CMakeProject had requested its data.
Move some code back into CMakeProject to resolve this issue.
Change-Id: Ib21bdd63fdca79c2ad39a7e060df438b456700b4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
QFileInfo::exists(QString) is a static method, so the code was
looking for "CMakeCache.txt":-/
Change-Id: Ib0f9711a159fca9437ffb15c26af246ec69489ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
There is no need to reset a reader when e.g. the build directory changes
when the server-mode reader is *not* used. So the one case where having
separate reparse-options for the case where the reader changes and the
case where it stays the same is bogus.
So unify the flags into one set and simplify the code accordingly.
Change-Id: I9bcfcc6333d574d49513ef1256a9a8597bda4ec7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Add more logging of cmake parsing flags as cmake runs are requested
in the plugin.
Change-Id: I5231bd29dfeb6521218dc28c26a5b658ccb4059b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Move special CMake environment modification to CMakeBuildConfiguration.
Change-Id: I27f886db48d8c036f2f77f5ae8f239b405cb5721
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
First step, move {DesktopQt,Qbs,CMake}RunConfiguration{,Factory}
into the same new files.
This only moves down to QtSupport, not ProjectExplorer, as there
are in all three cases direct dependencies on QtSupport. Long term
I would expect them to move further down.
Change-Id: Ib16b19df7f3f642ed7f7db89a1f6904601d976ba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Move code closer to the BuildDirManager that was moved into the
CMakeBuildConfiguration.
Change-Id: I21d7188e4a3b03a02b12b01c7dd3e46754d653f8
Reviewed-by: hjk <hjk@qt.io>
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>
... by a Project::buildConfigurationChanged. That's the only case
used, and saves filtering on the receiver side. Also, the passed
bc is (in non-null) the active one, so isActive checks are not
necessary.
The null case seems to be only possible to trigger when removing
the currently active build configuration manually i.e. happens rarely,
so having it trigger an unneeded final display update on the dying
build config is tolerable, so drop the null check in such cases
to achieve a more uniform pattern.
Change-Id: I46f72e9e277767214dbd6920dd86b026a7084f46
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Updating on changes to other build config seem excessive, as the
updated details only depend the owning build config.
Change-Id: Iba86f2b56033ac55381d452dd2a435e5dda72674
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Targets are different from {Run,Build,Deployment}Configurations,
both regarding the level in the ProjectExplorer hierarchy, and
also by the set of supported operations (e.g. aspects).
Change-Id: Ia8490e2280a9ecc518395c5e48ce2fd5d6d58fd2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Handle environment changes in cmake better.
Server-mode will trigger an reader-change when the environment changes.
This has not been considered so far and a reader-change triggered by
an environment change was considered an error (and ignored).
Change-Id: I2d0baadbcfc86e04348c75d8e5997817bdc233a5
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The typical use case is to add header/source file and then update
the CMakeLists.txt file to add the source.
Request a filesystem scan when a cmakefile changes to pick up the
header file when the source file is added.
Task-number: QTCREATORBUG-22674
Change-Id: Ifbb1ba37dd46967215f51db2c6ad92af669df585
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Do not overload the "new reader" logic with the logic for "no CMakeCache.txt"
file.
This makes it a bit simpler to reason about the different conditions when the
options are applied.
Note that "no CMakeCache.txt" is handled later anyway by adding the
"REPARSE_FORCE_CMAKE_RUN" flag.
Change-Id: Icc9455152053911cc839a19c76d3c0e44fc76fcf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Select a better fallback target when a buildstep's target is no longer defined.
This change was cherry-picked from master branch:
9519f125e9
Change-Id: I7ef27361793125258cd2a73448d91d2561db5901
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Update the target list in the build step list widget for CMakeBuildSteps,
even when "current executable" meta-target is selected.
This change was cherry-picked from master branch:
ce7407dc03
Change-Id: Ifc1d8dc67894202eb38fe6088552797b198c7463
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Add a helper method to find the default build target for a CMakeBuildStep
based on the BuildStepList the step is part of. Use all/install/clean
targets as appropriate.
This change has been cherry-picked from master branch:
8b9821440d
Change-Id: Idc0c5fae7dfd255039b87ace77c02688cdd76e8f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This patch is not applicable to the master-branch: The buildkeys
for cmake targets have changed there.
Task-number: QTCREATORBUG-22634
Change-Id: I1c8abc42792a004bdadc893129c96e1b7ed428f6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Support CMAKE_CURRENT_LIST_DIR and CMAKE_CURRENT_SOURCE_DIR as
variables in filenames when handling links in the CMake editor.
Having a way to find out variable values in CMake would be nice,
till that arrives, we have to live with hacks to make the most
common variables work:-/
Task-number: QTCREATORBUG-21065
Change-Id: Iffaaae8665e0662226d08b88de37b66d5a5fc4d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Report more cmake file locations that are relevant to a target in
the "Open..." menu entry in the target's context menu.
This information is extracted from the backtrace information that
is provided by fileapi.
Change-Id: I01659a6cc7254cd0ef6b533a0785d2f15d31c3c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
To check this still works I used a CustomRunConfiguration with
a executable name $AAA, the tooltip there tries to expand that
(and complains that $AAA is not an executable).
By inserting a AAA=/bin/ls in the build environment, the tool tip
on the run config exectable path chooser changes appropriately,
same for changing the AAA value.
The connection seems also needed, dropping it destroys that updating.
Change-Id: I28965cbd3ce530a83d98808ca7624a6799cd9800
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Prepend the full path to the build directory.
Change-Id: I55111b656fd4b99ee68517c09117f142e88947b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Fix broken logic to prevent CMake fileapi from detecting the change
its own cmake run triggered via file watching.
Remember the last file that was parsed and do not attempt to parse
this again. Remember the file on a per-project basis, too:-)
Change-Id: Ia6e155b65d77994f6e3d2a3677f770a4ba53539d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add a "cmo" filter to the locator that will open the CMake target
definition in the editor.
Note that this is based on the target data extracted from cmake. For
tealeaf-reader and server-mode this information is guessed based on
the targets source directory (plus CMakeLists.txt). These modes will
just open that file.
For fileapi the information is accurate and based on the backtrace
that comes with the target information. "cmo" will open the exact
file/line from the backtrace here.
Task-number: QTCREATORBUG-18553
Change-Id: I4ee0eb25d1d763bd0d8033e506bf85cb2bc1f2dc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Report version information as well as support for fileapi and
server-mode in a tooltip you get by hovering a cmake version in
Tools->Options->Kits->CMake.
Change-Id: I2c4070b0b26eb4a056925ac5e10774e93ad62c46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
Fix fileApi detection: It returns a list of versions in -E capabilities
output, not just one version.
Change-Id: I94a59806f3c4577b01342cae6f05cdc8385131a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The CMakeParser used to set relative paths in the Tasks it creates.
Since is problematic: Task tries to match that relative file name to
one of the files that exist in the session.
At the time cmake runs only the top-level CMakeLists.txt file is known,
so this logic will map all the relative file paths to that file.
Make sure to write absolute file paths into tasks so that this mapping
is not attempted.
Change-Id: I4ab72df21f18d2eff27ca9a502d605e00df2ad85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Split up CMake's locator filter into a part that contains all
the logic to find targets and a part that handles the action.
This is so that the code used to search for targets can be reused
later.
Change-Id: Ife6c9fe6a6f1955bedaa1b9298630c052e17c33f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Make virtual function implementations final while touching the file.
Change-Id: I94c44ee3efbc9beb39789dd198ee607791a9a44d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Make fileapi remember where CMake targets were defined in the
CMakeBuildTarget struct. The other readers will just guess at
the location based on the source directory of the target.
Change-Id: Ia8fa226c548800992ccea64b1d5981d2f3013408
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Also remove a stray comment that is no longer applicable.
Change-Id: I052f458f8cfdfb921249b3f3d7c33cccc2aef371
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Select a better fallback target when a buildstep's target is no longer defined.
Change-Id: I7ef27361793125258cd2a73448d91d2561db5901
Reviewed-by: Eike Ziller <eike.ziller@qt.io>