Commit Graph

114 Commits

Author SHA1 Message Date
Orgad Shaneh
afa4b3eeb0 CMake: Remove redundant std::move
Detected by GCC9.

Change-Id: I07b602c263c6f08a4e243f98832941397efbb4e9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-07 08:56:31 +00:00
hjk
7bf10a5842 ProjectExplorer: Use setter for VirtualFolder's priority
More uniform code.

Change-Id: I9a10a1bb15b0df9cf30c68d2c0537bfae2bed98a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 10:42:45 +00:00
hjk
2aacf26a77 ProjectExplorer: Remove Node::m_id
It was only used within cmake, in a role that is nowadays covered by
buildKey.

Change-Id: I4fd77c06a3bb8965db5235315cb017c7b548fbaa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-02-26 09:37:02 +00:00
hjk
b1c0ecb4a5 CMakeProjectManager: Do not mark source-tree CMakeLists.txt as generated
This is what the code according to the comment tried to do.

Change-Id: Id585660fedec2c4eacce556ef25caa8479206c5c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-02-25 12:50:50 +00:00
hjk
09372918c1 ProjectExplorer: Remove FileNode's isGenerated constructor bool
Use setter of base class, similar to setListInProject() before.

Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-25 12:23:31 +00:00
Bernhard Beschow
693e2649a4 CMakeProject: Prefer assignment to out parameter
Also change method names from update...() to create...() and mark as
const. This communicates that the objects the methods are called on are
neither altered nor updated.

Change-Id: I29e84dc398ded3ffcbf90741227362c6b4be2bf9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-01-27 12:13:45 +00:00
hjk
5330502978 CMake: Simplify servermodereader.cpp:createProjectNode
The return value is only used for an immediately following assert
that can never trigger.

Change-Id: I653a68292427dd5d6e2fb153ee361da1f0573737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-12-18 09:26:22 +00:00
Tobias Hunger
152d2245d9 CMake: Suppress header-only targets from code model
Do not report targets that contain headers only and have no
include directories/defines set up to the code model. Such targets
are used to tell creator about the projects header files as a
work-around to creator not reporting headers in cmake projects.

This work-around is of course not necessary anymore, but it is widely
used and breaks the heuristics in the code model. So do not inform
the code model about these parts of the project.

Task-number: QTCREATORBUG-21425
Change-Id: I387d9d9fb4ae7b54fa08ee9b23efb9ab1f179b9c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-19 09:44:51 +00:00
Eike Ziller
c8c6b28e22 Merge remote-tracking branch 'origin/4.7'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h

Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
2018-05-28 16:10:23 +02:00
Tobias Hunger
88b065db3f CMake: Do not crash when deleting cmake tools
Do not crash when the cmake tool that was used to parse the project
gets removed.

Change-Id: Ieda3ae2025dbcfb1f90d9bd01c5f0ed960756c6a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-28 12:36:33 +00:00
Tobias Hunger
fdccc54275 server-mode: Always try to read CMakeCache, even after error
Change-Id: Ib3d4fb5ac14340a7f706e4a1d8a0cbdc420d01d1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-22 15:21:54 +00:00
Tobias Hunger
1bffb72417 ServerModeReader: Fix crash when filtering out known headers
Task-number: QTCREATORBUG-20412
Change-Id: I9e58b099ef002b3139576b15507f191e1c5a5ced
Reviewed-by: Jan Kundrát <jkt@kde.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-05-18 08:26:16 +00:00
Tobias Hunger
2df36926f5 CMake: Use FolderNode::addNestedNodes for unique_ptr in server-mode
Remove FolderNode::addNestedNodes that take raw pointers now that the
last user is gone.

Change-Id: If2ca3864934d9239ac136e65c0b7dbcea7caf220
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-04 09:03:15 +00:00
Tobias Hunger
6fbf0255eb ProjectExplorer: Remove FolderNode::addNode taking a raw pointer
Change-Id: I53b765d2c3e71889386c76425662bfcc47bdf582
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:29 +00:00
Tobias Hunger
d332954567 ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptr
Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 14:55:15 +00:00
Christian Stenger
8f6a560ed7 CmakePM: Fix compile for gcc4.9
Change-Id: Iecd2dc6df45199de049b02f24b1d1961b296ee2d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-05-02 13:28:51 +00:00
Tobias Hunger
147e6078ad ProjectExplorer: Make FolderNodeFactory return an unique_ptr
Change-Id: I9b611c4a3ff0928b2078dc30a44eb39df67c8d89
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:47 +00:00
Tobias Hunger
1f55ba9012 ProjectExplorer: Use unique_ptr to hold ProjectNodes
Change-Id: Iaa5bea221686564de24138a99b5fe0d09521c118
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-02 11:34:29 +00:00
hjk
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
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>
2018-04-12 12:11:45 +00:00
Orgad Shaneh
7d3a79c696 Utils: Purge asConst
Replace by qAsConst.

Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-09 09:04:00 +00:00
Tobias Hunger
9b495853c6 CMake: Ignore duplicate files in server-mode
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>
2018-01-26 14:34:24 +00:00
Robert Loehning
63e47f903f Improve translated strings and make them consistent
Change-Id: I88a6e6ceaa44b22539449037faa788caa9f349fc
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-01-22 11:56:01 +00:00
Tobias Hunger
7a7a12cef2 CMake: Fix build directory
Fix use of build directory vs. workdirectory in tealeafreader and servermode
reader.

