Commit Graph

171 Commits

Author SHA1 Message Date
Jarek Kobus
ea35ed9ffe AbstractProcessStep: Merge finish() with processFinished()
Change-Id: Ied15ec3ee9d3bcc80b03b2589d101c65f2fd062a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-05 08:43:21 +00:00
Cristian Adam
a0afd51f3f CMakePM: Add "CMake Install" deployment step
This commit adds a "CMake Install" deployment step, which is using
"cmake --install" command.

"cmake --install" command has been added in CMake 3.15, this is why the
minimum CMake version has been updated to 3.15.

Note that CMakeBuildSystem::makeInstallCommand is still using cmake --
build --target install due to a CMake bug regarding "Ninja Multi-Config"
generator, which doesn't intall all binaries via "cmake --install".

Fixes: QTCREATORBUG-25880
Change-Id: I504674c380055d8ef136d344a78b80c17ecf9765
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-19 13:57:43 +00:00
Jarek Kobus
7cf6d9c97b CMakeBuildStep: Get rid of m_waiting field
Change-Id: Iea737960f57e93fa1e688ed43eedf1bf44204709
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-06 14:24:46 +00:00
Jarek Kobus
55284ba124 CMakeBuildStep: Don't use stdError
Emit addOutput() signal directly. This will add a newline after
the message. Use OutputFormat::ErrorMessage instead of
OutputFormat::Stderr.

Change-Id: Id5e95dd00dca5e57b67c583a1b11071bf4101880
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-02 16:38:25 +00:00
Jarek Kobus
dfd079f050 AbstractProcessStep: Merge virtual functions
Merge processSucceeded with processFinished into one virtual
function. Leave default implementation empty, so that
reimplementations don't need to call base impl. Move
processFinished into private section. Pass just one bool success
parameter into processFinished.

Change-Id: Ide3e262de0c0c5583c9fec2426fa460b6b74a49d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-02 15:37:16 +00:00
Jarek Kobus
02f384115e Remove unused includes of QBoxLayout
Change-Id: I74204eaf70dbcb31a8bd13609bef35459c8c6b5f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-11-18 15:29:29 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
3b84a408df CMake: Allow parser to run remotely
Change-Id: I3953d459177790fd652ab69c083b0dd0f1d29031
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-04 10:46:51 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Cristian Adam
e02f4a0518 CMakePM: Add support for build CMake presets
This patchset will add support for version 2 of the CMakePresets
feature that has been implemented in CMake 3.20

https://cmake.org/cmake/help/v3.20/manual/cmake-presets.7.html

Task-number: QTCREATORBUG-24555
Change-Id: I08934243cc04487d38c4b59c2ad4a4a8d0484492
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-28 21:24:53 +00:00
Alessandro Portale
528c44ba8a CMakeProjectManager: Remove margins around CMakeBuildStep widget
Change-Id: I9b2a1a615f987c3dff9b5fcb29b0a10c5417f752
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-16 05:57:37 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
Alexandru Croitor
b72d5b05f8 CMake: iOS: Enable automatic provisioning updates
By default xcodebuild does not try create / download a provisioning
profile for a project if a valid one does not exist locally
in ~/Library/MobileDevice/Provisioning Profiles, even if the
Xcode CODE_SIGN_STYLE attribute is set to Automatic.

Starting with Xcode 9, xcodebuild accepts a new
-allowProvisioningUpdates option.
When passed, xcodebuild will request a new provisioning profile
from Apple's servers for the current project and use it during
the build. The provisioning profile is only needed when building
for a real device, not the simulator.

When building an iOS project with qmake, the option is embedded in the
wrapping Makefile generated by qmake, so Qt Creator can simply call
make (which it does).

For CMake, there is no wrapping Makefile, so we need to pass the new
option explicitly as an additional build tool argument.

There might be cases where automatic provisioning is not desired,
which is why there is now a new checkbox in the CMake build step
configuration widget. It's default value is 'enabled', to match
qmake's behavior.

As an implementation detail, isiOS had to be moved to a header file so
it's accessible to both the build configuration and the build step.

