Commit Graph

3443 Commits

Author SHA1 Message Date
Christian Stenger
7a6d99a9f6 CMakePM: Improve handling of adding translations
In case of having no translations setup with the wizard or
manually later on we just do nothing and fail with adding
the translation file.
This patch minimally changes the CMakeLists.txt so that the
files are not "lost".

Task-number: QTCREATORBUG-29775
Change-Id: I560c8b736ec2a0a8de6e1177317a9172921f4340
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-11 09:31:01 +00:00
Christian Stenger
1cdb702fa6 CMakePM: Improve support for adding translation files
There are more ways to add translation files to a cmake project,
so support the common ways.

Task-number: QTCREATORBUG-29775
Change-Id: I15f0d7a13303a1845760dbfc830c6f773f634ce0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-11 09:30:53 +00:00
Christian Stenger
960768302a QtSupport: Support adding translation file
..for the major build systems. CMake build system will get further
improvements. For now this only works for adding ts files to the
target after the project had been created with QC's wizard with
some translation already added.
Qbs and qmake just work.
The C++ sources obviously will not change automatically to
integrate translation support for the application.

Task-number: QTCREATORBUG-29775
Change-Id: I80e4c21156f4bb8d5ef0bd6edf805021a55770ee
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-11 09:30:45 +00:00
Eike Ziller
57d4ea4dcc Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/designer/formeditor.cpp
	src/plugins/git/gitplugin.cpp

Change-Id: I554a844fab4c55249a00f394f9ba174c7548dbbe
2023-12-11 09:28:21 +01:00
Eike Ziller
a20e2d29fc CMake: Fix file path kind for the staging directory
Fixes: QTCREATORBUG-29997
Change-Id: I7a86b90a366bc59b206a44b5e93b54582c2aed14
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-12-07 12:26:33 +00:00
Cristian Adam
144194b79a CMakePM: Fix crash when editing CMake files without a project
Fixes: QTCREATORBUG-30023
Change-Id: Id849635dd0e7437d7ae93251130d2f26ded24def
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-12-07 11:21:19 +00:00
Eike Ziller
2e280e1c50 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/clangcodemodel/clangdfollowsymbol.cpp
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I45b7fee1a1d784c44f2139fb1ede69190d23d6fd
2023-12-06 16:50:15 +01:00
Cristian Adam
b360776b1f CMakePM: Always display the right CMake version Qt SDK installs
Qt SDK is using the following parameters for sdktool:
  "--name", "CMake %CMAKE_VERSION% (Qt)"

This effectively hardcodes the CMake version for the Qt SDK forever.

Fixes: QTCREATORBUG-30019
Fixes: QTCREATORBUG-29973
Fixes: QTCREATORBUG-28437
Change-Id: I05408442ea26d390f60a123be4fbf71f7018b150
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-06 12:52:43 +00:00
Christian Stenger
938a230dd0 CMakePM: Extract functions for later reuse
Change-Id: Id933c545328300398a2fa38fa82e0c593f501406
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-05 14:43:12 +00:00
Alexey Edelev
4eedc4b2d0 Default the QT_USE_TARGET_ANDROID_BUILD_DIR value to TRUE
Set QT_USE_TARGET_ANDROID_BUILD_DIR to TRUE if Qt version
greater equal 6.8.0.

Change-Id: I051b7c1762858aac798eac167c491ccc68b65cf1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-05 06:45:14 +00:00
Alexey Edelev
de3d4e23ea Add the support for target-based android-build directories
When building using CMake it's possible that single CMakeLists.txt may
contain multiple android executables. In this case android-build
directory mixes the build artifacts from multiple targets. This patch
allows using per-target android-build directories in case if Qt support
this. The QT_INTERNAL_ANDROID_TARGET_BUILD_DIR_SUPPORT cache variable
indicates that Qt has builtin support of this feature and the
QT_USE_TARGET_ANDROID_BUILD_DIR cache variable should be set to TRUE
by user to enable the functionality project-wide.

