Commit Graph

3443 Commits

Author SHA1 Message Date
Tobias Hunger
9e50d47b5c CMake: Use unique_ptr to manage builddirreader
Change-Id: I1acac29bdfa4dfaaf79835636c3e3a4484e8183c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-06-06 14:34:18 +00:00
Tobias Hunger
aad9828dca CMake: Detect fileapi in cmake
Detect whether cmake supports fileapi or not. This is based on the
version number since cmake upstream does not want to add a flag into
the capabilities output:-/

Change-Id: I036adf65cbd1b171f0f98a7c86230a7ca33fff32
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-06-06 14:33:17 +00:00
Tobias Hunger
6a3ec1928c CMake: Remove needless tests
These tests were done just before calling these methods.

Change-Id: If9801609ff8b1c18d8cc6b446e80a998abc2a5cf
Reviewed-by: hjk <hjk@qt.io>
2019-06-06 14:13:42 +00:00
hjk
611e1ea837 Utils: Encourage marking of raw command line parameters
Change-Id: Id66ac07732c66ab8c1232fe1f58042de8a61abb0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-06 12:22:47 +00:00
hjk
6c8f44d261 CMake: Use Utils::CommandLine for server mode process
Change-Id: I53e62c753865be78cd11581e34c77a763748ab40
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-03 14:05:44 +00:00
hjk
fa38a31644 CMake: Use Utils::CommandLine for CMakeBuildStep
Change-Id: I0490b1edf073c680f24ad7de10b544443ae62c5e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-03 11:20:39 +00:00
Orgad Shaneh
b500119fd7 CMake: Support building a single file
Fixes: QTCREATORBUG-18898
Change-Id: I0ec24b20bfa8d43093b6e6681ddd752fbdea2088
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-29 20:09:24 +00:00
hjk
4098be05b2 Utils: Extract a CommandLine structure from a QtcProcess
We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:36:46 +00:00
Alessandro Portale
0933c20de8 connect() to ambiguous signals/slots: Replace static_cast with QOverload
Change-Id: I473d7a2a16509cee944a2a21b022a3f6f02cfd8d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 14:07:03 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
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>
2019-05-28 12:23:26 +00:00
Eike Ziller
4704f49fbb Merge remote-tracking branch 'origin/4.9'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp
	src/plugins/qmldesigner/qmldesignerextension/timelineeditor/preseteditor.cpp
	src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelinesettingsmodel.cpp
	src/shared/qbs

Change-Id: I369368de9b9c682b03e224d489589043e1f6782b
2019-05-28 14:01:01 +02:00
hjk
774d2063d0 ProjectExplorer: Use the new way for dependent aspects
... for WorkingDirectory aspects.

Change-Id: Idf64f1daeb74a70637bb983db1b45f0132cfc299
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 10:48:02 +00:00
hjk
33ea685a91 Directly construct KitAspect::toUserOutput return values
Less dependent on used type and actually saves cycles.

Change-Id: I87344172c330198e98c11205a80862b3b30271e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-28 07:22:55 +00:00
hjk
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +00:00
hjk
24560d8830 CMake: Avoid a temporary QFileInfo
Change-Id: Ifaf8ecb3601881003b739027e81c0216744be5f5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-28 05:51:08 +00:00
Christian Stenger
411678048d CMake: Set the correct build system target to the project part
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>
2019-05-27 11:35:52 +00:00
hjk
dc9cbd8f57 More FileName::appendPath() -> .pathAppended() changes
Change-Id: Ibc7eb4eb3ffb64658e441aafa240b1ddc0061930
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 09:10:19 +00:00
Christian Kandeler
e59bcd9962 ProjectExplorer: Add a "product" tag to the ProjectNode class
A product is a project node from which a target binary is produced, such
as a Product item in qbs or a .pro file in qmake.

Change-Id: I6a0e6bed6c02684cb03b2b18fed6a1b493fa78b2
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 08:25:57 +00:00
Orgad Shaneh
1e138fbe10 Remove excess blank lines after namespace
Change-Id: I4e4f83017f2bfc2cf842c4c971ed4b05e0447e6a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-27 06:50:16 +00:00
Aaron Barany
0131439288 CMake: don't disable widgets on configuration error
If the configuration failure was caused by an incorrect option, you want to
be able to fully use the UI to fix the issue.

