Commit Graph

359 Commits

Author SHA1 Message Date
Cristian Adam
8c00c4c34e CMakePM: Do not modify container in loop
Amends 2f77dc3415

Change-Id: Ida99d5c83eb1b30865b90d83583244728efb38a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-03-02 13:36:09 +00:00
Eike Ziller
ea908bb941 Fix Qt5 based build
Change-Id: If6dfe191a1da52e9bd8ff04d86c5fe3dbda426b9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-28 11:20:20 +00:00
Cristian Adam
2f77dc3415 CMakePM: Proper handling of the extra generator
CMake fails if it has -DCMAKE_GENERATOR:STRING=CodeBlocks - Ninja

It expects separate values:
  -DCMAKE_EXTRA_GENERATOR:STRING=CodeBlocks
  -DCMAKE_GENERATOR:STRING=Ninja

Fixes: QTCREATORBUG-27060
Change-Id: Ia2b5bdc425e569118d689b7223fbef5f953d98a7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-28 10:36:17 +00:00
Leena Miettinen
e4b39e0ce4 CMake: Fix UI text
Task-number: QTCREATORBUG-27055
Change-Id: I53a3ece8b6180afa4fbcbc474cc980aced5f55c8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-17 12:08:59 +00:00
Eike Ziller
209ecc91a0 CMake: Fix configurations tab bar appearance
A tab bar should span completely above the group that it "tabs", and
have no spacing to it. Otherwise there are funny visual artifacts, and
the visual correspondance is not clear.

Add an option for spacing to LayoutBuilder for that.

Change-Id: I5ca9dc713fff95599c9ec1cf90abe8473bc67c2a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-16 13:38:41 +00:00
Christian Kandeler
fde7b90ee9 Fix some warnings
Change-Id: I2991f0ab84b26c93c0dbe2ec79f7638d299e3d39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-11 12:14:27 +00:00
Eike Ziller
b98de260e3 Merge remote-tracking branch 'origin/6.0' into 7.0
Change-Id: I61bc71d3a4e786b5392aed408f0efe4d28fe7e67
2022-02-11 10:49:15 +01:00
Eike Ziller
5d675ff533 Remove QTC_ASSERT because unset toolchain is a valid condition
Change-Id: I2ba710cf4e0af31138787bb7859302ad3a3f3d03
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-10 11:48:11 +00:00
Cristian Adam
2eef90e86f CMakePM: Update generator kit value after Kit Configuration dialog
The CMAKE_GENERATOR variable in "Initial Configuration" didn't get
the Kit value after a change in the "Kit Configuration" dialog.

Change-Id: Ieb9d634e2e9b1a5522b189e16bb66f8cea4c63b1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-10 11:08:39 +00:00
Cristian Adam
4075b793c0 CMakePM: Use the right type for the few kit CMake variables
Use FILEPATH for CMAKE_C|CXX_COMPILER variables, and PATH for directory
variables like CMAKE_PREFIX_PATH.

Task-number: QTCREATORBUG-27005
Change-Id: I906de43ab97d2dbad0374469c4576d901d2f6339
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-09 09:15:21 +00:00
hjk
2962da2255 CMake: Prevent crash if kit has no toolchain
Amends beb167a963.

(cherry picked from commit b3375cfd56)
Fixes: QTCREATORBUG-26777
Change-Id: I65feee771a21bdfbb2a102419a0d778af97a22eb
Reviewed-by: Christiaan Janssen <christiaan.janssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-08 18:01:19 +00:00
Cristian Adam
93f4659533 CMakePM: Add "Close" button for Kit Configuration dialog
This looks more in sync with other dialogs that we display.

Change-Id: I445da900982b7bdcc12d810e69170b0a7695b30c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-08 15:47:29 +00:00
hjk
347265a969 CMakePM: Use more direct access to SourceDirectoryAspect
Change-Id: Ifc91b13fcdc9c42ad4a9521656a2bf63e08aaf78
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-07 17:16:58 +00:00
hjk
c6643dad65 CMakeProjectManager: Some code cosmetics
Move non-exported classed to Internal namespace, move some functions
out-of-line.

Change-Id: I3a2135104d09c0c3f799c5b8d795c93059b1ae95
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-02-07 17:16:33 +00:00
Cristian Adam
924862093e CMakePM: Apply Kit CMake configuration to Initial Configuration
When the user changes or adds new CMake Kit parameters, the changes
are reflected in the Initial Configuration.

