Commit Graph

3443 Commits

Author SHA1 Message Date
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
David Schulz
7acb8e90f3 CMake: create generated file paths without QDir::cleanPath
Change-Id: I49913032fb95aff8357da7aa077eabd5907d53ca
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-14 05:07:52 +00:00
David Schulz
3369948b1a CMake: use FilePaths to generate relative source entries
Change-Id: I5df67517e269d650166f72a625e5835e780fca9d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-14 05:07:46 +00:00
hjk
cb4f75426d ProjectExplorer: Remove one constructor overload of DeployableFile
Change-Id: I87e444349129e9370b5fec505444723d36e21448
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-14 03:28:48 +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
David Schulz
0057c73080 CMake: use FilePaths to parse source and build dir
Change-Id: I59523a525fd07402e3ade6cd6b7eaee69aa5abe0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 12:59:46 +00:00
David Schulz
ed8b87d4f6 CMake: correctly track remote cmake files
Change-Id: I6685ed7ba77282d9d5154ba4192841f5bd093783
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 12:59:33 +00:00
Vladimir Serdyuk
5d1d6c83a4 iOS/CMake: Fix running non-Xcode targets and targets in subdirectories
Improve support for running iOS bundle built with CMake introduced in
3a294f670d.
Currently it supports only Xcode generator and does not work if target is
created in a subdirectory.

This patch adds support for non-Xcode generators (tested with Ninja) and
targets created in a subdirectories with any generators.

The solution is not pretty due to the need to keep qmake compatibility.
Would be glad to refactor if there's more correct approach.

Change-Id: Ieaf7e3186ab55cadc643d9bd3d94442f9ac72228
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-10 15:23:27 +00: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
Christian Kandeler
939cc5af21 ProjectExplorer: Give build systems a name
... and make it accessible through a variable.

Fixes: QTCREATORBUG-26147
Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 14:41:56 +00:00
David Schulz
335a74353f CMake: parse remote json files
Change-Id: I2dd8e160140e6eba35b9968d5afb0953c5cfa43c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-09 12:43:35 +00:00
David Schulz
66b97761b6 CMake: use filePaths to scan for build directories
Change-Id: I34ccf91d9ca2b8e0b1927ad8b73e2ce2b54ecf0e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-09 09:47:18 +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
hjk
bdefc13eba Utils: Rename FilePath::absolutePath(FilePath) to resolvePath
There was already a similar function taking a QString.

After that, the remaining no-argument version of absolutePath()
can be deprecated.

Change-Id: I5b9ad8c8b68a5723891b0aa9f5a37e90db0fe09e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-09 05:42:30 +00:00
Cristian Adam
a2c70d1a12 CMakePM: Add CMake warning parsing support
Previously the CMake warnings weren't displayed in Qt Creator's
issues pane.

Fixes: QTCREATORBUG-26231
Change-Id: I3e8e3dbfaed3649e99bbbc8f006093d7c81d2b8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-08 08:31:42 +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
Eike Ziller
8e51295959 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/libs/utils/processreaper.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakeprocess.cpp

Change-Id: Ie248bcb02a80f3e02ab19d73033ce2ba31e7fd83
2021-09-07 11:05:40 +02:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Jarek Kobus
ebae255e49 Fix a possible crash when reaping a process with callbacks
It may happen that CMakeProcess destructor puts its internal
process into the reaper. After this, when the CMakeProcess
is already destructed, the internal process may still be working.
Since we have set the StdErrLineCallback lambda for the process
which accesses the private m_parser field, it may potentially
crash.

Solve it in a general way, so that whenever we put a process
to the reaper we reset its callbacks.

In addition, disconnect all the slots connected to process'
signals.

Fixes: QTCREATORBUG-26220
Change-Id: I63ea0e0ed6a62ef97ac695572f18014458489c5c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-03 10:05:34 +00:00
Cristian Adam
27f0dd134f CMakePM: Do not treat generated files as project files
This would trigger an infinite loop.

Fixes: QTCREATORBUG-26207
Fixes: QTCREATORBUG-26204
Fixes: QTCREATORBUG-25346
Fixes: QTCREATORBUG-25995
Fixes: QTCREATORBUG-25183
Fixes: QTCREATORBUG-25512
Change-Id: Iaf081a00dcf318a0ec2708e839e0ab6535e0ef4d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-02 08:04:17 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Eike Ziller
0777b65db3 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	src/plugins/android/androidconfigurations.cpp

Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
2021-08-26 11:09:08 +02:00
hjk
ca735829b4 CMake: Bark about missing build directory
Also, bail out earlier and more directly.

Amends e54c63af5e

Change-Id: Id5a530b3d6f7548a2f786f3400454253c719acce
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-25 12:34:55 +00:00
hjk
e54c63af5e CMake: Bark when selected cmake binary and build dir on different hosts
Change-Id: I31d373cb6a87c65dbf42ae4e0b295d41f94d9f63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2021-08-25 06:37:45 +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
57a90b019f Utils: Introduce a FilePath::searchInPath() convenience function
Diverts to searchInDirectory(). Use it in some places.

Change-Id: I9e5642f0ae0ed4dd9fb9f34bcaa11a25bd26c690
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-23 11:56:24 +00:00
Cristian Adam
c1c70d339d CMakePM: Fix build library search path with CMake 3.20+
CMake 3.20 has changed the relative path to dependent libraries
from current binary directory to main binary directory.

