The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
- buildKey a handle to one item in Target::applicationTargetList
- displayName a user-visible string in the run settings page
The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.
This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.
The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.
It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.
There is clearly is further consolidation potential left.
handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.
Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Some cmake generators create a set of different configurations of the project
at the same time (e.g. Visual Studio related ones). These typically contain
the same set of files.
Creator iterates over the configurations and adds files to the project tree.
For multi-configuration generators this does lead to the same file being listed
several times below a target (the targets themselves were already deduplicated!).
This patch adds deduplication of file paths already listed in the target's
subtree of the project, thus fixing the multiple files issue. New files (e.g.
those that get only built in debug/release mode) will still get added as before.
Task-number: QTCREATORBUG-19020
Change-Id: I5dd6012ea335d9946c78c25be258c8c4d60698f2
Reviewed-by: hjk <hjk@qt.io>
Fix use of build directory vs. workdirectory in tealeafreader and servermode
reader.
Change-Id: I593579f7ad4facd64cf201368cacc4d3a8414fbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This got broken when moving the BuildDirManager from the BuildConfiguration
into the Project itself.
As a side-effect this patch also fixes the persisting of cmake state.
Task-number: QTCREATORBUG-19075
Change-Id: I1fc696097b09f5285e67f20885eb1fa27504990b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.
Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Let project managers store information whether a project part
belongs to an executable or a library and use this information
inside the AutoTest plugin.
This information will help to determine which targets are
relevant for the execution of tests.
Change-Id: I93b42797bf55225425398dc83aecea3c99eea290
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
The old code model expected the macros as C++ formatted text
("#define Foo 42) but newer targets like the Clang codemodel expect key
value arguments like "-DFoo=42". So instead of parsing the text again and
again we use an abstract data description.
Task-number: QTCREATORBUG-17915
Change-Id: I0179fd13c48a581e91ee79bba9d42d501c26f19f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Filter out CMake input files that are already listed elsewhere in the
project tree. This is server-mode only.
Change-Id: Ib62cd5b521a51180d12d76ec2868a99dbdecc272
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The build dir might be contained in the source directory, but not
the other way around. So this should be more reliable.
Change-Id: I2459b249fcc1002aa7f7787231b5699444a4c6bd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Base the selection of the run configuration on the executable
we have gotten already from the BuildTargetInfo and take
deployment information into account.
This also reverts cce1e130 partially and avoids
stuffing unrelated information into the buildsystemtarget.
Change-Id: I3de6e910a5fd1092d428ec4afc33c4ca62daaa25
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Add unit test to make sure this stays fixed.
Task-number: QTCREATORBUG-18624
Change-Id: Ieeb41982418481223d9ebf8f5c6ec4b3b78bfe00
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Use the information to add a filenode below a target that takes
you directly to the target definition.
Change-Id: Ifcb8e2c4f085110033019ea3816c79f5b8630472
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This triggers the logic in Project to show the top level project
file in the project tree.
Remove similar logic in CMake.
Change-Id: I2bfdd3f5e3d4126910a3feb480cec5ef689954ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Florian Apolloner <florian@apolloner.eu>
Handle more kinds of errors in CMake server-mode.
Task-number: QTCREATORBUG-18318
Change-Id: I43fff7f3cfbd86d01ff05a0936261b8d91aa5d70
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
If project files are not mapped 1:1 to targets the result
of the chosen executable was more or less random.
Try to handle multiple targets as correct as possible by
checking for build targets already where we still know
which files are part of the respective test cases.
Task-number: QTCREATORBUG-17783
Task-number: QTCREATORBUG-18357
Change-Id: I82dcc26bf52c9918e2727b439a719af08879ef49
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Provide more information about what is happening in server mode.
Change-Id: I69cbf0b2cb197789231499ac601a08af33ed6b6e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
CMake sends false signals on Windows. Until this is fixed, ignore them.
Task-number: QTCREATORBUG-17944
Change-Id: If59f04fd68a899069ecc02df592d3105e531f5bb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Detect both build directories next to the sources as well as below the source
directory properly. Without this patch all files that normally go into "Build
Directory" node were listed below "Source Directory" when the build directory
was a child of the source directory.
Task-number: QTCREATORBUG-18196
Change-Id: Ib8674489cfe04958f76df24904107bb7aa093162
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Set the working directory of binaries which got moved from the
build directory using CMAKE_RUNTIME_OUTPUT_DIRECTORY to the directory
the binay is actualy in.
Task-number: QTCREATORBUG-18158
Change-Id: I059d55a6c408799f3220bd90c271a6d743e6cd82
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Nodes are QObjects (still), so they should not have a copy constructor.
Change-Id: I1b20663ee0ec121cda4d39ced7a9f204fb4621a1
Reviewed-by: hjk <hjk@qt.io>
Server-mode reports a filegroup for all the listed headers and will
provide that without any information on the files (no language, include
paths, etc.).
Fix up file groups like these by using the best (with that being the
settings that effect the most other files) possible information for
these files.
CMake has no idea what headers are, so it has no way to provide any
better information, so Creator has to fix things up again:-/
Task-number: QTCREATORBUG-17971
Change-Id: Ib5ddab23cf725c7e03717b577cc9f9edc5bbfc61
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
CMake server-mode does report targets for each "PROJECT" that was
encountered before the target was defined. So it reports several
copies of the same data all the time. Deduplicate that information.
This fixes files being duplicated in the code model and the project
tree.
Task-number: QTCREATORBUG-17955
Change-Id: I95daa0f48e37587234d7e04e9bed6d20884f8be0
Reviewed-by: hjk <hjk@qt.io>
Move all project headers into one folder. This reduces the time it
takes to generate the project tree, since the headers will only show up
once now (instead of once per target), severly reducing the number of
nodes in the tree.
Change-Id: Ibcfa7c02c1aec4a98054f4f8a97b69dfb4c25ae4
Reviewed-by: hjk <hjk@qt.io>
This patch reduces the time to generate a project tree by 15% in
my test project.
Change-Id: Ie5956cdd2108873118654857dc299bdb0b6d3636
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Do not compress foldernodes that differ on their type. This makes it
possible to use FolderNode::compress() in one more place in CMake.
Change-Id: I4721d5d12e3032ee70a1c3d9e87df49d59751f04
Reviewed-by: hjk <hjk@qt.io>
Fix the project tree getting lost after changing a cmake file. This is
due to the old set of files being used for deduplication, so no CMakeLists.txt
files got added to the tree, and then nothing could be added to those later.
Change-Id: I46989e0b802ab2a030d1922282361359837c41a4
Reviewed-by: hjk <hjk@qt.io>
This is important to be able to map sources to actual things that are
going to be built.
Change-Id: I1aef940767d60192642ed79a1703cff8dfdad9e1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Fix two more SOFT-ASSERTs in CMake server-mode that could be triggered
by complex projects.
Move and simplify search functionality into FolderNode and use that instead
of hand-crafting a custom tree search in CMake.
Change-Id: If4bde5c4a7ff84c7d5dba4f595e99b39f54ac8aa
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>