Commit Graph

280 Commits

Author SHA1 Message Date
Cristian Adam
5e4281dafe CMakePM: Add conan/vcpkg-dependencies to "Clear CMake Configuration"
This way one could really get a clean build as one would expect when
issuing "Clear CMake Configuration".

Change-Id: I7067bc4f6f858aeb408612eab5e658e637c0c957
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-06 16:26:04 +00:00
Eike Ziller
d2afb4e8af Merge remote-tracking branch 'origin/13.0'
Change-Id: I4817ff528f92dcb2ffb00c92ca1039f1ae31c7f1
2024-05-02 14:47:43 +02:00
Cristian Adam
480f5366d2 CMakePM: Do not force Kit's Qt version as projects Qt version
Amends c6d1c962ee

Fixes: QTCREATORBUG-30712
Change-Id: I1d78d108a7566f4f59ff0f479eb4b5eddb8a986f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-05-02 10:02:09 +00:00
Eike Ziller
0fe7350368 Merge remote-tracking branch 'origin/13.0'
Change-Id: I0892d8e54930bb5a65dc51117b8ca7d70ce300a3
2024-04-17 13:29:02 +02:00
Cristian Adam
fa29657881 CMakePM: Rename source files in set_source_files_properties calls
Fixes: QTCREATORBUG-30174
Change-Id: I80b33c1193f4cd579abd295657dc223aad5801ea
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-16 09:16:18 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-02-28 08:09:05 +00:00
David Schulz
42c8e82b4d CMakePM: fix optional check
Change-Id: I4145b1f29a63bd69fefb0385aff92c6a23939b5f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-02-07 04:12:01 +00:00
Cristian Adam
e7e593b2f6 CMakePM: Use junctions for source/build dirs on Windows
This way we have fixed small (max 64 bytes) paths for CMake's configure
/ build / install steps.

This allows the user to have longer paths and still compile with MSVC /
GCC MinGW compilers.

Fixes: QTCREATORBUG-26786
Task-number: QTBUG-117413
Change-Id: I0cff6521626dd2ce78d0223d46f0b480e977d5c5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-02-02 18:51:47 +00:00
Eike Ziller
30d048a256 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cppeditor/cppfilesettingspage.cpp
	src/plugins/haskell/haskellplugin.h

Change-Id: I880693c2e4986853b7aa600a5b7d6c09ad14634e
2024-01-30 09:19:06 +01:00
Cristian Adam
76a8966739 CMakePM: Refactor CMakeLists|Cache.txt as constants
Change-Id: I7165fa1d219a0c59bc519a9af1cd194414c4311c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-29 11:50:21 +00:00
Cristian Adam
a8370aaf81 CMakePM: Allow adding files to OBJECT libraries
Amends 7a46bbe667 which only used
`cmakeTarget->productType() != ProductType::Other` which excludes OBJECT
libraries.

Now the fix actually includes all targets which are not UtilityType,
which was the intention of 7a46bbe667

Fixes: QTCREATORBUG-29914
Change-Id: If661828e43d5c566c876546f5527c0b670405e47
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-25 16:41:31 +00:00
Jarek Kobus
290121bc21 Process: Use more rawStd{Out,Err} const methods instead of mutable ones
Avoid using readAllStandard{Output,Error} mutable methods if possible.
Use non-mutable methods when we are not connected to
readyReadStandard{Output,Error} signals.

Change-Id: I2e830e571b9eab2177fd856bbe06dfc5137d9c01
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2024-01-21 17:21:25 +00:00
Eike Ziller
4936a89f16 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp

Change-Id: I7a2cfa35b5bc9070c66561bfba3e4b5a8e26917f
2024-01-19 09:33:04 +01:00
Cristian Adam
5e6f1f5dac CMakePM: Fix adding qml files to targets using ${PROJECT_NAME}
Instead of looking after the target name reported by CMake's file api
e.g. mytarget, take the parameter name from the function that created
the target.

This way if the user used ${PROJECT_NAME} to mark the name of the target
for qt_add_executable and qt_add_qml_module, when adding a qml file the
proper function would be picked.

Fixes: QTCREATORBUG-30218
Change-Id: I920f16d9f5a6b8a7a2fddb3ef7e97e0e3bccd464
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-18 16:13:50 +00:00
Eike Ziller
3e40f227f5 Merge remote-tracking branch 'origin/12.0'
Change-Id: I70bcac4195095a7646dcdc31532d8f61b643d869
2024-01-10 16:06:29 +01:00
Cristian Adam
7a46bbe667 CMakePM: Do not add files to utility targets
On multi-config systems CMake is reporting "ALL_BUILD" or "ZERO_CHECK"
as targets to add files to.

When issued from menu File > Add New ... the selected target is the
first target namely "ALL_BUILD", which is a utility target and cannot
have source files.