Change-Id: I593579f7ad4facd64cf201368cacc4d3a8414fbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-10-27 09:07:10 +00:00
Tobias Hunger
4acb16272d CMake: Enable switching between different temporary CMake configurations
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>
2017-10-24 11:13:42 +00:00
Tobias Hunger
02533e61cf CMake: Fix project parsing notification
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>
2017-10-06 09:53:40 +00:00
Tobias Hunger
2dabdbd2fe CMake: Report cache configuration arguments in server-mode
Change-Id: I3cd7a9ac37a1b8c3c6018070c6fdc506abedd736
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-04 09:52:43 +00:00
Eike Ziller
3d9cf954e2 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/debugger/gdb/remotegdbserveradapter.cpp

Change-Id: I1ae77869887a8d9ef2a33439f2733315db9e0cf0
2017-09-19 12:10:26 +02:00
Christian Stenger
e255baaa8f CppTools: Add target type information to project part
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>
2017-09-18 10:01:30 +00:00
Marco Bubke
b6e12f4a1c Convert macros from plain QByteArray to a vector of structs
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>
2017-09-14 15:23:56 +00:00
Tobias Hunger
3bb3f4af56 CMake: Filter out CMake input files that are already listed
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>
2017-09-08 11:18:58 +00:00
Tobias Hunger
91f36271e2 CMake: Check build dir first, then source dir in server mode
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>
2017-09-08 11:18:24 +00:00
Tobias Hunger
bcad4a1b94 CMake: Add header icon to <Headers> folder
Change-Id: Ibb5a61ab100dbd3b32de385df230dd0862faf670
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-08 11:18:17 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Eike Ziller
d8fd5292f1 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/tools/clangbackend/ipcsource/clangiasyncjob.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.cpp
	src/tools/clangbackend/ipcsource/clangjobrequest.h

Change-Id: Ib8602530663813ade418f995dfd2a736908cfe75
2017-08-15 10:07:51 +02:00
Tobias Hunger
68768d8e61 CMake: Get rid of <Source Directory> in server-mode
Change-Id: Ifa4f813d577ab64351d25eb4be1dc7981687da23
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-04 13:33:56 +00:00
Christian Stenger
27cb331b4b AutoTest: Avoid guessing run configuration
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>
2017-07-31 06:11:35 +00:00
Eike Ziller
efa5a7b6d7 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	qtcreator.pri

Change-Id: If5f4a9821a23ac0df81eb84b3980f9cf7ecd70ba
2017-07-25 11:54:44 +02:00
Eike Ziller
41127e0f47 Merge remote-tracking branch 'origin/4.3' into 4.4
Change-Id: I4e14ef31dc6cdcc0606d39be90195e30c1ee9b25
2017-07-25 11:50:43 +02:00
Tobias Hunger
336f54def4 CMake: Fix progress calculation in server-mode
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>
2017-07-25 09:35:24 +00:00
Tobias Hunger
d8e0ecb0ab CMake: Extract crossReferences data of targets in server-mode
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>
2017-07-21 12:49:16 +00:00
Orgad Shaneh
5f973de952 Merge remote-tracking branch 'origin/4.3'
Change-Id: Ib5405ed2c3356f65b49fe2f454f8ac2e0de44ef6
2017-06-26 08:24:26 +03:00
Tobias Hunger
64c5f960e8 CMake: Return an empty project tree if parsing failed
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>
2017-06-23 09:56:07 +00:00
Tobias Hunger
228dec629f CMake: Remove spurios newlines
Change-Id: I6f381d4df8b9174f74d1b44364e0fbea58c1e6b6
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-21 08:05:11 +00:00
Tobias Hunger
ba8e7d1156 CMake: Report more cmake errors in server mode
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>
2017-06-20 12:52:34 +00:00
Orgad Shaneh
687466ac47 Merge remote-tracking branch 'origin/4.3'
Change-Id: I126f3a05212a3d5df78812e66285bc9e8078360b
2017-06-20 11:32:02 +03:00
Christian Stenger
cce1e130d7 AutoTest: Fix handling of multiple build targets
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>
2017-06-19 08:14:55 +00:00
Tobias Hunger
210b9aa227 CMake: Provide more information in server-mode
Provide more information about what is happening in server mode.

Change-Id: I69cbf0b2cb197789231499ac601a08af33ed6b6e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-15 13:28:41 +00:00
Eike Ziller
64b19af7dd Merge remote-tracking branch 'origin/4.3'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri

Change-Id: I6d89ea588de955f5d878500b59285d3adde6c77d
2017-05-15 15:31:55 +02:00
Orgad Shaneh
689aa3891d CMake: Ignore dirty signal on server-mode on Windows
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>
2017-05-15 13:23:30 +00:00
Tobias Hunger
112254dc67 CMake: Improve detection of build directory in server-mode
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>
2017-05-12 13:15:32 +00:00