Commit Graph

225 Commits

Author SHA1 Message Date
Cristian Adam
4d358ae337 CMakePM: Jump to function/macro/option definitions in CMake editor
Fixes: QTCREATORBUG-25523
Change-Id: If9ab6651a858e5fa08e8a1c321cb1f757831e14a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-14 18:10:22 +00:00
Tim Jenssen
1a3a8ecc96 Merge remote-tracking branch 'origin/qds/dev'
Change-Id: Id242ab4ca485527defdcc1555d204e12e50ddb7a
2023-09-14 17:37:24 +02:00
Cristian Adam
4f26d802ca CMakePM: Remove support for extra generators
They are marked as obsolete in CMake 3.27 and will be removed in a
future version of CMake.

Fixes: QTCREATORBUG-29603
Change-Id: I6e5d36441d05b87ee4467d13781f53d4269636ad
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 10:30:06 +00:00
Cristian Adam
74640c6d5b CMakePM: Fix crash
Amends 6528bd3eed

Fixes: QTCREATORBUG-29587
Change-Id: I62e469a461dd730858e05d0309151dba4e9fe93c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-09-12 11:56:28 +00:00
Eike Ziller
2792166574 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ifab8b72af33de4decf20d2a879bea4dfba1e9fbe
2023-09-07 11:15:32 +02:00
Cristian Adam
e892a6224f CMakePM: Save document before doing file operations on the CMake
Fixes: QTCREATORBUG-29550
Change-Id: I5ec360a48adce0d51a7fbe1704c7d4a9125bd913
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-05 08:41:43 +00:00
hjk
4e0c4b0f23 CMake: Rename cmakekitinformation.{h,cpp} to cmakekitaspect.{h,cpp}
Follow up after renaming the contained classes.

Change-Id: I9393c367abdd4eac487e17676c98a357ff33c98c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-22 05:56:39 +00:00
hjk
8346905a51 QtSupport: Remove unusual access pattern to plugin constants
Change-Id: Ifc21607cd9927e99b5c49f1631d8940725a058fd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-21 07:41:45 +00:00
hjk
aa25fdcc69 QtSupport: Rename qtkitinformation.{h,cpp} -> qtkitaspect.{h,cpp}
Change-Id: I12229e5e98b468101d32edd35be74bbda0921d89
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 08:59:52 +00:00
hjk
017d7c0e47 ProjectExplorer: Rename kitinformation.{h,cpp} to kitaspects.{h,cpp}
Change-Id: I069bddeb457366210d339edcbb8ffb359a40fab8
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-15 07:31:03 +00:00
Artem Sokolovskii
3ab2da691d DAP: Add check that cmake 3.27 or higher
If CMake version is lower then 3.27
- Shows the warning in general message
- Starts CMake without debugging
- Stops debugging correctly

Change-Id: Ibb13555c20ae2961c0a3c2ef6ec0fcc25930dddc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-14 13:41:39 +00:00
hjk
0be0772fc9 Merge remote-tracking branch 'origin/11.0'
Change-Id: Ib67c8ecb1865ee31ca6485c9287039ba877c68cd
2023-08-10 10:03:04 +02:00
Cristian Adam
6528bd3eed CMakePM: Find the right AUTOUIC generated header
Amends c4e15769ec

When using ui files in static libraries AUTOUIC reports fake header file
names.

By using the target that includes the source ui file we can find the
correct header file name.

Change-Id: I1c8e0b81ad2c670be87c3620f98bd0f5cce40cd1
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-09 09:48:27 +00:00
David Schulz
0ece08c9dc Merge remote-tracking branch 'origin/11.0'
Change-Id: Iad820911996f8daff6ce63b4f0267bd15d35d176
2023-08-08 07:34:26 +02:00
Cristian Adam
c4e15769ec CMakePM: Fix AUTOUIC ui_header.h file code completion
The wrong header was reported to the extraCompiler when AUTOUIC was set.

Fixes: QTCREATORBUG-28787
Change-Id: I92d37e56ee5e45229545184e4f4911764834ed67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-04 15:29:25 +00:00
Artem Sokolovskii
cd6e990de8 DAP: Add CMake debug to the debug panel
This commit introduces the capability to initiate
CMake Debug sessions directly from the debug panel
in the QtCretor.

Change-Id: I00245e0e14aded378e881c4049cdc41dd1fbd00e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-07-14 08:47:01 +00:00
hjk
5f9408ee8d CMake: Move some functions from build system to build config
Less indirection.

Change-Id: I3a0a41c360b051cf0a3021d57d437fbde8f0736e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-10 11:50:42 +00:00
hjk
dbdd6a0701 CMake: Pass CMakeBuildConfig to the settings widget
... instead of the build system. Less indirections overall.