Fixes: QTCREATORBUG-30170
Change-Id: I7617978c01f0a2554a3ec7d52ef9baaa16ed7a84
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-09 18:21:26 +00:00
Dominik Holland
e33d6fe5dc CMake: Expose information about Appman packages as Project extraData
Change-Id: I54c449f5bc7211271cecbef05045dd1490066bd6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2024-01-08 15:38:12 +00:00
Eike Ziller
7443ca977b Merge remote-tracking branch 'origin/12.0'
Change-Id: Iee11f97dbd0114957e856d02f0ad295813a05431
2023-12-20 16:05:55 +01:00
Cristian Adam
1ce56fe0b4 CMakePM: Fix library search path for special targets names (test)
Fixes: QTCREATORBUG-30050
Change-Id: I1f0ad5db048976f347a363f3ed12e7881453930b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-12-20 08:14:59 +00:00
Orgad Shaneh
b1413e35f0 CMake: Fix implicit size_t -> int warnings
Change-Id: I6261faad372050fba118f5f5d8db91207d94f941
Reviewed-by: hjk <hjk@qt.io>
2023-12-15 10:44:30 +00:00
Eike Ziller
64f0e10a4e Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
	src/plugins/remotelinux/killappstep.cpp

Change-Id: Ife961ca4eb14271c48bd0dbc08e0a0a816935682
2023-12-14 18:03:59 +01:00
Cristian Adam
32c389a556 CMakePM: Do not reconfigure during build
On Windows upon a CMake file change and save during a build, the
reconfiguration would fail due to the inability to save the build.ninja
file.

Fixes: QTCREATORBUG-30048
Change-Id: I68bec70b0a95bc4256b736a1c4caf1b4d706e43b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-12-13 09:19:26 +00:00
hjk
27ef041d28 ProjectExplorer: Some more ToolChain->Toolchain renamings
Change-Id: I5cb2adf544a846f45f7fe7ce60f67b10ad100d91
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-12-12 08:14:59 +00:00
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
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
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
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
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
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
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
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
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
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
Cristian Adam
55cccfa59e CMakePM: clang-tidy fix for 'no-automatic-move'
See https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-
tidy/checks/performance/no-automatic-move.html

Change-Id: If265c9b0e2aea49e5923f079cd621e10bb958286
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 13:57:34 +00:00
Cristian Adam
69815af272 CMakePM: clang-tidy fix for 'performance-implicit-conversion-in-loop'
Change-Id: I67e5adad19a3454986381c5548bbe96cf1cc1e6a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 13:57:28 +00:00
Eike Ziller
abeb2287ce Tr: Fix some quoting
Change-Id: I91c515822d48b4efb7c7869c5afe06b5375bf20e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-10-16 13:16:00 +00:00
Cristian Adam
cbeeec2dc6 CMakePM: Fix Coverity issue "Arguments in wrong order"
Coverity-Id: 1526499
Change-Id: I4b5d7c4d12eca39b9c4e60b45ea3e67bce069069
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-10-09 09:14:40 +00:00
Cristian Adam
1d2c942360 CMakePM: Only process cmake files for include and modules
... and not for every function. Just the CMake files.

Change-Id: I6e361f4913f8334942a3135adaa0480fdc0cee31
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-06 19:41:59 +00:00
Cristian Adam
16dfd2d374 CMakePM: Add "[cmake] " prefix to all output messages
With this one could easily filter the "[cmake] " messages from all the
messages in the "Generate Messages" pane.

Change-Id: I690650f0ccb0372c9361b95cfec41809737720d7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-05 15:15:32 +00:00
Cristian Adam
3705b4b609 CMakePM: Navigate to find_package CMake files
Fixes: QTCREATORBUG-25524
Change-Id: I6dc7dc1b2d0da06ceba0314438d3bd12467a3223
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-02 12:50:32 +00:00
Cristian Adam
762b0518a2 CMakePM: Handle include(CMakeFileWithoutSuffix) navigation
Check that the function operating upon is "include" and then match the
word under cursor with a file from the project.

Change-Id: Ia0131f08515c56582a1fb02a59d6b2e41ac04288
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-02 11:05:36 +00:00
Cristian Adam
776c8670d7 CMakePM: Handle project FindPackage package variables
For example find_package(ZLIB QUEIT) will result in the package
variables ZLIB_LIBRARY ZLIB_INCLUDE_DIR.

The variables are available for both code completion and navigation.

Change-Id: I4ea6090f44a980dc91632fcabbda16987b0f0285
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-28 10:49:56 +00:00
Cristian Adam
d08f1c6e94 CMakePM: Allow navigation to project targets
They were available via Ctrl-K and "cmo <target_name>". But they should
be working also in the text editor.

Change-Id: Iaad72b784485364776b67d6dfdef7ba73dd2df70
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-28 10:36:40 +00:00