Task-number: QTBUG-117443
Change-Id: Ic8f576e528ee918a3ebf075a25fa2a414ef85736
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-05 06:44:44 +00:00
hjk
ddf39cd0dc ProjectExplorer: Rename various items in the Toolchain class
Change-Id: I544763d3b4d521f6bbed0dc5a767c15c49055a19
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-04 15:10:08 +00:00
Cristian Adam
e8262ed930 CMakePM: Fix crash (potential) on CMakeParser::flush
Use the Task copy for the inversal of the call stack.

Amends edf4280bd9

Fixes: QTCREATORBUG-29965
Change-Id: I6119e03c75ff5a7d44f86e91cc93e6417fea1689
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-04 13:37:15 +00:00
Cristian Adam
3204002055 CMakePM: Check if the callStack optional has value
Amends edf4280bd9

Task-number: QTCREATORBUG-29965
Change-Id: I7deb6d5952cceaa1f238cdd02393a369c56e0376
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-12-02 16:56:12 +00:00
hjk
c463f944e9 ProjectExplorer: Rename ToolchainManager signals and members
Change-Id: I5195cb785f91dbaafdeeb8bb8c71939a6e3ff9e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-27 16:45:02 +00:00
hjk
b5937836f4 ProjectExplorer: Rename ToolChainManager to ToolchainManager
Plus the private and some comments.

Change-Id: I95d72d77f25cb1c969a1a6148e7186150a697d1f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-27 16:33:34 +00:00
hjk
3bbda8f9da ProjectExplorer: Rename Tool{C,c}hainKitAspect
Change-Id: I74460b6402ab00f972c208023f03fac617982a11
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-27 13:35:28 +00:00
Tim Jenssen
f6b5afa8e4 Cmake: DS does not want automatic detection of cmake help file
Task-number: QDS-9780
Change-Id: I006b27ee21a910f6d5095f09406b0f4e95a62c35
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-11-24 17:48:58 +00:00
hjk
c28fb1fdbe ProjectExplorer: Rename ToolChain to Toolchain
Change-Id: Ibb520f14ff3e2a6147ca5d419b9351c50c141063
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-11-24 15:18:24 +00:00
Eike Ziller
c77128e698 Merge remote-tracking branch 'origin/12.0'
Change-Id: I7971dd83798e975d4e10b77a352c9d7ef7b14ec0
2023-11-23 10:43:00 +01:00
Christian Stenger
7125862212 Add some include guards
Change-Id: If306f95f206e2b1cba48df806c822b8e2d27cf72
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-21 13:58:36 +00:00
Eike Ziller
c75a3bcd5d Merge remote-tracking branch 'origin/12.0'
Change-Id: I0ee9c73d7a7e12f98f88b161c35d00ada069cc9d
2023-11-21 14:46:01 +01:00
Christian Stenger
c5980a4872 CMakePM: Fix build
Avoid ambigous conversion, instead explicitly convert.

Change-Id: I1b62a8eb94cc2c353b33ec1a29a28385fdb92782
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-11-20 10:19:53 +00:00
Eike Ziller
1c4de485da Merge remote-tracking branch 'origin/12.0'
Change-Id: Ib09af70f157a6c7d6cbda4e3de678fd2bbceb229
2023-11-20 09:48:43 +01:00
Jarek Kobus
ce80a6dad5 TaskTree: Rename TreeStorage<> -> Storage<>
This addresses the 20th point in the master task below.

Task-number: QTCREATORBUG-28741
Change-Id: I696beda87430fbe637abba8054012fb77516e220
Reviewed-by: hjk <hjk@qt.io>
2023-11-20 08:25:50 +00:00
Cristian Adam
48a3a12b01 CMakePM: Add failure logging for add|rename|removeFiles
Task-number: QTCREATORBUG-29914
Change-Id: I404a3efb8cabafba6036eb1bc07d19f18af17cd8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-11-17 21:09:31 +00:00
Jarek Kobus
659f0f000c TaskTree: Unify TaskInterface::done(DoneResult) signal
Change the argument of TaskInterface::done() signal
from bool into DoneResult. Make it consistent with
other TaskTree API.