Change-Id: Icca1c76749c772e946ff250f94b7965cf7cf9ee8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 19:37:20 +00:00
Cristian Adam
577ad6fa3e CMakePM: Fix crash when switching CMake tools and clicking help links
The crash scenario:
1. Switch CMake tool in Kit CMake Configuration in Settings
2. Click on the "options" help link

Change-Id: Ifdb2809789748926a5ee0e127db0c87a22efa9dc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 18:11:43 +00:00
Cristian Adam
869b7810db CMakePM: Add "Help" context menu entry for CMake variables
This way one could easily jump to the documentation of a CMake
variable e.g. CMAKE_BUILD_TYPE.

Change-Id: I1b348f0a1b6c18f0f7cee29ff6409b43c6263f44
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-04 18:11:17 +00:00
Cristian Adam
d408e4c22c CMakePM: Add "variable" link to CMake offline/online documentation
This way an user can find quickly a CMake variable if needed.

Change-Id: Ie885a34321cf2ce31ee662659e669de88b28801c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 15:34:07 +00:00
Cristian Adam
68cb80f276 CMakePM: Add options link to the CMake offline/online documentation
This way a user can quickly find out which options can be used.

Change-Id: I6347759689a4a1431a82ff9414da0c79e357eb45
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-02-04 13:12:15 +00:00
Cristian Adam
8d12fd07e2 CMakePM: Rename "Additional CMake parameters" to "... options"
CMake documentation calls them Options, and we should use the same
terminology.

See https://cmake.org/cmake/help/v3.22/manual/cmake.1.html?#options

Change-Id: Ibb8ed9dd5a830290770a7fa89e7e5e1ce2d8c74a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-03 17:46:20 +00:00
Cristian Adam
633a9a04e2 CMakePM: Add "Kit Configuration" button in Settings page
This "Kit Configuration" button opens a dialog with the kit's
CMake settings.

This way a user can change all CMake related settings in the
project's Settings page.

Change-Id: I76b6e69ea7a9b96823f6583aef007cf413410407
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-03 17:18:30 +00:00
Cristian Adam
bc160ebe63 CMakePM: Revert selectedRows back to selectedItems
As it turns out changing to selectedRows resulted in having
the keys copied twice to clipboard.

The change would require some code adaptation.

Amends 0020ef7e30

Change-Id: Ie1decd154f7d22825f4d4eecd0bf544ecac7aa26
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-02 21:21:26 +00:00
Cristian Adam
0020ef7e30 CMakePM: Settings list UI changes
The CMake parameters QTreeView has now:
- alternating row colors
- row selection

Both key and value get the same font and foreground stylings.
- bold when the key is new or the value has been changed by user
- italic when the key has been inherited from kit or initial config
- red when there are differences between the inherited value and
  the current value

Change-Id: If09bb2c3e25f59938c5f56e6dd0d6817dfe442cc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-02 20:20:00 +00:00
Cristian Adam
9c8f46a173 CMakePM: Add "Appy Kit/Initial Configuration Value" context menu entry
Now the "Initial Configuration" and "Current Configuration" displays
in red the mismatches between kit / initial value and respectively
initial and current configuration values.

By having a "Apply Kit / Initial Configuration Value" context menu
entry the user can resolve the mismatches if needed.

Change-Id: I2e272821c3ba396cd8a6b7c81e1437cb3fd4bbad
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-01 20:27:41 +00:00
Cristian Adam
d5eed0480d CMakePM: Save initial configuration changes on "exit"
Previously the changes to "Initial Configuration" would be done only
after pressing "Re-configure with Initial Parameters".

Now the settings are saved when the widget is closed:
- a different kit is selected
- a different build type is selected
- project is closed
- switch between build and run settings

This way the changes are not lost.

Change-Id: Ia2c1c10c59bfa101332066205f98684843266f94
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-31 16:43:04 +00:00
Cristian Adam
ff66f501f2 CMakePM: Do not flush CMake parameters model on parsing complete
The flush there was as a "hack" for the case:

1. failed initial configuration (CMAKE_GENERATOR as Ninja2)
2. successful configuration

The current configuration would get current items with unexpanded
values e.g.: QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}

But flush also removed the expanded values of the selected
initial parameters from CMakeBuildSystem::updateInitialCMakeExpandableVars