Change-Id: I3048b1f6e0b4d88e90433df9a36ca18fa72c03c6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-24 08:03:12 +00:00
hjk
0595e67c82 More FileName::pathAppended()
Change-Id: Ie20ec34ea9712b3ec49e6233b23cef84c2019f03
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-20 14:37:13 +00:00
hjk
535f0da977 Utils: Make FileName::shortNativePath a member
Change-Id: If1ab02ae9dc7efb97792cdf3bbdce3bba18b3e3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-20 13:07:38 +00:00
hjk
36daca80f3 Utils: Make FileName::canonicalPath a member
Change-Id: I8d7450dec5c4c14ae3e007d1d66f1a9c3c98f807
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-20 11:06:12 +00:00
Cristian Adam
d855b84c5d Qt Creator CMake port
Based on Tobias Hunger's work from a few months ago.

The CMake configuration needs libclang and Qt paths specified as
CMAKE_PREFIX_PATH.

Auto tests are run with "ctest". At the moment the pass rate is 87%.

Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 13:33:28 +00:00
hjk
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
hjk
31700217b1 Cmake: Use FileName::pathAppended()
This one is weird: The trailing toString() was practically dead.

Change-Id: I02d24bf655dd32ed5f66e9d99c3cef7e150105dc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-16 08:27:36 +00:00
hjk
0e4df97f90 Some more FileName::appendPath -> pathAppended() changes
Change-Id: Ia05b54f157b08353d5a9efccee48dfc212d3a489
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-15 13:19:58 +00:00
hjk
9433b8a7e7 ProjectExplorer: Use Utils::FileName in ProcessParameters
For the command and the working directory.

Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-15 12:55:22 +00:00
hjk
f99d69ee43 Utils: Replace mutating FileName::appendString
... by a non-mutating .stringAppended, doing the same.

Change-Id: I7adb6cae3415942cc9a80088bd75cda9d577d4a5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-15 07:42:59 +00:00
hjk
ce449e4219 ProjectExplorer: Remove BuildTargetInfoList wrapper class
Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-14 13:30:34 +00:00
hjk
790bcf5ef0 CMake: Remove CMakeBuildTarget::clear()
One of the few users of the non-const FileName::clear().

Change-Id: Ic1fa5c5ec24ff41170317bf46ed61543a6bfcb42
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-14 10:48:31 +00:00
hjk
6a1a5be10c Remove unused files
Change-Id: Ib6b32129d8fc8ccc35f6911a340abf9b5beb2432
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-13 07:57:20 +00:00
Eike Ziller
4545c81e57 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	doc/src/howto/creator-sidebar-views.qdoc
	doc/src/howto/creator-ui.qdoc
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/autotest/testresultmodel.cpp
	src/plugins/autotest/testresultmodel.h

Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
2019-05-08 12:41:25 +02:00
Eike Ziller
534fcfcd45 Fix Qt version for auto-detected kits
Fixes a regression in d4565be655 that
leads to all desktop Kits being assigned a default desktop Qt version,
even though the installer registered these kits with a specific Qt.