Change-Id: I59b2fd4508b24a72357426439cac7fbd563e05bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-10 11:50:10 +00:00
hjk
b9cf021b8e CMakeProjectManager: Use aspects more directly in build configuration
Change-Id: I35b9a31c158cac8eccb44ffb3f4e2d21d8183b8b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-10 11:48:30 +00:00
hjk
3e155919eb CMake: Use current pattern to access main settings page
Change-Id: I95c556bebe1d583879b6702f727d9a859b9a4bcb
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-07-07 12:57:27 +00:00
Eike Ziller
dff9e1463b Reduce usage of app_version header
Most information is available via Q(Core|Gui)Application.
Add an AppInfo structure for the things that are not.

This avoids that the information ends up duplicated and
hardcoded in the plugins, which is not needed or desired.

Change-Id: I4d565e75c42a7b8facafa90c27096ea49359215d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-26 06:57:46 +00:00
Christian Kandeler
cf6bd7e012 Fix occurrences of the contains/insert anti-pattern
Introduce and make use of Utils::insert() for QSet with a return value
that indicates whether insertion actually happened.

Change-Id: I655e4bc3553b74fea5ae8956205e4d8070118d63
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-23 09:51:54 +00:00
hjk
904fa0aca3 CMake: Check for CMakeCache.txt also in remote builds
Change-Id: Ide179188a7fbd10b122a6bb34de08f943324133f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-06-12 13:18:57 +00:00
Eike Ziller
6e7bb28f09 Tr: Add missing full stops
Change-Id: I2debc56d0740eaa30c7d597eae18910f319c1d98
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-26 13:50:18 +00:00
Cristian Adam
c1cdea2661 CMakePM: Consider quoted file names for file operations
It is not uncommon for projects to use quoted file names, which would
break the new file operation support for CMakeLists.txt files.

Change-Id: I8dc5d6843f1723c5709cef28cf3bf89a5c87ec2a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-23 16:27:14 +00:00
Cristian Adam
2f04f08611 CMakePM: Remove comment line lexer addition
This brings the lexer back to vanilla CMake version.

The comment arguments were not needed in the implementation of
source file addition / rename / removal operations.

Change-Id: If28b738b9ce93511b109fe09dcd03f42ee07a431
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-23 14:58:27 +00:00
Eike Ziller
bd660aaf27 CMake: Fix setting additional project files for file watching
Amends d8be2491a5

The change above introduced FileApiReader::takeCMakeFileInfos and uses
it to move the information about additional CMake files out of the
FileApiReader. But that now emptied variable was later used to inform
the project about these additional files. So, that broke the automatic
running of CMake when project files (except the toplevel one) changes.
Instead use the list of additional files that now lives in the
CMakeBuildSystem for that purpose.

Change-Id: I1062593029880af9d4c70e72e1bd101d40ad0c00
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-08 12:23:10 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
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>
2023-05-04 05:52:16 +00:00
Cristian Adam
c2e657bbf6 CMakePM: Allow file rename / remove for QtQuick projects
qt_add_qml_module was not consided when looking for existing project
files.

This would fail when qt_add_executable and qt_add_qml_module were used
with the same target name.

Change-Id: Ib7374a3e1213c23aaf12d100a8817a46d57a4303
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-03 12:20:54 +00:00
Cristian Adam
71b3c6950f CMakePM: Parse the CMake file before adding new / existing files
This way the functionality would work even if autorun CMake is disabled.

Change-Id: I54ab47d72664cb42486b260b895f58d37a885cce
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-03 12:17:57 +00:00
Cristian Adam
874b1133d9 CMakePM: Allow file rename / remove via variables
Lookup any variables found in the target definition function in order to
find the source files.

This works for something like this:

  set(SOURCE_FILES myfile.cpp)
  add_executable(myexe ${SOURCE_FILES})

Change-Id: I8a47ea64b4efa467074f03ed5e1d1d05b2b1bf00
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 19:04:39 +00:00
Cristian Adam
5c2b2966e7 CMakePM: Enable "Add Existing Directory"
This works via "addFiles" and it's supported.

Change-Id: I18d193878c9549581a77d74fd8eb9761c4b08271
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-02 19:04:15 +00:00
Cristian Adam
411b2e05b8 CMakePM: Allow project files to be removed in project view
Removal of a project file is done as a rename with an empty filename.

Fixes: QTCREATORBUG-25922
Change-Id: I4443d4a31723eb1ac93f02bad633bcfaf99a9573
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-04-25 09:22:40 +00:00
Cristian Adam
54af6bd5b3 CMakePM: Allow files to be renamed in project view
This includes both with source files explicitly specified or
resulted from a file(GLOB|GLOB_RECOURSE) call.

Fixes: QTCREATORBUG-27538
Change-Id: I5ee113af168bdb8cd0a96e8ab2ae603c0607fb0b
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-25 09:22:08 +00:00
Cristian Adam
039baab6e7 CMakePM: Add new / existing files for QtQuick projects
Fixes: QTCREATORBUG-28904
Fixes: QTCREATORBUG-28985
Change-Id: Id05f13cc69b8afffafba1b956ee1c90dc88c6d57
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-04-20 17:28:14 +00:00
Cristian Adam
d8be2491a5 CMakePM: Add new / existing source files to project
This will add the new added source files (.cpp, .h, .qrc, .ui) to the
corresponding CMake source file as last arguments for known CMake
functions like add_executable, add_library as well for the Qt
counterprarts qt_add_executable or qt_add_library.