Introduce toDoneResult(bool success) helper.

Change-Id: I7b3041d7c1ed0317c76adbc1fd37448231e85f82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2023-11-17 09:44:20 +00:00
Cristian Adam
7affb80fc3 CMakePM: Do not show source/group/path twice
For the cases of:
  source_group(TREE ${CMAKE_SOURCE_DIR} FILES my/subdir/file.cpp)

Treat the "my\\subdir" part in the project view as part of the source
group name.

Fixes: QTCREATORBUG-29799
Change-Id: I92bf581be25d085783bcdadd8a418b849a29c708
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-11-16 16:39:38 +00:00
hjk
a252ea0205 CMakeProjectManager: Use Core::ActionBuilder in a few places
Change-Id: If2e852e744a070805a542ad62291ad791b1bddf5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-11-15 09:13:19 +00:00
Alessandro Portale
f96feadad0 Fix missing overrides and redundant virtual
Change-Id: Id2a247b6032602c2295d928067c2462d3f9b5221
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-14 14:27:45 +00:00
Eike Ziller
7bd99104e0 Merge remote-tracking branch 'origin/12.0'
Change-Id: I2594f193260a103e1c4484fcab974213c881353d
2023-11-09 08:22:27 +01:00
Marcus Tillmanns
e4805b88c9 CMakePM: Use FilePath::fromUserInput
Change-Id: I748fc41ed380c907b6edcca3a1802a47f9f74436
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-11-09 05:53:36 +00:00
hjk
6685f0255d Utils/all: Move mime constants into a central place
They are reasonably standardized, and generally usable cross-plugin,
so this can help to avoid a few cross-plugin compiletime dependencies.

Change-Id: Icb2b010c3e12dee69df54ab16f6f8e90d9cffba6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:59:26 +00:00
hjk
fc7c11fb65 ProjectExplorer: Consolidate creation of KitAspect's "Manage..."
Change-Id: I001a21f41bcd5ff0614bdf98893b56137c06546f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:52:26 +00:00
Eike Ziller
363d2d161c Merge remote-tracking branch 'origin/12.0'
Change-Id: I35cb28b759fb200c45a1496299584132336fcd1c
2023-11-08 10:07:29 +01:00
Christian Stenger
c6d1c962ee CMakePM: Make internal codemodel aware of Qt
In case we have no Qt inside the current kit configured the
code model stumbles upon Qt constructs even if
CMAKE_PREFIX_PATH has been used correctly to allow cmake to
pick up a Qt.
Explicitly look into the found packages to see whether Qt
has been found and use this if possible for the codemodel.

This fixes some inline diagnostics as well as finding all
test information inside Qt Test related projects instead of
just the test cases when using a kit without a Qt.

Change-Id: Id3b5d2e818967cd3121948b818c75c4cf463546f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-11-07 14:24:07 +00:00
Jarek Kobus
4c38f68d0f TaskTree: Rename StopWithDone -> StopWithSuccess
Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".

This addresses the 26th point in the task below.

Task-number: QTCREATORBUG-28741
Change-Id: I53ed6905b1c385c398f49e122e8ca60aa3ad0806
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:09:23 +00:00
Jarek Kobus
2c0a59384c TaskTree: Rename workflow policies
Make naming consistent with recent changes.
"Done" is meant to be an event name when the task / group
finishes. "Done" may finish with "Success" or an "Error".

This addresses the 26th point in the master task below.

Task-number: QTCREATORBUG-28741
Change-Id: Icc882710dc4896626dc9332440aa13a692af54c4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 14:09:15 +00:00
Jarek Kobus
37b6cb7f90 TaskTree: Get rid of onGroupError element
Make it possible to setup onGroupDone element with additional
OnDone argument.
The onGroupDone handler may accept extra DoneResult argument.
The onGroupDone handler may also tweak the success bit of a group.

All above features conform to the behavior of the task done handler.