Fixes: QTCREATORBUG-26246
Change-Id: Ic80cd965ba095d0ff379e13ad2ffb8c298c9f7c4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-09 09:52:18 +00:00
hjk
ebf3144f22 CMake: Shift remaining data to buildsystem
Change-Id: I04518a21ce571399c89608d2e59e746f8e6e0d4a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-05 12:10:28 +00:00
hjk
33a385c4d6 CMake: Shift multiconfig storage from build config to build system
Change-Id: I6f9b6c590975caeea4ad92c61f354d81d4d90431
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-04 13:35:30 +00:00
Eike Ziller
531f3ada2c CMake: Add xcodebuild parser for "Darwin" targets
Similar to the qmake make build step, so build issues are parsed for iOS
builds.

Task-number: QTCREATORBUG-26541
Change-Id: Ie71a3087feab2720f6d8b4974d221a70c3fe76fa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-11-16 13:02:33 +00:00
David Schulz
665285b981 Docker: Map build directory to device in cmake calls
Change-Id: Ibcd2e1aebac337e880a28a2a22b35d8ca60b6dcf
Reviewed-by: hjk <hjk@qt.io>
2021-10-26 07:38:55 +00:00
Cristian Adam
a88f1426c3 CMakePM: Populate targets list on add new build step
The target list was recreated when the parsing of CMake project
finished.

But for already configured projects, the list was not used when
a new build step was added. This new step will only get the
targets list when the CMake project would be reparsed.

Fixes: QTCREATORBUG-25759
Change-Id: I54d12a71dacf9fcec2ad0f3e341fe8057880251d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-16 16:35:55 +00:00
Assam Boudjelthia
cd20ad8ff4 Revert "Android: add prepare_apk_dir CMake target by default"
This reverts commit 9dcbb8ca01.

Reason for revert: This workaround is not needed anymore, since
Qt 6.1.2 (see 71348437939e62b0e3b86888e966b300ff1e2855).

Change-Id: I089457dc58c5b97136b30190fdf17cfb303f8bd8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-28 10:29:10 +00:00
hjk
d632b3eb4f CMake: Use local builddir path when constructing cmakeCommand
The command will be executed on the build device, from that perspective
the builddir is local.

Change-Id: I9b3bdf0333f2634caff352e8738019a86c09870c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-03 06:56:59 +00:00
hjk
77d7b24326 Utils: Make Environment::setEnglishOutput a proper member function
The previous indirection was useful as long as they were overloads
for QProcessEnvironment and QStringList, but these are gone now.

Change-Id: I5066bd2e72fd06948a5cc7bbac6dda9006db96ed
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-21 15:07:34 +00:00
Eike Ziller
b3a893e9b8 Merge remote-tracking branch 'origin/4.15'
Change-Id: I75ffc79eeb8d73296a2271a636fae48e35427947
2021-05-05 11:46:19 +02:00
Eike Ziller
b3bd8b81c4 CMake: Do not remove "Current executable" target
The "Current executable" target is an artificial target added by Qt
Creator, so we must not remove it because it is not one of the targets
from the project.

Amends dbb5a70f93

Fixes: QTCREATORBUG-24145
Change-Id: I4601bcbc7238c6bf54bc9aa3ef6eb934b65df96e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-27 13:09:10 +00:00
Eike Ziller
2800f3b51f Merge remote-tracking branch 'origin/4.15'
Change-Id: I0afcf51d354ffd73a8f2956a7f78b1e4f032677b
2021-04-09 12:42:03 +02:00
Cristian Adam
dbb5a70f93 CMakePM: Remove non existing targets from cmake --target list
Testing with a hello project like this:

1. Go to settings select "hello" target, deselect "all"
2. Go to CMakeLists.txt and rename the hello target to hello2
3. Run CMake <-- important, this will rescan the file-api target structure
4. Build

Step 3 will notice that hello target is missing and remove it, since
no targets are there "all" will be inserted and step 4 will work.

