summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager/servermodereader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppTools: Move RawProjectPart to ProjectExplorerEike Ziller2019-09-111-5/+5
| | | | | | | | 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>
* CppTools: Move QtVersion and BuildTargetTypeEike Ziller2019-09-101-2/+2
| | | | | | | | | | | | | 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>
* ProjectNodes: Use QVector instead of QList for LocationInfoTobias Hunger2019-07-291-1/+1
| | | | | Change-Id: I5bad9e1849b9d752de24626013c9102242d11a0a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Make CMakeParser work againTobias Hunger2019-07-251-0/+1
| | | | | | | | | | | | | | | | 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>
* CMake: Make server-mode handle server restartsTobias Hunger2019-07-231-5/+31
| | | | | | | | | | | | | | | | | | | | Make ServerModeReader::parse handle the forceCMakeRun flag gracefully. The problem there was two-fold: 1. The server would send a "isReadyNow" signal when its connection is estabilshed. This made the ServerModeReader trigger another parse run with the same parameters. That would in turn would force a new ServerMode process to be created. 2. The "configure" request that is sent races the new ServerMode process being connected. Solve both issues by connecting a slot to the server-mode's connected signal and have that do the right thing. Change-Id: I26f9ac00d6ad6397a1fd1fab78610951f535ab53 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Simplify buildkey generationTobias Hunger2019-06-201-1/+1
| | | | | | | | | | | | | Just use the target name as buildkey. This is unique in cmake projects, so there is no need to mangle the source directory into the whole thing. This is a problem since different readers might report different source directories. That will then result in RunConfigurations getting duplicated after switching the reader types. Task-number: QTCREATORBUG-22129 Change-Id: I849ab68f221d732341e98faa9a4e757d3a495b2a Reviewed-by: hjk <hjk@qt.io>
* CMake: Avoid a bit of useless processing when updating the project treeTobias Hunger2019-06-201-15/+14
| | | | | | | | | | | Do not pass around a list of filenodes with all the known header files. That list gets converted into a QSet<FilePath> and then that is used. Just generate the QSet<FilePath> directly and avoid that conversion. Change-Id: I2444a2a6b4a1600fe476e66673a1a2e9c8900764 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io>
* CMake server-mode: Make sure the target's source dir is absoluteTobias Hunger2019-06-201-25/+29
| | | | | Change-Id: I3c74e3a0ee9c854e4b97826a4397579d4755d8e0 Reviewed-by: hjk <hjk@qt.io>
* CMake: Add an option to override cmake reader typeTobias Hunger2019-06-201-0/+3
| | | | | | | | | | | | | | | Add an option to override the cmake reader type that is going to be used. By default the reader type is "auto" for autodetection, but that can get changed in the cmaketools.xml settings file. Other supported options are "tealeaf", "servermode" or "fileapi" and that will force that reader. You can also set QTC_CMAKE_IGNORE_FILEAPI=1 in your environment to force creator to ignore the existence of fileapi support in all cmake tools. Change-Id: I2006616312090ce2909154dc1966f7a8eaa2949a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Add initial fileapireader classTobias Hunger2019-06-201-14/+21
| | | | | Change-Id: I620cba7cc1c2a5ac56789fa9770dce573c6b19cd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Keep more accurate information on build typesTobias Hunger2019-06-191-4/+4
| | | | | | | | | | Do not map anything vaguely library-related into DynamicLibraryType. This will prevent creator from e.g. trying to deploy ObjectLibraries. Change-Id: I34a0d981d2a949f587e1804268cc66231aedd545 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Unify error reporting for builddirmanager's information retrievalTobias Hunger2019-06-131-4/+9
| | | | | | | | | | | | | Use a dedicated errrorMessage out parameter for error reporting in the builddirmanager methods related to information retrieval. Those are called after the parsing has finished. This frees the errrorOccured signal of the builddirmanager to be used only when the parsing itself has failed. Change-Id: Ieefc32c0386769479177a6bd4bc4a0e77df5db7b Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Fix warnings in servermode readerTobias Hunger2019-06-131-3/+3
| | | | | Change-Id: I22dd49911154fdb4f813a2ee69195d9183cb11b6 Reviewed-by: hjk <hjk@qt.io>
* CMake: Move some code out of the ServerModeReaderTobias Hunger2019-06-131-152/+1
| | | | | | | ... so that it can get re-used in the to-be-written fileapi reader. Change-Id: I2693e6bb102d910eb505882bf3468c34272a5d04 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Make sure to run cmake when that is requestedTobias Hunger2019-06-121-36/+50
| | | | | | | | Pass on the request to run cmake on to the builddirreaders. Task-number: QTCREATORBUG-19704 Change-Id: Iafeba61f46d6bb6783fc62d0504bb07dde2c4612 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Make all readers use isReadyNow() signalTobias Hunger2019-06-071-6/+1
| | | | | | | | The tealeafreader used to not ever use this signal and used the isReady() method to short-circuit the whole mechanism. Change-Id: I2f7caedeedf977c70a5d7807e3a92775757a6fef Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* CMake: Support building a single fileOrgad Shaneh2019-05-291-0/+1
| | | | | | Fixes: QTCREATORBUG-18898 Change-Id: I0ec24b20bfa8d43093b6e6681ddd752fbdea2088 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-43/+43
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CMake: Set the correct build system target to the project partChristian Stenger2019-05-271-1/+1
| | | | | | | | | | | | | The internal build target key had changed again. Adapt and use a more error proof pattern to be hopefully safe if it may change again. The wrong build target key led inside the AutoTest plugin to a wrong comparison of build target of the project parts vs. the build target of the run configuration which in turn ended up in always deducing the run configuration for the test runner. Change-Id: I32df578df85cc0206c2b8fdac00acc3a798f0d73 Reviewed-by: hjk <hjk@qt.io>
* More FileName::appendPath() -> .pathAppended()hjk2019-05-171-4/+2
| | | | | Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Remove redundant std::moveOrgad Shaneh2019-05-071-1/+1
| | | | | | | Detected by GCC9. Change-Id: I07b602c263c6f08a4e243f98832941397efbb4e9 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Use setter for VirtualFolder's priorityhjk2019-02-261-3/+4
| | | | | | | More uniform code. Change-Id: I9a10a1bb15b0df9cf30c68d2c0537bfae2bed98a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Remove Node::m_idhjk2019-02-261-2/+2
| | | | | | | | 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>
* CMakeProjectManager: Do not mark source-tree CMakeLists.txt as generatedhjk2019-02-251-8/+17
| | | | | | | | 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>
* ProjectExplorer: Remove FileNode's isGenerated constructor boolhjk2019-02-251-3/+4
| | | | | | | Use setter of base class, similar to setListInProject() before. Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMakeProject: Prefer assignment to out parameterBernhard Beschow2019-01-271-1/+5
| | | | | | | | | 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>
* CMake: Simplify servermodereader.cpp:createProjectNodehjk2018-12-181-7/+5
| | | | | | | | 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>
* CMake: Suppress header-only targets from code modelTobias Hunger2018-11-191-0/+13
| | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-05-281-38/+66
|\ | | | | | | | | | | | | Conflicts: src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h Change-Id: I192b9e88f967182f3275b4b98abed1220c26daac
| * server-mode: Always try to read CMakeCache, even after errorTobias Hunger2018-05-221-38/+66
| | | | | | | | | | Change-Id: Ib3d4fb5ac14340a7f706e4a1d8a0cbdc420d01d1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | CMake: Do not crash when deleting cmake toolsTobias Hunger2018-05-281-6/+9
|/ | | | | | | | 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>
* ServerModeReader: Fix crash when filtering out known headersTobias Hunger2018-05-181-2/+1
| | | | | | | Task-number: QTCREATORBUG-20412 Change-Id: I9e58b099ef002b3139576b15507f191e1c5a5ced Reviewed-by: Jan Kundrát <jkt@kde.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CMake: Use FolderNode::addNestedNodes for unique_ptr in server-modeTobias Hunger2018-05-041-50/+61
| | | | | | | | 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>
* ProjectExplorer: Remove FolderNode::addNode taking a raw pointerTobias Hunger2018-05-021-17/+19
| | | | | Change-Id: I53b765d2c3e71889386c76425662bfcc47bdf582 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Add and use addNestedNode(...) that takes unique_ptrTobias Hunger2018-05-021-2/+2
| | | | | Change-Id: Ieb26721d053111fb350494e31d1f6da3fe642420 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CmakePM: Fix compile for gcc4.9Christian Stenger2018-05-021-1/+1
| | | | | Change-Id: Iecd2dc6df45199de049b02f24b1d1961b296ee2d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* ProjectExplorer: Make FolderNodeFactory return an unique_ptrTobias Hunger2018-05-021-8/+6
| | | | | Change-Id: I9b611c4a3ff0928b2078dc30a44eb39df67c8d89 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Use unique_ptr to hold ProjectNodesTobias Hunger2018-05-021-1/+1
| | | | | Change-Id: Iaa5bea221686564de24138a99b5fe0d09521c118 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* ProjectExplorer: Consolidate RunConfiguration identificationshjk2018-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Utils: Purge asConstOrgad Shaneh2018-04-091-4/+3
| | | | | | | | Replace by qAsConst. Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* CMake: Ignore duplicate files in server-modeTobias Hunger2018-01-261-1/+5
| | | | | | | | | | | | | | | | | | 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>
* Improve translated strings and make them consistentRobert Loehning2018-01-221-1/+1
| | | | | Change-Id: I88a6e6ceaa44b22539449037faa788caa9f349fc Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* CMake: Fix build directoryTobias Hunger2017-10-271-4/+4
| | | | | | | | Fix use of build directory vs. workdirectory in tealeafreader and servermode reader. Change-Id: I593579f7ad4facd64cf201368cacc4d3a8414fbf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* CMake: Enable switching between different temporary CMake configurationsTobias Hunger2017-10-241-2/+2
| | | | | | | | | | | | 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>
* CMake: Fix project parsing notificationTobias Hunger2017-10-061-24/+25
| | | | | | | | | This builds on top of 08677c0b014cc44d944e32d462f502a67c948404 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>
* CMake: Report cache configuration arguments in server-modeTobias Hunger2017-10-041-1/+4
| | | | | Change-Id: I3cd7a9ac37a1b8c3c6018070c6fdc506abedd736 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Merge remote-tracking branch 'origin/4.4'Eike Ziller2017-09-191-8/+25
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/debugger/debuggerdialogs.cpp src/plugins/debugger/gdb/remotegdbserveradapter.cpp Change-Id: I1ae77869887a8d9ef2a33439f2733315db9e0cf0
| * CMake: Filter out CMake input files that are already listedTobias Hunger2017-09-081-8/+25
| | | | | | | | | | | | | | | | 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>
* | CppTools: Add target type information to project partChristian Stenger2017-09-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Convert macros from plain QByteArray to a vector of structsMarco Bubke2017-09-141-13/+9
| | | | | | | | | | | | | | | | | | | | | | 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>