See https://gitlab.kitware.com/cmake/cmake/-/issues/22556

Fixes: QTCREATORBUG-26110
Change-Id: I39c1d6b2998ebb079e7017e8d349881752d80354
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 13:58:15 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
Eike Ziller
ab606faad2 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/android/createandroidmanifestwizard.cpp

Change-Id: Ibd06a254f52c2c96d8c6ddd6b1d27483fcc29a17
2021-08-16 10:51:50 +02:00
hjk
1afea827bb Don't try to add absolute paths with FilePath::pathAppended()
Change-Id: Ib4cc5cacb33679e4ed8d7aec24b6392c2e000b60
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-13 14:29:09 +00:00
hjk
a78665ede7 Utils: Rename FilePath::searchOnDevice to searchInDirectories
Makes it a bit clearer that there's no magic path use or similar
beyond this point.

Change-Id: I86c06850d16bf777db05ad23b540d8096926c059
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-12 08:29:09 +00:00
Eike Ziller
c7168d1063 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/coreplugin/locator/executefilter.cpp

Change-Id: Iff5b82a9e491b782e4720138904f389d318b005c
2021-08-11 10:10:51 +02:00
Jarek Kobus
03c68e3840 Use QtcProcess inside CMakeBuildSystem::runCTest()
Change-Id: Ica83a8f43b34e21c379326e8dbd51d009dd2fd44
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 14:52:54 +00:00
hjk
1490aeb0e0 CMake: Use FilePath operations to create error flags
Otherwise remote setups generate unrelated errors.

Change-Id: I11285048b1ac0424c45bed5b61779af6724a7a0f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-08-05 12:23:28 +00:00
hjk
9810d3aca7 CMake: Fix warnings for docker related items
Paths to build related items seen by cmake are always relative to
device cmake runs on, i.e. the build device, so they should not
have global prefixes like docker://abc.

Change-Id: Ia919dc6a0cc6430d42e75cc6424311ce6ed47e44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-05 09:52:39 +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
Christian Stenger
bbf2dab8cb CMakePM: Fix build on Windows
Amends 3aa324ef1f.

Change-Id: Ieef98239ec4fa029da1541b15229a17beeb513f6
Reviewed-by: hjk <hjk@qt.io>
2021-07-22 07:49:39 +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
Cristian Adam
366b4c0199 CMakePM: Consider all the missing expandable CMake variables
CMAKE_PREFIX_PATH and CMAKE_FIND_ROOT_PATH can have multiple
values, and now all the values are taken into account.

Ammends e1a68f2598 which had only
one value with all the items separated by semicolon.

Change-Id: I88d98fbbf165e7e61d70ab4a4e84eb4de4cc9f82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-07-21 09:53:50 +00:00
hjk
cb23530798 Docker: Add a button to list auto-detected kit items
Helps to understand what's going on.

Change-Id: I5b8c591cbd60227cf250932c8654063236eec05f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 06:44:21 +00:00
hjk
2ff446bd25 CMake: Simplify CMakeConfigItem::toBool() use
Change-Id: I60120a152174b7c3751b99ac92d31bdb9c3ab1d9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-21 06:25:17 +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
hjk
a05414adf6 CMake: Fix remote search of non-standard ninja installations
Change-Id: I9ec636b126b621bb7a676e55a31845328c9e5ba1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 06:17:39 +00:00
Cristian Adam
e1a68f2598 CMakePM: Better path comparison for missing expandable CMake variables
Amends 2d8cd0c90c

Change-Id: I2192dfdd7624917e07a2a1cbda9fc5867add7ab5
Reviewed-by: hjk <hjk@qt.io>
2021-07-19 09:44:01 +00:00
hjk
1bde4ddbec ProjectExplorer: Use FilePaths in project tree nodes
Change-Id: I31b15c428d9b962333947b1e32641fd80f61d069
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 13:45:06 +00:00
hjk
d06c670504 Utils: Introduce a FilePath::withNewPath() convenience method
It's effectively the mirrored version of onDevice() with an
equally odd name which is a bit more straightforward to use
in some cases.

Change-Id: I0cfedeb58871a857c93144e2a0d734bad1bcd887
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 11:13:14 +00:00
hjk
098e616512 CMake: Fix restoration of remote cmake tools
So far this only worked accidentally for cases where a local cmake
was available in a similar place.

Change-Id: I089d2774b3fde00cf369b5524bb98023b6f1aadb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 13:33:17 +00:00
Christian Stenger
b0e0b3ecda CMakePM: Use Utils::FilePath for accessing cmake tools
When storing the cmake tools we otherwise drop auto detected
ones when failing to access them locally.
This makes the cmake tools on docker devices persist on Windows
as long the docker daemon is running.

Change-Id: I5235cf00aff49359a2e20ddc1667bcbb99337092
Reviewed-by: hjk <hjk@qt.io>
2021-07-14 13:27:55 +00:00
hjk
f8c7d2e848 Docker: Rework auto-detection and removal of kit items
- Use more uniform messages for the different kinds of items
- Remove all auto-detected items

Change-Id: I0b0df0bca484337039432b163bd8e19593b1cd22
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 12:55:53 +00:00