Fixes: QTCREATORBUG-25477
Change-Id: I6a4461341550931006558e5fdecb5a4323afaf35
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-07 09:04:14 +00:00
Eike Ziller
c0cfafdd3d Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I403b236c40d73a61ae22304e289e9d4374366395
2021-04-06 15:17:40 +02:00
Cristian Adam
3da99f7832 CMakePM: Filter out utility targets from target configuration list
In the build target list there is no reason to have <target>_autogen
or <target>_autogen_timestamps targets.

Also do not sort the target list, so that the special targets stay
at top (all, clean, install etc)

Change-Id: I3107150bb40d68cc95246d4d09abc300a6e3d3fc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-06 12:15:52 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
Cristian Adam
242f2dbeaa CMakeProjectManager: Use buildDirectory instead of "."
When issuing cmake --build "." as an user I don't get to see which build
directory is being actually built.

To make things worse in project settings the build directory field is
disabled and cannot be copied.

Change-Id: Idf862ba1df68cde55e9785c934f67393da6c1616
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-26 11:32:47 +00:00
Cristian Adam
6cbdae8070 CMakeProjectManager: Support for multi-config generators
CMake has multi-config generators like:

  * Visual Studio
  * Xcode
  * Ninja Multi-Config

The first two have different special targets for "all", "install",
"package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE",
"RUN_TESTS".

All of them need to get the build type passed via "--config <build-
type>" and not via "CMAKE_BUILD_TYPE".

The multi-config generators will use only one build directory.

Fixes: QTCREATORBUG-24984
Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-21 09:31:30 +00:00
Cristian Adam
15a7e08eda CMakeProjectManager: Add "install/strip" and "package" special targets
The Ninja / Makefile generator supports these targets as seen at:

https://cmake.org/cmake/help/latest/generator/Ninja.html
https://cmake.org/cmake/help/latest/generator/Unix%20Makefiles.html

Fixes: QTCREATORBUG-22620
Fixes: QTCREATORBUG-22047
Change-Id: Id0105ae59b7d699f0da637efed4efa337769b601
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-22 16:03:20 +00:00
Leena Miettinen
c742f0ac9a CMake: Fix UI text capitalization and punctuation
Task-number: QTCREATORBUG-24873
Change-Id: I2672d0360cc8a6b41f711ca9db0f76750639da4e
Reviewed-by: Asit Dhal <dhal.asitk@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-09 09:07:30 +00:00
hjk
97c6c13dcb ProjectExplorer: Remove BuildStepConfigWidget
After the previous changes it was only an empty wrapper around QWidget.

Change-Id: I58dcd82d8342c7de5e2df537044f6cf3de878a67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-06 08:06:39 +00:00
hjk
b97b7dc6f2 ProjectExplorer: Move BuildStepWidget::summary etc to BuildStep
The step is the source of information anyway, and available at the
only place of use. No need to copy that over to the widget, neither
for keeping it up-to-date there when the mechanism is already
available in the step itself.

This creates quite some potential for the simplification of
the various createConfigWidget implementations in follow-up patches.

Change-Id: I4474665f194a1ff7c5792ad086ed53c8d3ce13e6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-05 08:16:51 +00:00
hjk
591e93316d Consolidate build/deploystep default display name handling
Use the display name from the factory as default, override if needed.

Change-Id: I03519c998432fea4120b0de8b2fc2686644635f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-02 13:18:45 +00:00
Assam Boudjelthia
9dcbb8ca01 Android: add prepare_apk_dir CMake target by default
Qt 6 CMake build doesn't execute prepare_apk_dir by default (this is
the equivalent of install step in qmake). Since we have the target
for installing the build artifacts to android-build already present
in the CMake targets list, it's better to just use it, instead of
using another custom step just for that.

Task-number: QTCREATORBUG-24679
Change-Id: I369d6ce513f9aaf917c5fcbb3f6aa44e36b97af8
Reviewed-by: hjk <hjk@qt.io>
2020-09-28 07:31:48 +00:00
hjk
2cabd2ceb5 Utils: Consolidate LayoutBuilder interface a bit
- the var args template for addItems was overkill creating a lot of
  instantiations. Use a temporary list instead.