Task-number: QTCREATORBUG-29834
Change-Id: I125bdfe155e585678fb33410632246401cbc9390
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 14:08:04 +00:00
Jarek Kobus
b5f77f6d55 TaskTree: Get rid of unneeded done handlers' arguments
Task-number: QTCREATORBUG-29834
Change-Id: I236dec27a292a1b006b7001d01ce620960380de9
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-11-07 11:51:50 +00:00
Jarek Kobus
6e6aa7102c TaskTree: Introduce CallDoneIf enum
Get rid of CustomTask c'tor taking 3 handlers.
If the done handler needs to be called only on
success or an error, add explicit 3rd arg of CallDoneIf type.

Task-number: QTCREATORBUG-29834
Change-Id: I10e55415587e6cac46620dd5177ad8269584583c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-07 11:51:25 +00:00
Marcus Tillmanns
a04cb938cb CMakePM: Fix crash if no run device is set
Change-Id: I8b13afcc466f92b93a8ad09ffa1ccc1ced2fcae7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-11-07 10:53:23 +00:00
Christian Kandeler
d62309bbb2 Fix various mis-uses of Environment::forEachEntry()
Most of them introduced with 08bacd3f19.

Fixes: QTCREATORBUG-29857
Change-Id: Ia897958865f00cb5f8f141659a652aee05aa1355
Reviewed-by: hjk <hjk@qt.io>
2023-11-07 09:01:53 +00:00
hjk
b89baec2c1 ProjectExplorer: Promote CppProjectUpdaterInterface
... to ProjectExplorer::ProjectUpdaterInterface and generalize it
regarding language, but create a convience function for the C++
case, as that's the only user right now.

Also add the self-registering factory boilerplate and adapt all
buildsystems.

Change-Id: If928512609d41c25fad2aa58633c8bffabc4c48f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-06 14:50:10 +00:00
Cristian Adam
42cc29902b CMakePM: Detect C/C++ object extension for single source build
When using CMake package manager auto-setup the CMAKE_C|
XX_OUTPUT_EXTENSION is stored in the CMake cache.

This way CMake project manager can know about the correct extension when
building a single source file.

If CMAKE_C|XX_OUTPUT_EXTENSION is not found in cache it will only use
".obj" for Clang-Cl/MSVC/MinGW toolchains.

Task-number: QTCREATORBUG-27471
Change-Id: Ib9b75608d5a6834014150c57f3098f79284d8276
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-11-05 11:56:22 +00:00
Cristian Adam
bcc45d8bb9 CMakePM: Allow navigation to ${PROJECT_NAME}
Task-number: QTCREATORBUG-27211
Change-Id: I23e2c6f39ff3d4c89ef78a66c10e619e3df3245f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-31 15:52:41 +00:00
Cristian Adam
973e9dcf90 CMakePM: Treat all sourceGroups as sourcesOrHeaders project nodes
Previously only "Source Files" and "Header Files" were treated as
sourceOrHeaders project nodes.

But source_group can introduce a new source group which needs to be also
treated as sourcesOrHeaders project node.

Fixes: QTCREATORBUG-29799
Change-Id: I833d80155fba3fb0269aeab149ea74b0d2edd271
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-31 15:52:31 +00:00
Cristian Adam
4a220ab20a CMakePM: Fix coverity PASS_BY_VALUE warnings
Coverity-Id: 1569153 Performance inefficiencies  (PASS_BY_VALUE)
Change-Id: I03663b09ac3cbbaf3dec87dc9389c2015c16fafd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-31 14:38:43 +00:00
Cristian Adam
3581d1c5dd CMakePM: Fix C/C++ code model preparation
Only set the compiler flags for the active language.
Select source and header files accordingly to the active language.

Fixes: QTCREATORBUG-29707
Change-Id: Ieeaa56f85ccc937f31253ac047538fa19ae4166f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-10-30 12:26:17 +00:00
Christian Stenger
79becbaeac CMakePM: Protect against accidental nullptr access
Wizard summary page does not provide a list to put in failed
files, so ending up inside the build systems addFiles() may
pass in a nullptr. Guard against its access.

Change-Id: Ia858f8029b1b840cc341d87614576f2634b995dc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-30 05:24:35 +00:00