There was already a similar function taking a QString.
After that, the remaining no-argument version of absolutePath()
can be deprecated.
Change-Id: I5b9ad8c8b68a5723891b0aa9f5a37e90db0fe09e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This will allow for the Qt Creator's CMake build only qtcreator
target to be selected as runnable.
Similar to qmake's qtc_runnable or Qbs's qtcRunnable features.
Fixes: QTCREATORBUG-25908
Change-Id: I6416873d0ad9cfec4960d98fc4b289ec98cc58b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
For CMake and Qbs projects and users of TreeScanner, where the tree is
already created in a separate thread.
Expanding the QRC nodes means reading and parsing the QRC files, which
can take up a considerable time (second(s)) if there are hundreds of
them in a larger project like Qt Creator.
Task-number: QTCREATORBUG-25783
Change-Id: I5ca818b9f75ea6e8ef23f837cc9e15df7e6630e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
QDir::cleanPath(...) doesn't do the right thing on stringified
Utils::FilePaths. Use FilePath functions instead.
Change-Id: Ied66f38dd30a15694bce12ed57d37411bb87f680
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface
So move these items out of QtcProcess, later potentially to a separate
file pair.
Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Creating QIcons elsewhere is not safe because of image reader plugin
loading and the pixmap cache.
Fixes: QTCREATORBUG-25301
Change-Id: Ia22a0cd571f808d7f5c639353fdf2e548743f8ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
If a project specifically links to a library in a standard path (like
/usr/lib/...), we do not need to add that path to LD_LIBRARY_PATH.
Actually adding it can be harmful if the build needs to link against
some other library in a different version than is available in the system
path.
Common case is linking the application against a Qt version from the
online installer. If /usr/lib/... ends up in the LD_LIBRARY_PATH before
the path to the Qt from the online installer, the system Qt is picked up
at runtime instead of the Qt from the online installer.
Fixes: QTCREATORBUG-25292
Change-Id: Ib080e41f5893fb68e9d65cc9c9f11d1a9a60f485
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
CMake has multi-config generators like:
* Visual Studio
* Xcode
* Ninja Multi-Config
The first two have different special targets for "all", "install",
"package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE",
"RUN_TESTS".
All of them need to get the build type passed via "--config <build-
type>" and not via "CMAKE_BUILD_TYPE".
The multi-config generators will use only one build directory.
Fixes: QTCREATORBUG-24984
Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Clang code model can break if CMake project uses precompiled headers.
QtCreator will make a copy of the precompiled header, this way it
will not conflict with the build system one.
Ammends 888ea6bbbb
Fixes: QTCREATORBUG-24945
Fixes: QTCREATORBUG-25213
Change-Id: I149fc416cd047683d095758a024de47c7baf681c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Mark some of them with Q_UNUSED, since it looks like
sometimes the copy is done on purpose, to force detach
or used for some hack with memory management.
In one case make unused variable used again.
Change-Id: I3825cd3399fa63bf6e12173c64509287d4a125e5
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Gather some more information of a CMake based project to be
able to provide this later on to the AutoTest plugin.
Task-number: QTCREATORBUG-23332
Change-Id: I2beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: David Schulz <david.schulz@qt.io>
If a CMake project cannot be parsed by CMake, it is practically unusable in
Qt Creator. According to discussion in QTCREATORBUG-24677, a virtual
folder with the project's file system view is added to the project
manager as a convenience feature.
Fixes: QTCREATORBUG-24677
Change-Id: I48775bb89c704d3f7e5bb21ec6481bd5cc0f4b6c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Sometimes source groups would start from the root directory rather than
having the correct folder specified in CMake. This was because the
incorrect path was being used to find the relative path. Forward
baseDirectory to the overrideBaseDir parameter of addNestedNodes() to
guarantee the proper directory is used as the base.
Fixes: QTCREATORBUG-23896
Change-Id: I213c02a3fff3c10e4b6a58211600dd16ac257bbc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
CMake will happily accept the empty string as a project name, so do not
treat that is invalid in Creator. Apparently the empty project name will
get generated by CMake itself if no project() command is found in the
top level CMakeLists.txt file.
Make sure to set a sensible name if the top-level project has no name,
using the directory name of the source directory instead.
Change-Id: I3b861daa13c1d0fec31c294ef0ac15338310020d
Fixes: QTCREATORBUG-24044
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
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>
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>
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>
Extract all the information necessary for the "Add build library search path
to LD_LIBRARY_PATH" from fileapi and enable the relevant UI in the
desktop run configuration.
This allows to remove a workaround introduced for QTCREATORBUG-19354.
Note that this is only supported by fileapi at this time.
Task-number: QTCREATORBUG-23464
Change-Id: I390d26ed8cd559bd7ff8c2701cd3b1cb8e764339
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Support nesting of source groups based on the source group name, split
at "\\" strings.
Change-Id: I6c0e5c64b2b4ee84cd07cde1ff5accc5c3b853df
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Use a special icon for source groups, so that those can get
destinguished from folders
* Simplify folder structure below source groups to not include
common paths elements
Task-number: QTCREATORBUG-23372
Change-Id: Ifcb35af9b35805a6272f27b0801c2fe7dfce95ae
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
For CMake file-api, flag all applications not linking to "QtXGui"
as "Run in Terminal".
Task-number: QTCREATORBUG-21451
Change-Id: I29f086c546d3d8a9f56257e423602f787db42ccd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
CMake gives the path to the cmake_pch.h[xx] file as relative path
to build directory. Making it absolute fixes the code model.
Fixes: QTCREATORBUG-22888
Change-Id: I2fdc080be779f22b737788be2074254290994aaa
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Make sure to generate unique ids for each project part to unconfuse the
code model.
This was never triggered so far since before PCH support all my test projects
ended up with exactly one compile group per target:-)
Change-Id: Ida34f71f77cdf679fea7007f13ac19713175d916
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Adding this to other readers makes no sense: PCH support in cmake
is younger than fileapi.
Change-Id: I4cd88882764ab8a8f81316a17098878c8e3699eb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.
Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.
BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).
Removes dependency on ProjectPart from RawProjectPart.
Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@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>
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>
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>
The idea was to make the project tree a bit simpler by removing the
auto-generated "Source Files" group that CMake adds. But this left out
"Header Files", which is also auto-generated by CMake and might
surprise users.
So let's remove this special case again.
Change-Id: If87bf9f89e1ff0be855c2e9b915d64d77d51d2be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>