Implementations of KitAspect::setup may not unconditionally override an
existing value, since it is called on the kits restored from the install
settings. This is needed because the installer registers toolchains and
debuggers by referring to them via an ABI ("this kit has a debugger that
can handle this specific ABI"), since the installer doesn't know e.g.
about installed MSVC toolchains itself.
That's why ToolChainKitAspect and DebuggerKitAspect may modify an
existing value in their "setup" method. If this should be moved
somewhere else, e.g. "fix", should be investigated, but in a separate
refactoring.

Change-Id: Ibd99e4da03cd7130c49294f4ac79cd8e346fb1b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-07 13:24:24 +00:00
Orgad Shaneh
7a5d8f4aab CMake: Fix inconsistent copy ctor/operator=
Detected by GCC9.

Looks like inCMakeCache was left out by mistake in df62701801.

Change-Id: I231d0d3e102edb95b657aef42c3f2f2f834514a0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-07 08:56:55 +00:00
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
1de548d1cb Revert "ProjectExplorer: Upstream CMake's handling of outdated builds"
This reverts commit 8536504caa.

Break CustomRunConfigurations.

Change-Id: I43020bd34780cb5fd02bbe640a817370d73cca18
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-05-03 16:05:34 +00:00
hjk
a5148b5363 ProjectExplorer: Rename ProjectTree::findCurrentNode to currentNode
For consistency, it's straight forwards access, similar to
currentProject, not much to search and find.

Change-Id: I7ce696bdc24b6a8713d6f11e02443a6f94c605f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 17:10:39 +00:00
Asit Dhal
b1a421bf2d cmake: do not change filter line edit state in case cmake parsing fails
Fixes: QTCREATORBUG-20289
Change-Id: I920c6fe977dd645f4685d2b0ea398ce91e63ab91
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-04-29 08:20:08 +00:00
Daniel Teske
ba73d97852 Add path completion to .pro and CMakeLists.txt editors
Finished-by: Christian Kandeler <christian.kandeler@qt.io>
Fixes: QTCREATORBUG-5915
Change-Id: Ic5cdcbf33252ddab10c247439c06b0c1e35bef0d
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-04-25 11:53:13 +00:00
Christian Kandeler
fc4e202821 CMakeProjectManager: Fix deployment data setup
In 73b1a765f3, we did not consider that the order of the code mattered,
so we overwrote user-provided deployment information with guessed
locations.

Fixes: QTCREATORBUG-22184
Change-Id: Ied3a7436829e8b857c32e9364508a33414927c99
Reviewed-by: hjk <hjk@qt.io>
2019-04-24 11:56:13 +00:00
Christian Kandeler
261d7752b0 RemoteLinux: Retrieve deployment info from local install root
This provides correct deployment information as seen by the build system
when Qt Creator cannot retrieve it directly.
It's most useful for autotools and cmake projects, but can also help
with qmake in certain edge cases.

[ChangeLog] It is no longer necessary to provide a
QtCreatorDeployment.txt file when using CMake projects with remote Linux
devices.

Fixes: QTCREATORBUG-21855
Change-Id: I27e07a45dd1565e489f4b573cc3fff8191c57d9b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-23 15:52:05 +00:00
Ivan Donchevskii
2c5808bada CompilationDatabase: Ask for the root path and scan for headers
Let's use the same approach we have for CMake projects by using
the same TreeScanner class.

Compilation database does not have a concept of the root directory
so let's show a file dialog and ask for it the first time the project
is loaded. Next times we open it we take this path from settings.
This root path can later be changed from the project tree context menu.

Fixes: QTCREATORBUG-22031
Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-04-05 15:26:19 +00:00
hjk
841bbfa7bf ProjectExplorer: Switch order of template parameters
... of SimpleRunWorkerFactory.

This requires being explicit about the SimpleTargetRunner worker
default, but makes the template re-usable for current users of
RunWorker::registerWorker() which I would like to phase out now,
for less variations in the RunWorkerFactory setup.

Change-Id: I32638437e5bb29f143650f5fde706711ab25accf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-02 09:46:48 +00:00
Christian Stenger
5944c7f0f6 CMakePM: Fix order of initialization
CMakeToolManager instance must be created first to avoid connects
to a nullptr.

Change-Id: If8738a26d58c80ffc9a63193240895f1bc9a87ae
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-20 05:47:40 +00:00
hjk
1bc10248c0 ProjectExplorer: Introduce a SimpleRunWorkerFactory template
... and use in as replacement for RunConfiguration::addRunWorkerFactory.

It is still convenient to have a simple way to set up run worker
factories for the typical "just run for this configuration" case,
but it's even better if it follows the nowadays predominant pattern
of keeping factories in the plugin's pimpl.

Also, it turned out there were two copies of
QmlProjectRunconfigurationFactory code, one is enough.

Change-Id: I0b28c4ea18d0f52165a49f6133dc8687a3b9c7cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-19 15:56:17 +00:00
hjk
fb4d8b5a01 ProjectExplorer: Make kit aspects self-register
Also, construct the KitManager implicitly when the first
KitAspect is created. Ramp-down is still explicit and
somewhat odd.

Change-Id: If1506e1d0789ecabbaad2d8008851d0b42c5218b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-18 14:14:28 +00:00
Christian Kandeler
d4565be655 ProjectExplorer: Drop KitAspect::defaultValue()
The functionality of this function overlapped with KitAspect::setup(),
leading to unclear responsibilities and resulting in bugs such as the
one fixed by 776d54e435.
Therefore, we drop the defaultValue() function, merging its
implementation with setup() where applicable.

Change-Id: Iefa9c3df8b76e97ddf9ad388516621f7ea6558d4
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 14:47:18 +00:00
Christian Kandeler
8c0037af52 ProjectExplorer: Let user provide default for "run in terminal"
We enable the "Run in terminal" checkbox for all applications that
declare themselves console apps, but that's not necessarily what the
user wants. So let them opt out of this mechanism via a global setting.

[ChangeLog] There now is a global setting for "Run in terminal".

Change-Id: Ieeed72fdd01144d9aec0a7c7d4a12b9e5a94cd1d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 11:59:47 +00:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00