- allow default constructed LayoutItems to be used for an empty cell,
  avoiding the use of a QLabel with empty text
- add an addRow({...}) overload as convenience shortcut for
  .startNewRow().addItems({...}
- rename startNewRow() to finishRow()

Change-Id: I6d49dacbac3d7acf140ca526884ba1ceeeca2e0d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-24 10:32:26 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
hjk
0d185a0ad3 ProjectExplorer: Simplify use of AbstractProcessStep::init()
1. Systematically check for AbstractProcessStep::init() first in
   derived classes.
2. Use setupProcessParameters(processParameters()); by default in
   the base implementation.
3. Drop all re-implementations that are effectively the same.

Change-Id: I0ae54dd4909b354672a63ee56d0b7c2ea0732494
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-16 16:16:13 +00:00
hjk
d09ea40c25 CMake: Fix several issues with the CMakeBuildStep
- Store the selection of the "Current executable" target again
  (broke apparently with 2c822ae3)
- Display the resolved target of the "Current executable" seletion
  in the command line, instead of the fixed "
   '<Current executable>' text
- Make the "Current executable" translatable
- Add a tooltip explaining what it is
- Use a Utils::TreeModel instead of a QStandardItemModel for the
  target model
- As side-effect, searching in the target view using Ctrl-F seems
  to magically work again.

Change-Id: Ia4d0913f6e586f49f74da66651a9177437dad6d9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-11 05:00:04 +00:00
hjk
bd31ba0e09 CMake: Slim down CMakeStep interface
Change-Id: Ia2cce411647e434a9edd7ef2b66a187bad6d8c12
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 09:18:52 +00:00
hjk
4964d0bf81 CMake: Use StringAspect for cmake arguments
Change-Id: I18e9af5f630a2b0a11a427848368c9f980819717
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:50:17 +00:00
hjk
61bfd32438 ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places.

Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-09 06:27:21 +00:00
hjk
6c785c05ab ProjectExplorer: Remove ProcessParameters::resolveAll()
On all code paths, this was implicit in a ProcessParameters::setCommandLine()
which was on all code paths either called directly immediately before, or as
part of ProcessStep::setupProcessParameters().

With ProcessParameters::setCommandLine() as only user, this could be
inlined there. The effectiveWorkingDirectory() turned out to be out of
place and rather accidentally working there and was moved to
ProcessParameters::setWorkingDirectory().

Change-Id: I634f6086c2324e3cbecd3e5d50e22afc722abd3f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-08-25 14:19:04 +00:00
hjk
e1d0b4cf48 CMake: Use new AbstractProcessStep convenience functions
This is actually a slight change in behavior insofar as
the summary now uses the same environment as the build
itself. This should not matter, or even be more correct.

Change-Id: I48e5be6cb7b97606f80f563ba399c4b6ff61c3bf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-17 12:21:04 +00:00
Christian Kandeler
21fbf36a5d Cmake: Fix compile output glitch
Using a dedicated OutputLineParser ensures that we only ever see
complete lines and thus prevents "partially red" lines in the compile
output pane.

Fixes: QTCREATORBUG-24209
Change-Id: I12b3de70b81789afe727b66e366facdcc81f8ab8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 08:12:54 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
Tobias Hunger
28c22ff57e CMake: Inject special build targets into list of extracted targets
Inject special targets like all, test and install into the list of
targets that get reported by CMake. This makes those available in
the locator again.

Task-number: QTCREATORBUG-24064
Change-Id: I08f1232d243afbe0800c1dc308a00917c98ccf8a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-06-03 09:46:45 +00:00
Tobias Hunger
2fea24fe6a CMake: Support building several targets with cmake --build
CMake supports this for a while now.

As a side effect this fixes QTCREATORBUG-23738, which was caused by the
radio button hack used to show that only one item could be selected at
a time.

Change-Id: I18cbe6c5ee3872edaf74b9d828bde1ac5bf63563
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-06-03 08:04:50 +00:00