Commit Graph

289 Commits

Author SHA1 Message Date
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
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
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
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
Christian Kandeler
f3834160ae QmakeProjectManager: Remove unused class
Change-Id: I37accbc2e2782a5bd5dc8fadd87d2fd9621df9ad
Reviewed-by: hjk <hjk@qt.io>
2019-04-03 10:56:57 +00:00
Eike Ziller
b3baed58c6 Merge remote-tracking branch 'origin/4.9'
Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
2019-03-21 11:28:21 +01:00
Christian Kandeler
7c69460702 Qmake: Switch back to old way of collecting deployment info
Apparently, there are subtle differences between traversing the nodes
and directly looking at the QmakeProFile children. I'm not quite sure
what they are, so let's go back to the old implementation for now, which
fixes the reported crash.
This partially reverts ccd5955843.

Fixes: QTCREATORBUG-22124
Change-Id: I35a3c20bb09666e8c3af797ebd88761141b7db10
Reviewed-by: Steve Mokris <smokris@softpixel.com>
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 09:57:10 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Christian Kandeler
f18214b407 ProjectExplorer: Allow project managers to provide uniquification
... for otherwise identically-named targets.
It happens quite often in larger qmake projects that some applications
in a nested SUBDIRS structure get the same name (e.g. a tool and its
autotest).
It was until now impossible for a user to differentiate between the
corresponding run configurations: In the list of run configs, we just
appended numbers, and in the UI element for manually creating run
configs, the strings were even entirely identical. For a practical
example, open tests.pro in qtbase and count the number of run configs
called "test".
Now we detect such collisions early and append the relative path of the
project file to the display names of the affected run configurations.
For now, this is only done for qmake projects: The problem cannot occur
with qbs, and we don't have any complaints about cmake. The
infrastructure is generic, however.

Fixes: QTCREATORBUG-9563
Change-Id: Ic076df9b5a8bda7c9a1f88df683f33c837eaa197
Reviewed-by: hjk <hjk@qt.io>
2019-02-01 14:09:13 +00:00
hjk
9bb936499d ProjectExplorer: Collapse BuildInfo hierarchy
... to pass it around as real values, avoiding, among others,
the need of occasional explicit deletion.

The formerly extra members of the derived stuff are handled via
an extra variant (for data) and via a functor in the build
configuration factory.

The change is mechanical.

Change-Id: I19ca4e0c5f0a5b196fc16dfb98bb005dc679f855
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-30 16:51:05 +00:00
hjk
070e0efdcc ProjectExplorer: Rename IBuildConfigurationFactory
... to BuildConfigurationFactory. It hasn't been an Interface for a
while and the new name matches Run- and DeployConfigurationFactory

Change-Id: I923c6a27e18a99628251b69e0270e910836e7b2a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-29 11:38:31 +00:00
Nikolai Kosjar
7b494c068e CppTools: Simplify ProjectUpdateInfo
...by using KitInfo.

Change-Id: I17b4dd6c368ba8b10b765f12a4663c041c9be7e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-10 07:13:49 +00:00
Nikolai Kosjar
4ce9ec5d63 CppTools: De-duplicate code for CppProjectUpdater
Centralize gathering the kit, toolchains and qt version.

Change-Id: I6bd586ac7925e2ee556fd119f1dab096cd500e41
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-10 07:13:38 +00:00
Christian Kandeler
d59663cfe4 ProjectExplorer: Remove SysRootKitInformation::hasSysRoot()
This function is exactly the same as SysrootKitInformation::sysroot(),
except that is returns a boolean. And it's always used like this:
if (SysRootKitInformation::hasSysRoot(k))
    sysroot = SysRootKitInformation::SysrootKitInformation::sysroot(k);
Which means that the same code is executed twice in a row.
There is no point in this, so let's just remove it.

Change-Id: I95e4de101d6164ed48558b888e22ed8892fc6d9b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-09 09:06:36 +00:00
Nikolai Kosjar
820e4f8177 ClangTools/QMake: Stop analyzing files not part of build configuration
...for the qmake project manager.

When parsing the project files, remember whether a file was discovered
by the exact or cumulative parse. Only files that were discovered by the
exact parse are considered "active" and thus part of the build
configuration. The others are not offered for selection.

Fixes: QTCREATORBUG-16016
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I7a28b4de15e048975d7f0cd737dd8c11f744315b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-08 14:09:52 +00:00
Bernhard Beschow
5916be8756 Remove unneeded invocations of CppProjectUpdater::cancel()
The cancel methods were called just before setting up the parameters
for the CppProjectUpdater::update() call, which calls cancel() as its
very first action.

Change-Id: I748cb4daa86bc8245cd906b2dff3c7b2d50795b2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-06 21:49:53 +00:00
Bernhard Beschow
3bdb7d1de5 CppProjectUpdater: Remove unread attribute
Change-Id: I51123e5b5609de431cfa6d1558aed0b9739ff9c8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-06 21:49:28 +00:00
hjk
5b4205d159 QmakeAndroid: Reduce coupling between Qmake and QmakeAndroid
This moves most of the QmakeProject::applicationProFiles code
to its only user, the android side, and only uses the new
 bool includedInExactParse() const hook on the qmake side.