This is useful when CMAKE_CXX_COMPILER changes or
CMAKE_PROJECT_INCLUDE_BEFORE gets a new path to the new Qt Creator.

Change-Id: I480ce141d043d8ba6001fa47a54b066762b6a128
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-01-28 13:54:28 +00:00
Cristian Adam
0923d8676e CMakePM: Display CMake kit mismatch values in Settings page
updateFromKit() is now called on parsingFinished and the configuration
values that differ from the ones in the Kit's CMake configuration
will be displayed in red.

The "Initial Configuration" page will display the mismatches between
kit's CMake configuration and initial parameters.

The "Current Configuration" page will display the mismatches between
the initial parameters and the current CMake parameters.

The Tooltip is displayed with a bit of more space between values
for more readability.

Change-Id: I6ebfa71951cf979ab08f097befed2d43b74e4d6e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-28 12:42:25 +00:00
hjk
abbd6cdc8c CMake: Use CommandLine to create the initial default parameters
This has at least theoretically the potential to get quoting in
"cross" configurations right. Since the consuming side is not ported,
there should be no noticeable differences yet.

Change-Id: I933ded4b1c9645055d3114d53f3d1b95b5c5539c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-26 18:09:31 +00:00
Cristian Adam
761e1fb13f CMakePM: Add additional CMake parameters to the Kit's CMake config
This way one could pass --warn-uninitialized in the kit's configuration,
which will be transferred to the "Initial Configuration" and so on.

Fixes: QTCREATORBUG-26826
Task-number: QTCREATORBUG-26869
Change-Id: I6d9833a065ea790fc298a75b1120dfa360f885e8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-24 13:29:40 +00:00
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
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-01-24 12:13:19 +00:00
hjk
b3375cfd56 CMake: Prevent crash if kit has no toolchain
Amends beb167a963.

Change-Id: I65feee771a21bdfbb2a102419a0d778af97a22eb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-21 14:11:48 +00:00
Cristian Adam
a0836a29c7 CMakePM: Refactor "Initial Parameters" as a tab bar item
Now we have "Initial Configuration" and "Current Configuration"
as tab bar buttons.

This way the UI can be shared between the two configuration states.

Task-number: QTCREATORBUG-26869
Change-Id: I8206032a2a5ac076629865057816edb99706f2ff
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-17 15:23:19 +00:00
Cristian Adam
dfacdbefa8 CMakePM: Add ability to stop CMake run in Settings
Previously the only way to stop the CMake run was to click on "x"
button of the "Configure" progress bar.

Now you can click in Settings on "Stop CMake".

Change-Id: I167b86ba62679f197c194148b122ff0c87e87162
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-07 11:13:54 +00:00
Cristian Adam
2d9dde30dc CMakePM: Remove "Clear selection" button in Settings
The "Clear selection" button doesn't add much value in the list
of buttons.

If you have a selection it doesn't really matter, and you can
simply click on an item an the new item will be the new
selection.

Change-Id: Ie64bc379773219392c12da4c256afd462d4081a9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-05 15:05:26 +00:00
Cristian Adam
3c7d0c5c98 CMakePM: Remove grouping of cmake cache variables
Having groups made from the first underscore is not necessarily
helpful.

In some cases it creates empty groups, which can confuse users.

We have filter and search functionality in the list, which can
help with finding the right items.

Fixes: QTCREATORBUG-26218
Change-Id: I751a59b49184ea57f55d3832ef4edc8a3c33e0da
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-05 13:04:19 +00:00
Oliver Wolff
beb167a963 Add qt's toolchain file to initial cmake arguments for Windows on ARM64
Fixes: QTCREATORBUG-26636
Change-Id: Id9fc9f3c2242136d2fa4d42e7e64b038a50b1809
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-02 05:19:46 +00:00
Assam Boudjelthia
91117a1c36 Android: Clean up for extraData constants
clean, rename and delete unused constants, we well as unify the
usage between qmake, cmake, and qbs.

Change-Id: I8827ac2f2f7660e337694fef17f744e727bd776a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-06 08:07:42 +00:00
Cristian Adam
87c1f597e3 CMakePM: Display CMake project loading errors/warnings in issue pane
Currently the errors / warnings were visible only in Project mode.
Now they will appear in the build system issues pane, so that the
user knows that something is wrong with the project.

