Commit Graph

56 Commits

Author SHA1 Message Date
Tobias Hunger
63f31a1e4b CMake: Make cmake build step available to all build step lists
"cmake --build ." is useful to build, clean and deploy, so offer it
everywhere.

This fixes soft asserts as a side effect when loading cmake projects with
existing "cmake --build . --target=clean" in their clean steps.

Change-Id: I39e5866f6012b9ea1153da324e4abd1cd25fea92
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 10:40:18 +00:00
Tobias Hunger
9f21358cbe CMake: Remove code that is obsolete since QtC 3.7
Saved data has changed in QtCreator 3.7, remove compatibility code.

Change-Id: I27e1f163f905b5f8fd105f3cdeaf047777a1c06c
Reviewed-by: hjk <hjk@qt.io>
2018-03-23 10:40:12 +00:00
hjk
53a151074a ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.

- Collapse the two lines of constructors similar to what
  890c1906e6 did for RunConfigurations
  * Deploy* was purely mechanical
  * Build* ctors are split in connects() in the ctor body
    to create "empty shell for clone" etc
    and build step additions in initialize() functions which
    are only used in the create() case.
  -- Allows to collapse the shared 'ctor()' functions, too.

- Move FooBuildConfigurationFactory::create() implementations
  to FooBuildConfiguration() constructor. That was a strange
  and unneeded ping-pong between factories and objects, and
  furthermore allows one level less of indirection (and for a
  later, left out here, some reduction of the
  FooBuildConfiguration interfaces that were only used to
  accommodate the *Factory::create() functions.

- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
  but there wasn't one in the base classses. Have one there.

- Most canHandle() functions were checking simple restrictions on
  e.g. project or target types, specify those by setters in the
  constructors instead and check them in the base canHandle()

- clone() is generally replaced by a creation of a "shell object"
  and a fromMap(source->toMap()), implemented in the base, there
  are two cases left for Android and Qbs that needed(?) some extra
  polish

- generally use canHandle() in base implementation, instead
  of doing that in all Derived::canFoo()

- as a result, canCreate/create/canClone/clone reimplementations
  are not needed anymore, keep the base implementation for
  now (could be inlined into their only users later), but
  de-virtualize them.

- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
  'dsym' build step they could create.

- Split the 'mangled' id into the ProjectConfiguration subtype
  specific constant identifier, and a QString extraId() bit.
  Only maintain the mangled id in saved settings.

- Make ProjectConfiguration::m_id a constant member, adapt
  all constructors of derived classe.

Not done in this patch:

- Finish possible cosmetic changes on top

- Add a way to specify restrictions to supported Qt versions
  (used in Android/Ios), as the base implementation does not
  depend on the qtsupport plugin

- Combine the QList<X> availableFoo() + createFoo(X) function
  pairs to somthing like a direct
   QList<struct { X; std::function<X()>; }> fooCreators()
  to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
  pingpong

- Remove the *Factories from the global object pool

- Do something about priority(). Falling back to plain
  qmake in android+qmake setup is not helpful.

Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-08 11:17:55 +00:00
Eike Ziller
7f626b1182 Merge remote-tracking branch 'origin/4.5'
Change-Id: Iceaa4ca40b5318744bde8a76c6d3ccca08df71bb
2017-10-25 16:07:21 +02:00
Leena Miettinen
f4cd9cdb6a CMake: Fix UI text
Change-Id: I3587084925089c7bb7ffb9cfb09f6b822b215cd8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-24 08:47:52 +00:00
Eike Ziller
07bec99e8f Merge remote-tracking branch 'origin/4.5'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/gcctoolchain.cpp

Change-Id: Iaad0659293681cce4266fc3e4ba2a4f2068de911
2017-10-09 12:09:27 +02: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
c330cf0679 Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-10-04 09:35:06 +00:00
Daniel Trevitz
b5379d599f cmake: Crash when removing
Fix nullpointer error. Occurs when no active project exists

Task-number: QTCREATORBUG-18865
Change-Id: I826daac39c38ae1382d23cae20da9085dbcfe298
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-08 09:28:57 +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
Tobias Hunger
f119eec4d1 Project: Get rid of builddirectoryChanged signal
Get rid of Project::buildDirectoryChanged signal as well as
Target::buildDirectoryChanged (and the infrastructure).

Change-Id: Ia749e62eec7e182e558d81115dc2a3d07b72b346
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:20:37 +00:00
Tobias Hunger
e52ebbf217 ProjectExplorer: Add subscribeSignal method to targets and projects
Add a subscribeSignal method to targets and projects that will make
sure all signals of all project configurations added during the lifetime
of the project/target will get connected (if the type matches).

Use this to connect to some signal in all BuildConfigurations of
a project and get rid of code that keeps connecting to the current
build configuration.

Use Project::buildEnvironmentChanged as an example and convert its
usages.

Change-Id: I689bcebac4b191bf3f8a18765bf18eaac371c5fe
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-02 11:19:28 +00:00
Tobias Hunger
46f39f5601 CMake: Simplify signaling
Change-Id: I50fdaed0d813b5004c1756e9c5a6efd3ce7a3318
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-26 09:29:47 +00:00
Tobias Hunger
b8e348c4af BuildStep: Do not use QLatin1String/QLatin1Char in BuildSteps
Change-Id: I287831a9151ba867eec443206235c7e07a6176e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-07-25 14:29:26 +00:00
Tobias Hunger
543929cd2c CMake: Warn when doing out-of-source builds with in-source configuration
Warn when attempting to do an out-of-source build while an in-source build
is configured. This seems to confuse cmake.

Task-number: QTCREATORBUG-18381
Change-Id: I1abd3be4129ba5af6439dcd60d16d429b93c0382
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-28 11:43:25 +00:00
Tobias Hunger
c0c210cbda CMake: Use tr in BuildStep
Its a QObject, no need for QCoreApplication::translate here.

Change-Id: I3375a70fe60b66e13de6b9a99c35c85f82b9151e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-28 11:43:08 +00:00
Claus Steuer
8542ebcd5d CMake: Do not react to builds in the background
If an error occurs while persisting or updating the cmake state, the
build might continue for a while in the background.

CMakeBuildStep does not disconnect the Error/Run-Trigger when an
error is signaled by the CMakeBuildConfiguration. Instead it reports the
build as finished (with error). The BuildManager then disconnects the
output and runs the next item in the build queue (if any). However the
cmake step might still be alive and emits the dataAvailable signal which
then triggers the build process.

Task-number: QTCREATORBUG-18382
Change-Id: I956133fe8c6f7de58b9f842b231c70d24778b1e0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-06-20 13:37:58 +00:00
Tobias Hunger
460e1d7e93 CMake: Add "test" target to cmake builds
Always show a test target for cmake projects. This will show even
if there are no tests in the project. But I think it is more annoying
*not* to be able to run tests via the locator when tests are available
than getting an error message when attempting that with a project that
does not have tests.

Task-number: QTCREATORBUG-18323
Change-Id: Iba85aa868cb9bfe6c3f44a7ffff620d081d3082f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-06-13 12:47:44 +00:00
Tobias Hunger
ccdf335425 CMake: Fix possible nullptr dereference
Change-Id: Iadb62b671e115b2348dbe1d927212fd79a7fdf33
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-03 11:53:01 +00:00
Christian Stenger
10c285db86 CMakePM: Fix compile using Qt5.6 and gcc4.9
Change-Id: I192a213a8825c636dc42702a32a065ad541bd2af
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-04-28 06:30:29 +00:00
Tobias Hunger
11c87bd918 CMake: Unify setup of default build target in CMakeBuildStep
Change-Id: I3d087356a4dd5a3b8ab07d5b64cd5aeb93ae0f47
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:51:16 +00:00
Tobias Hunger
10d6a3bc3d CMake: Fix signal emission from CMakeBuildStep
This fixes the summary in the UI.

Change-Id: I8eb93a1785d8788d9021e06b75a10cb36f119f0f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:51:10 +00:00
Tobias Hunger
d8d2dc6adb CMake: Report special utility targets in BuildDirManager::buildTargets
Report special utility targets like "all", "clean" and "install" from
the BuildDirManager and update UI accordingly.

Change-Id: I01d0dcfa23d5bddc124c8f9ee1040475184c9c1e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:51:01 +00:00
Tobias Hunger
e7b4e91fec CMake: Define an "install" target
Change-Id: I036ddc3bfb91fc3a5a9e8923db2befbf60e89a77
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-27 09:50:54 +00:00
Tobias Hunger
1e178915df AbstractProcessStep: Free output parser chain in error case
Change-Id: Ie0dc094068bfa56f728d84ee13e70efbc980f8b3
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 09:23:21 +00:00
Tobias Hunger
b5ab98dfd5 CMake: Simplify code
Use defined helper method instead of duplicating code.

Change-Id: I1eec61f99875ccd28e6e64bd5ad2bfd7e6e21eb3
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 09:22:33 +00:00
Tobias Hunger
79f5a27568 CMake: Use RCs buildSystemTarget when deciding what to build
Use the RCs buildSystemTarget property when deciding what to build
with the "build current executable only" property set. This makes
the selection more robust.

Change-Id: I0dbcd764a06428b441084e6e4dc680e106c6d3bd
Reviewed-by: hjk <hjk@qt.io>
2017-04-25 09:22:17 +00:00
Tobias Hunger
a3be2c08ee CMake: Fix clean target
Always list a "all" and "clean" targets and remove the similar code
in the tealeaf reader.

This fixes the clean-step falling back to "all" in server-mode.

Task-number: QTCREATORBUG-17138
Change-Id: I1ce84f03c2e9829e4bb5f550c10cdef772fabf5b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-03 11:21:47 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Christian Kandeler
c05a3fdb3d Give the values of BuildStep::OutputFormat better names
The old ones did not convey their meaning very well. In particular,
NormalOutput and MessageOutput were easily confused.

Change-Id: Ia0a8c1b1c366ab3f5c59f751b37b8b1f68f6831d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-19 16:08:57 +00:00
Tobias Hunger
53d45de8a0 CMake: Allow to build target from context menu of CMakeTargetNodes
Change-Id: I0457abd6dabea1699272482eb5f7fbb3ca097310
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-15 09:30:59 +00:00
Tobias Hunger
b17c98ad6f CMake: Trigger cmake run *before* build when files changed
Make sure to run cmake *before* cmake --build when cmake files just
got saved. This helps e.g. when editing CMakeLists.txt files and the
hitting "Built" and "Save all" (or "Always save before build").

Task-number: QTCREATORBUG-16187
Change-Id: I16b1d02eb342a447003380946ce7a9d785476a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 08:47:02 +00:00
Tobias Hunger
4d7420fe49 CMake: Fix warning
Change-Id: Ibfa8e5a9df03c9249f0feb6a8133dc222d57743d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 08:36:26 +00:00
hjk
519cc8ded6 ProjectExplorer: De-duplicate code in IBuildStepFactory derived classes
This removes 900 lines of duplicated code, some duplicated checks at
runtime and some (minor) quadratic behavior when gathering display names.

canClone(), canRestore() and canCreate() and restore() use the same
pattern. Handle that on the core side once. Leave retore() virtual to let
the ios code unmodified (which is likely not needed, later...). Introduce
'Unclonable' and 'Uncreatable' flags to keep Android package installation
and WinRT deployment (non-)functionality unchanged.

Change-Id: I0325479aff818a4038b2f241ca733b8d8cd66f2f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-06-10 10:34:51 +00:00
Eike Ziller
5097768552 Merge remote-tracking branch 'origin/4.0'
Change-Id: Ic82bea5abc6f9539044873b9872c70b3d66a642e
2016-04-25 16:23:15 +02:00
Tobias Hunger
e8b538985d CMake: Do not forget "current executable" build target
Do not forget to build the current executable target when there is a change
of available build targets.

Task-number: QTCREATORBUG-16131
Change-Id: I7fb0dfcd06cdbe3d23dbd194ed27fd3825068c62
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-04-25 11:52:20 +00:00
Tobias Hunger
2e5102f45e BuildStep: Remove finished() signal and use FutureInterface to report
Remove the finished() signal that is (sometimes) used to report that
a buildstep is done and use the FutureInterface for that purpose
consistently.

Change-Id: Ibe5520b562b91f1a7f4fc73ee898b33b930029ec
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-25 11:23:42 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
Jarek Kobus
3f19774c0f Set LC_MESSAGES instead of LC_ALL for parsing the error output
Task-number: QTCREATORBUG-15855
Change-Id: I05aa83acb356840cfdacc92796b190fb8754ada0
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-04-11 12:36:29 +00:00
Leena Miettinen
c77abc4230 CMake: Fix capitalization of "CMake Tool"
...to be consistent with the capitalization elsewhere.

Change-Id: I947e2a5bff3a368ee9a456261186325821870552
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-04-05 15:14:30 +00:00
Tobias Hunger
2c822ae3c1 CMake: Only allow one target in cmake build step
CMake will silently ignore all but the last target (or fail to build
anything). This allows to simplify our code.

Change-Id: Ieee3931aca0788307107e2021d507073ef42a21f
Task-number: QTCREATORBUG-15928
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-30 12:20:58 +00:00
Orgad Shaneh
13dea114e2 CMake: Show build progress in compile output
Broken by 578c107a16.

Change-Id: I2427dbc36f70a20a453fc6fd13f29589f07a7fcf
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-22 10:42:02 +00:00
Alexander Drozdov
a618eb2a9f Don't use quoting for additional tool arguments...
...that passed to the build tool (cmake --build...)
and specified by user.

Change-Id: I0de51161b5dd700f3160f048fa6f02743a5186e6
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-16 09:38:47 +00:00
Tobias Hunger
578c107a16 CMake: Do not try to parse progress information lines
The lines with "[x%] Building something" do not contain errors,
so there is no need to parse them (causing false positives to show
up).

Change-Id: Iee87deb73db9e82040cab5401b74c70be91e6191
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-14 13:23:46 +00:00
Tobias Hunger
420e54281c CMake: Keep cmake state in a temporary directory till first build
This avoids creating lots of build directories as the user types
in something into the builddirectory line of the build settings.

Change-Id: Ib08a0f65e08bce104e4baf9e19fb01730d2f5f08
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 12:17:39 +00:00
Tobias Hunger
76a050cb83 CMake: Move BuildDirManager from the project into the buildconfiguration
Change-Id: I90126ff22dd394eba4145db142b3914d211af476
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 12:17:31 +00:00
Tobias Hunger
859bf2c5ce CMake: Do not run a cmake wizard all the time
Do not push the cmake running straight into the face of the user. Do it
in the background instead.

This needs some follow-up patches to become really useful.

Change-Id: I3457178b33e3f14bdeac25005a773d17abb73b65
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:04:45 +00:00
Tobias Hunger
c7d906214b CMakeParser: Remove sub-parser setup from CMakeParser
This makes the class more applicable for later re-use.

Change-Id: Ic717dd63962b254fce639061f16b1ca8e12d8098
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-12 12:37:18 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Leena Miettinen
67ca818e5b CMake: fix grammar in error message
...for CMakeRunConfiguration

Change-Id: I6b977f6ea2fe3b1aa75de497a93edc6256038a9e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-12 10:27:53 +00:00