Change-Id: Ica11127c4895be22cafe56757f4cecafa02583ef
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-17 13:21:19 +00:00
Eike Ziller
2529b36b40 Merge remote-tracking branch 'origin/4.8'
Change-Id: Id1484d611d457d8e4598fb53975b2288690b64bb
2018-12-17 10:05:11 +01:00
Christian Kandeler
1934119c42 QmakeProjectManager: Consider unversioned_libname CONFIG value
... when calculating the installation targets.

Fixes: QTCREATORBUG-21687
Change-Id: Ie56ce8b8f21d4ee8ddde983eb3731c5ce5ad0693
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-12 09:45:46 +00:00
Eike Ziller
e5c2ee922a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I743ea39480cc5c7b6febcd2e93713d15a3ae6d9c
2018-12-07 08:53:11 +01:00
Eike Ziller
3e9d7d290c Do not use invalid Qt version for parsing QMake projects
By disallowing the use of kits with invalid Qt versions.
This can happen when e.g. a Qt version is registered that was deleted
later. Project parsing then fails anyhow, and on Windows even an assert
triggers in debug mode. Better disallow using the kit and provide
information why.

Fixes: QTCREATORBUG-20825
Change-Id: Id6c084c3880c90e691882396653ce7cc6a531699
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-06 16:16:52 +00:00
hjk
a46fccda0f QmakeProject: Simplify interface
From the QmakeProject::Parsing enum only the ExactParse was used
via function default parameters and always compared to the
ExactAndCumulativeParse value.

This has been like that since at least 4.4 (proably longer), so
it's fair to assume it's not needed.

Change-Id: I46c227cf1fa6e6aea0b184b49937e7cb129db635
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-12-05 07:18:30 +00:00
Tobias Hunger
f0226d9644 Qmake: Use target-specific extension for deployment
Add file extensions to execatables about to be deployed based on the
OS found in the toolchain's targetAbi instead of using the hostOs().

This should fix deployment from windows to non-windows machines.

Task-number: QTCREATORBUG-21608
Change-Id: I83678bda1d56ff24848b7b498b95081d00b5a5f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
(cherry picked from commit 383f0b9fcc)
2018-12-02 09:37:54 +00:00
Tobias Hunger
383f0b9fcc Qmake: Use target-specific extension for deployment
Add file extensions to execatables about to be deployed based on the
OS found in the toolchain's targetAbi instead of using the hostOs().

This should fix deployment from windows to non-windows machines.

Task-number: QTCREATORBUG-21608
Change-Id: I83678bda1d56ff24848b7b498b95081d00b5a5f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2018-12-02 09:34:58 +00:00
hjk
ccd5955843 QmakeProjectManager: Make target search operate on project nodes
This makes the using code a bit less dependent on qmake specifics
(qmake related ProjectNode specialization vs qmake-only class)

Change-Id: Ied6ced70694b3ac0665d88ec86c4a66577f3a672
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-28 12:25:23 +00:00
Tobias Hunger
96e300c0e6 BuildTargetInfo: Make sure changes are actually detected
Make sure that significant changes to the build target information is detected.

Improve operator== to look at all the members. The problem here is that the
runEnvModifier can not meaningfully get compared. So add a uint that is expected
to change whenever the runEnvModifier changes in a significant way.

This makes sure that build target information gets actually updated, which then in
turn enables the updated information to become visible in the UI.

Task-number: QTCREATORBUG-21475
Change-Id: Ifa238f90fc4acba8e29b81959fa40f036b632b3d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-11-19 09:43:58 +00:00
Nikolai Kosjar
5900766ecb Toolchains: Detect unspecified language version
We checked the command line from the project manager for "-std=X" and
friends to figure out the language version to use. However, if such a
flag was not provided, we assumed the latest version we support. This
could conflict with the actual version of the compiler and its
predefined macros.

Figure out the version by inspecting __cplusplus/__STDC_VERSION__ in the
predefined macros of the toolchain. The MSVC compiler is an exception to
this, as it does not seem to properly set the value - check for
_MSVC_LANG if possible, otherwise simply assume some versions as before.

While at it, add also support for C17/C18 and the upcoming C++2a.

Task-number: QTCREATORBUG-20884
Task-number: QTCREATORBUG-21188
Change-Id: I464ffcd52d2120c0208275a050e82efda44fae1c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-08 09:07:56 +00:00
Tobias Hunger
1df553a683 ProjectExplorer: Rename IncludePathType to HeaderPathType
It is the type used by the HeaderPath class, so reflect that in
the name.

I also considered to rename HeaderPath to IncludePath, but
that name is reflected in a lot of users, which would also need
to be adjusted for consistency. That would blow up the patch size
for little value IMHO.