Change-Id: I4e0e6aebed86fdb9ea757692255cdbde37cf58a3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-21 12:49:07 +00:00
David Schulz
e397394090 CMake: skip auto-setup.cmake for docker kits
Change-Id: Iaf9e98f8368167b0e665687a118f29d196c20941
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-14 12:30:41 +00:00
Eike Ziller
3d4d7c7e14 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/clangtools/clangtoolssettings.cpp
	src/plugins/clangtools/executableinfo.cpp
	src/plugins/clangtools/executableinfo.h

Change-Id: Id8caf63e3e594792467d3447870086bd2d8f73b9
2021-09-13 17:03:55 +02:00
Eike Ziller
f6ede253c7 iOS/CMake: Fix building for iOS device
Fix detection if a kit is an iOS kit.
iOS device kits do not have a device set, if no device is currently
connected. So we would end up with the normal desktop macOS CMake
configuration instead of the special iOS one.
Just check for the device type like before, and guard the else branch
with its own check for macOS target device.

Amends a71d725e46

Change-Id: I829e549e5743ec2b358713f2df6d9cd5e32f6b70
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-09-10 11:44:47 +00:00
Cristian Adam
1a030fb911 CMakePM: Fix build type for multi-configuration generators
Fixes: QTCREATORBUG-26079
Change-Id: Ia849cfcea6f3fb10d791ad32c32413d95aa31569
Reviewed-by: Alp Öz <aoz@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-09 07:06:10 +00:00
Assam Boudjelthia
62c33f909d CMake: Don't build apk by default with CMake's ALL target
From Qt 6.1, Qt 6.1 builds the apk directly with ALL step if it's
not a Qt build.

Change-Id: Ib8573399a1ed509852a973e84405353191e80f86
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-08 08:09:00 +00:00
hjk
22ecef0444 ProjectExplorer: Streamline access to buildDirectoryTemplate data
There's only one kind of use, in the context of BuildConfiguration.

Change-Id: I09628ff443ef08e28738125a614c17d5d979189b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 16:27:33 +00:00
hjk
21fff1a9d1 CMake: Fix a crash
Amends a71d725e.

Change-Id: Ifef7629650d119bfde997afbe3c60742a322b8ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-08-02 09:38:01 +00:00
hjk
c6e66a466e CMake: Fix crash with Android when no Qt version is set
Change-Id: I4090add40d621251b795dc090b43ca5f6acb3015
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-08-02 09:37:54 +00:00
hjk
3aa324ef1f CMake: Make CMakeConfig a proper class
Looks a bit more "object oriented" in my book.

Change-Id: I6a3b1b4691ec1c7465f652608678e8f31e7e52a7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-21 13:25:30 +00:00
hjk
3b779fb8dd CMakeProjectManager: Use "cooked types" in DirectoryData
Less conversions cycles at the price of a few more temporary bytes.

Change-Id: Ibda82e02d7b83944f5db38ac7cf75c4bae4f55ec
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-21 06:25:06 +00:00
Tor Arne Vestbø
a71d725e46 Add workarounds for running under Rosetta on macOS
When Qt Creator is built as an Intel binary, and runs on
an Apple Silicon (ARM) Mac, it will be run via the Rosetta
translation layer. This means any process spawned by QtC,
including qmake, CMake, and lldb, will launch as x86_64
binaries as well.

For qmake and CMake, this affects their default choice of
build architecture, resulting in x86_64 builds of user
applications. We want to produce native arm64 apps, even
if Qt Creator itself isn't one, so we explicitly detect
the situation, and if Qt has an arm64 slice, we default
to arm64 builds.

The logic of adding CONFIG+=x86_64 to the qmake step has
been disabled, as the assumption that a single qmake run
and build will produce only a single architecture does no
longer hold. The corresponding logic in Qt was removed
in 2015 (qtbase f58e95f098c8d78a5f2db7729606126fe093cbdf).

In the case of lldb, running it as an x86_64 binary fails
to attach to the running application. We work around this
by using the 'arch' tool to explicitly launch it as an
arm64 binary. This works for debugging both arm64 and
x86_64 applications.

Change-Id: I65cc0f600223990f25c76cef18d927895e551260
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-13 11:18:23 +00:00
Cristian Adam
b3c83b79f7 CMakePM: Project settings widgets grouping
Group together Initial CMake Parameters and Re-Configure button.

Change-Id: Ieb7d5d65b9465f3e77f1e350bc003777817f1af2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-30 14:37:33 +00:00