Commit Graph

207 Commits

Author SHA1 Message Date
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
hjk
87c3f08e52 CMake: Move settings storage closer to class implementation
Simpler in use.

Change-Id: I8cc929001035974b9b73566b206410bfd77f73a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-23 14:49:45 +00:00
Jarek Kobus
bad66c1fc2 CMakeBuildSystem: Run ctest process asynchronously in main thread
Instead of running it in other thread using blocking interface.

Amends 675a72e296

Change-Id: Ia4c7701fa4cd9efea4aeccd979dfb8cde28a889e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-01-18 13:33:25 +00:00
Jarek Kobus
1e10161bf2 CppProjectUpdater: Reuse TaskTree
Change-Id: I7474e5a31d169bf435d94536cffd77d218320977
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-11 16:32:12 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
Christian Kandeler
ca4af940b1 CMakeProjectManager: Provide generators
Task-number: QTCREATORBUG-28149
Change-Id: Iaebc04d729ccb3ec14496ae74ca6aa3d9aca8bac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-01-10 08:47:10 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Cristian Adam
2f39b51bdc CMakePM: Make "Autorun CMake" a global setting
The "Autorun CMake" is only visible in the Tools settings page when
the user clicks on CMake tool.

This is not very visible and it doesn't have to be per CMake version.

Change-Id: I57ded0b2e6a3ecb731bb8bc1495b6b61bc04c8b6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-05 14:37:50 +00:00
Jarek Kobus
d0e24654f6 CMakeProjectManager: Pass context object to lambda connections
Remove some unneeded lambda () brackets.
Remove some unneeded lambda return type specifiers.

Change-Id: I9695367d66a151f2611554b9fe5897c1bac7ef5c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-12-08 15:28:50 +00:00
hjk
7e9d50a2c9 Remove a few now-unnecessary cleanPath in conjunction with resolvePath
Change-Id: I05ee0116183a30e907fbd8e0b4faae9e6e58723d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-30 13:32:05 +00:00
hjk
7fd3a5e66e CMake: Use FilePath::suffix() instead of manual construction
Change-Id: Id2bc542047ce5f4ff1937be90b976d330b69c51a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-11-25 06:53:20 +00:00
Marcus Tillmanns
129448d61d QmlJS: Fix Follow under cursor
When trying to jump to a symbol in a qml file the Qml Model may find
the location in a generated .qml file in the build folder.
QtCreator searches in all generated .qrc files to try and find
the source file so it can jump to it instead.

Previously not all auto-generated ".rcc" folders would be found
as only the folders of targets (executables) were searched.
Plugins or Static Libraries were not searched.

With this fix, all projects nodes are searched for the ".rcc" folder
and therefore also finds them for Dynamic / Static libraries and
plugins.

Fixes: QTCREATORBUG-27173
Change-Id: Ic51ac8fbc82c15785cbefd76787942a512ecf3db
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-08 09:54:10 +00:00
hjk
4266f612e6 Utils: Rename FilePath::relativePath() to relativePathFrom()
Hopefully less confusion about the direction.

Change-Id: I61727d6c4d19e0dfe46f24ff24f5d90f9835d05c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-10-18 13:41:24 +00:00
hjk
ec430787e5 CMake: More FilePath in Deployment data
Change-Id: I898a621a34558a28d4688a33aeb9bb9148df6901
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-10-14 13:01:15 +00:00
Christian Kandeler
a34125ae11 CMake/qmake: Fix target triple for iOS targets
Neither cmake nor qmake know the full iOS compiler command line, so we
have to construct the target triple for the code model ourselves.

Fixes: QTCREATORBUG-28278
Change-Id: I6cac06f340e9388de5c86509a8df4ac00eef87cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-13 13:28:52 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Marcus Tillmanns
df859d891d Filepath: Add ::isSameDevice
Change-Id: I3990429b59759d5f72ed95e3a0d1723d3bb7bb82
Reviewed-by: hjk <hjk@qt.io>
2022-09-20 10:11:33 +00:00
Marcus Tillmanns
dabd9a175e CMake: Make sure source/build directories are reachable
Change-Id: Iea4547807b3a59eb9a8cb70d51d9015dbc8013e3
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 12:16:54 +00:00