For custom functions the code will insert a target_sources() call.
Subsequent calls will add the files to the last target_sources.

The previous copy to clipboard mechanism and settings have been removed.

Fixes: QTCREATORBUG-26006
Fixes: QTCREATORBUG-27213
Fixes: QTCREATORBUG-28493
Fixes: QTCREATORBUG-29006
Change-Id: Ia6e075e4e5718e4106c1236673d469139611a677
Reviewed-by: hjk <hjk@qt.io>
2023-04-20 12:43:33 +00:00
Cristian Adam
9f6209a228 CMakePM: Do not check for changes for CMAKE_PROJECT_INCLUDE_BEFORE
This was the case previously when the path was tied to the Qt Creator
version.

This fixes the docker case when the expanded value gets replaced with
the unexpanded value from the initial configuration.

Change-Id: If005d410bc4408403fd79fa619c58217a499d3a5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-04-05 07:53:29 +00:00
Marcus Tillmanns
ca0bee902f ProjectExplorer: Create BuildDirectory on device
The BuildDirectory is now assumed to be on the build device.

The default build directory template path is resolved against the
project path mapped to the build directory.

Change-Id: Ie1d147d135e9e551f2ac46cbec583374d524d2d7
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-04-04 12:17:49 +00:00
hjk
305ccfe259 Utils: Replace FilePath::onDevice() by new FilePath::withMappedPath()
Basically a.onDevice(b) == b.withNewMappedPath(a), matching the order
of b.withNewPath(a).

Whether the (curretly docker-specific) path mapping is useful /there/, and
whether some of the calls are needed at all is dubious. I added some
FIXME and changed a few cases directly.

Change-Id: I7514736ce922f632f1f737bc496f6783389a42b6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-04 06:56:55 +00:00
hjk
242d19c19d CMakeProjectManager: Give some hints why deployment data looks wrong
Change-Id: If42b32ca80f4144b86ff882e0db243ba9f0f5cbf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-03 14:39:36 +00:00
hjk
2704f8ff0b ProjectExplorer: Proliferate FilePath a bit
Change-Id: Ia671a1de17b9e58764375c5f64cc47b053b0725a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-03-15 09:57:02 +00:00
Eike Ziller
379bf65e96 Some fixes in translated strings
- doesn't make sense to translate "%1"
- showPreprocessedFile: "reason" contains full stop, put at the end
- add missing closing >
- remove whitespace at the end of translated string
- added missing quotes and full stops
- Remove some control text from tr

Change-Id: I5537c3d12d038e25e2209af1198129fbf959b43c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-02-15 12:45:48 +00:00
Cristian Adam
a6ccfb09e5 CMakePM: Copy auto package-manager to ${buildDir}/.qtc/ directory
By copying the ${IDE:ResourcePath}/package-manager to
${buildDir}/.qtc/ the problem with hardcoding paths
to old an Qt Creator version can no longer occur.

This also fixes the issue with remote projects by reffering
to the code residing on the host.

With the above issues fixed, enable "Package manager auto setup"
by default.

Change-Id: Ia49654a3b9059f83886e64d065019b2d55e9299c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-02-08 16:17:49 +00:00
hjk
239f79fbec CMake: Use FilePath functionality to extract qml module files
Shorter and remote-capable.

Change-Id: If6b3a419eb78da2c2763bc45f4d1e33be7dbed17
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-08 11:22:57 +00:00
hjk
8a8b50e8b5 ProjectExplorer: Proliferate Utils::FilePath use
Move the .toString() uses into  DeploymentData::addFilesFromDeploymentFile

Change-Id: Ic9ef22da1918ca105c92f0231960dab27b0d80bb
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-08 08:21:29 +00:00
Christian Stenger
37a86061d8 CMakePM: Adapt to change in FilePath
Silences some soft asserts.

Change-Id: I4e39b66983552d85650062a3e8748e91936e8174
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-06 05:25:54 +00:00
Orgad Shaneh
092209fa84 CMake: Fix potential null deref
Reported by Coverity.

Looks like it cannot really happen in real life though.

Change-Id: I92e09dbe7dc81e694e5450c598c649c956eb7fcc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-01 13:54:43 +00:00
Christian Kandeler
97976fd3cb ProjectExplorer: Refactor BuildSystem::extraCompilerForSource
Factor out backend into more generic function to easily support new
accessors.
No functional changes.

Change-Id: I715ce2842d2c63574bdf6ada0d0e32fbfd5d08fb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-27 12:42:23 +00:00
Christian Kandeler
0d909c353c Designer: Update C++ code model on an object name change in designer
We try to locate the old symbol name in the generated ui header and
rename the symbol in the background.

Task-number: QTCREATORBUG-1179
Change-Id: Iaf68e3922cd728cbc87d0dc97125e34b8bdaa6be
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-01-27 10:02:52 +00:00