Commit Graph

295 Commits

Author SHA1 Message Date
Eike Ziller
26b4ccb618 Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	src/libs/solutions/tasking/tasktree.cpp
	src/plugins/coreplugin/imode.cpp
	src/plugins/cppeditor/cpphighlighter.cpp

Change-Id: I5114911d18e377076c5c07b27d6ca918774f34b9
2024-08-07 10:20:08 +02:00
Cristian Adam
59ce9dc04b CMakePM: Fix saving "Initial Configuration" values
Amends 6c5717844d

The CMakeBuildSystem::clearCMakeCache() would call
BuildSystem::emitParsingFinished which would clear the configuration in
the widget, effectively removing any "Initial Configuration" changes when
clicking on the "Re-configure with Initial Parameters" button.

This commit makes sure that the updateInitialCMakeArguments() function
is called before CMakeBuildSystem::clearCMakeCache(), and that only the
"Build > Clear CMake Configuration" action would
"disableCMakeBuildMenuActions" which is what an user would expect.

Fixes: QTCREATORBUG-31320
Change-Id: Ie7810c9bed000ca19a31a6ab8e7a281ae9f5e6f0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-30 16:39:16 +00:00
hjk
f49523029a Remove #include <utils/fileutils.h> from most header files
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.

Partially clean up surroundings

Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-07-26 10:41:16 +00:00
Cristian Adam
6c5717844d CMakePM: Disable CMake actions after clearing CMake configuration
This way the user will not have actions that will result in the
following error: "Error: could not load cache".

Change-Id: I4b4f2015e1215d4c12c6aefc03f4ee5b419016c3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-12 10:07:59 +00:00
Cristian Adam
6c63c42799 CMakePM: Do not open CMakeLists.txt for adding/renaming/removing files
Other build systems like qmake / qbs do not do this.

Change-Id: I615ea3556c694e7a18426558c5bf6f3ea142068d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-09 14:46:37 +00:00
Cristian Adam
b5d6348b67 CMakePM: Update initial CMake variables also on failed CMake runs
A failed CMake run configuration could be the result of an compiler
update which then would cause CMake to fail.

Make sure to offer an upgrade path to the new Kit compiler values.

Change-Id: Ibabeb853259e23fe012d8b00e3d48979deee61a5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-27 16:01:35 +00:00
Cristian Adam
af7382fee8 CMakePM: Fix compiling projects upon MSVC Compiler/Linker update
Visual Studio is getting a fair number of updates. This involves also an
update of the Visual C++ toolchain.

This implies changing directory paths from "MSVC/14.39.33519" to "MSVC/
14.40.33807".

The linker "link.exe" is also stored in the same directory as the
compiler "cl.exe".

This commit makes sure that the linker also gets updated, not just the
compiler.

Change-Id: If8cd6e716604bc948ec8990921a14425ebcc7c30
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-27 16:01:28 +00:00
Cristian Adam
030e3c2cd5 CMakePM: Do not add sources to globbed targets
If a class is being added to a target that has a variable resulted from
a `file(GLOB|_RECURSE)` call, we skip adding the files to the target.

Do not add the files, just run CMake which would gather the new sources
into the project.

Adding sources to a globbed target will no longer open the
CMakeLists.txt file, since nothing has changed.

CMake will be run after adding, renaming and removing of sources files.

Fixes: QTCREATORBUG-30445
Change-Id: I82e126737789f215a6400f5a43f303dcc57de005
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-25 16:08:28 +00:00
Cristian Adam
a41c4de3df CMakePM: Do not hang on renaming files in parent directories
This fixes renaming of "my/class.cpp my/class.h" via "../class.h" and
resulting into "class.cpp class.h".

"oldRelPathName" was not needed since it was saved in the
"m_filesToBeRenamed" map and it was computed from the new filename. This
was prone to error.

Task-number: QTCREATORBUG-30830
Change-Id: I839fab3bd6a6172f5ebfbaf9a4b6501cd5693fa8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-24 11:45:30 +00:00
Cristian Adam
e22db4e8ac CMakePM: Do not hang on renaming source files from file(GLOB)
Fixes: QTCREATORBUG-31016
Change-Id: I5b450cdb5a9af227ed058345adab1fc5b5a9043d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-21 08:47:37 +00:00
Ralf Habacker
94663d0db7 cmake: Add support for custom startup programs for executable targets
CMake supports the use of custom startup programs that are provided
in the IDE to simplify execution.

If the build system provides launchers, these are provided as an
additional selection field of the run configuration including an
entry without launcher.

As of cmake version 3.29, the start programs are extracted from
the API of the cmake file. For older cmake versions, a launcher
is initialized from the cmake variable CMAKE_CROSSCOMPILING_EMULATOR,
if available.

Fixes: QTCREATORBUG-29880
Change-Id: I4345b56c9ca5befb5876a361e7da4675590399ca
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-06-20 13:40:21 +00:00
Eike Ziller
451de5adb8 Fix build on older Apple Clang
Actually not sooo old.

compilationdbparser.cpp:172:34: error: redefinition of 'it'

Amends f3e164af4f

Change-Id: Ib3fc97b39921138d2a27bbe8f95c504c8823d09f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-06-06 11:56:50 +00:00
David Schulz
f3e164af4f ProjectExplorer: prepare for parallelization of recursive file scan
Change-Id: Ia2db3ef0fe619907c1ed30b8f984de4de04cc477
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-06-05 10:59:59 +00:00
Cristian Adam
1712402b35 CMakePM: Add project CMake settings support
This is useful if projects do not to have "Auto Run" CMake or want to
have Junctions enabled.

Change-Id: I4a636e7bf64fe2d29d15d39fe9aa46807684c716
Reviewed-by: hjk <hjk@qt.io>
2024-05-28 15:03:42 +00:00
Jarek Kobus
982ad24243 CommandLine: Reuse new c'tor
Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-22 09:13:41 +00:00
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