Change-Id: I51421dbd3ab8b2874dc32fc82dc394c9b93ce5e9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-13 11:32:31 +00:00
Tobias Hunger
089cf07820 QMake: Make sure executable targets have executable suffixes
Task-number: QTCREATORBUG-9022
Change-Id: Id885a81228090a18128b8d145b50d89294db31c2
Reviewed-by: hjk <hjk@qt.io>
2018-09-12 10:10:18 +00:00
Marco Bubke
3abaf647d0 Add system include path to HeaderPath and merge ProjectPartHeaderPath
System include paths are appended after other includes by the compiler. So
we should set them as system includes and not as normal includes. Otherwise
we change the include order. Headers in system include paths are not
cluttering the screen with unwanted warning and by the way improve
performance too.

ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them.

Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-09-10 09:31:32 +00:00
Christian Kandeler
2485eb1a8c QmlDesigner: Do not require a qmake project for designer import paths
Let's enable all build system plugins to provide this information.

Task-number: QTCREATORBUG-20810
Change-Id: I0ef953e3c2c9a2be1fc4187e93232e9a2aeacafd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-08-20 12:44:41 +00:00
hjk
888d940de2 QmakeProject: Simplify QmakeProject::updateBuildSystemData
destDir isn't used after a certain point, no need to update it anymore.

Change-Id: I106ce6a521425811b3fa352724e4bed7ac8d7d48
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-08-01 10:47:19 +00:00
Alessandro Portale
cd5066d86b QmakeProjectManager: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-equals-default

Change-Id: I7642992eee6838bb2566921de87390c1771ebcbe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-13 09:25:21 +00:00
Orgad Shaneh
3c8dec2398 QmakePM: Show kit name in compiler mismatch message
Change-Id: Ib5bfd90064c525a7b599434d31ab704e8e110d1a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-11 12:29:47 +00:00
Orgad Shaneh
c7ae8a7dab QmakePM: Reduce nesting in QmakeProject::testToolChain
Change-Id: If4e7af104844a0da74dec7e3c8a343b120e7822a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-07-11 12:26:26 +00:00
Tobias Hunger
460fdc02e0 ProjectExplorer: Report project-specific kit errors/warnings
Report project-specific warnings about the kit used in Project Mode.
E.g. a python project should not complain about missing toolchains,
while a qmake project should.

Change-Id: I5ce6742683cdeffc7ff3f1a3e8f0b89aee9aa0b4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-19 13:21:45 +00:00
Eike Ziller
7099f21586 Merge remote-tracking branch 'origin/4.6'
Change-Id: I959428882b9da427c6bf522145646048141888c6
2018-04-19 09:25:04 +02:00
Tobias Hunger
fefce829ad Qmake: Invalidate contents of QmakeVfs on target change
Task-number: QTCREATORBUG-20113
Change-Id: I13cd3749a942cc06172dd63f163bff88490a44ed
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-17 08:35:23 +00:00
Eike Ziller
185fe0c705 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androidrunnable.h
	src/plugins/android/androidrunner.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
	src/plugins/qmakeprojectmanager/qmakeproject.cpp
	src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp

Change-Id: I68093d44cfd672347eab82459ff70c21a32297ce
2018-04-17 10:09:35 +02:00
Tobias Hunger
fa11070977 QMake: Make signalling of parsing state more robust
Move the emitParsingStarted into a location that is called
from both methods that had it before.

Also add an QTC_ASSERT into incrementPending, which is
triggered by the qmake parsing code directly. If something went
wrong before, then the signal will be sent anyway and in the
right sequence -- although the start signal is a bit late at
that point.

Task-number: QTCREATORBUG-20203
Change-Id: I64611e471d1e4959d5cfe0118223594a04238433
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-16 12:43:39 +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
hjk
fb8f007bbb Android: Move some unshared code closer to its only place of use
Change-Id: Ieaba2c8f76ee9ac020ebd44712aee593c34e4bf0
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-04-12 07:03:06 +00:00
Tobias Hunger
94cb7c988b QmakeProject: Do not try to emit "parsingStarted" several times
This prevents a soft assert from triggering.

Change-Id: Ic2b650f1c850d87492bad8f23d200ede0de35722
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-11 13:23:47 +00:00
hjk
96b5fa208f Qmake: Remove QmakeProject::runConfigurationCreators
Not used anymore.

Change-Id: Idba6fd4a8d6f4c7e251a78568b1da0debd93bf5f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-05 12:21:26 +00:00
hjk
07d8b7bfa4 Qmake: Remove now-unused QmakeProject::hasApplicationProFile
Change-Id: Ie309468a124497c0aafa3911b5bd6939a9adcb3d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 12:32:14 +00:00
Eike Ziller
278a5f1e33 Merge "Merge remote-tracking branch 'origin/4.6'" 2018-03-16 10:29:37 +00:00
hjk
55961a367d QMake: Adapt DesktopQMakeRunConfiguration to applicationTargets() use
Change-Id: I2844e2e97ca78c12c4abdb1538c37e77b841918e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-03-16 09:58:02 +00:00
Eike Ziller
cb84ae1a21 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp
	src/plugins/qmakeprojectmanager/wizards/testwizard.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/gettingstartedwelcomepage.cpp

Change-Id: I126823f5f60613509520c07f52be7bc9d4f4367c
2018-03-16 09:28:08 +01:00