Commit Graph

3443 Commits

Author SHA1 Message Date
Cristian Adam
bbe61a965d CMakePM: sanitize preset initial configuration values
The task-number below has a sample where CMAKE_C|XX_COMPILER was set to
"cl.exe" and the CMAKE_PREFIX_PATH was set to "C:/Qt//6.5.0/
msvc2019_64".

These values would cause "red" values in the CMake configuration, which
is not that nice.

This patchset will make sure that everything is nicely configured.

Task-number: QTCREATORBUG-28982
Change-Id: I21289d1936ef075ce02364fc675709c52c76c3ed
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-04-17 15:03:59 +00:00
Cristian Adam
45faec05e5 CMakePM: expand macros for all configure cacheVariables
Fixes: QTCREATORBUG-28982
Change-Id: Iabbf39b815ed7477a9d272a320308f320a31adbc
Reviewed-by: hjk <hjk@qt.io>
2023-04-17 15:03:53 +00:00
hjk
d8de6c88e9 Avoid creation of temporary lists of ProjectNodes
Change-Id: Iac84f7f95291fb3b12a071a066d358aaab309c52
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-04-17 11:05:39 +00:00
Jarek Kobus
7ab0fd56ae RunExtensions: Move onResultReady and onFinished into asynctask.h
Change-Id: I96dbf5b0253251224ae678172cd5fca12b34326a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-17 09:10:33 +00:00
Christian Stenger
2abe6bbe2c CMakePM: Fix passing library search paths
Amends 305ccfe259.

Change-Id: Icd08697720224e84cb4ad282d21191f80728865e
Reviewed-by: hjk <hjk@qt.io>
2023-04-17 07:50:40 +00:00
Eike Ziller
2bc37de42b Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/plugins/python/pipsupport.cpp
	src/plugins/qtsupport/exampleslistmodel.cpp
	src/plugins/qtsupport/examplesparser.cpp
	tests/auto/examples/tst_examples.cpp

Change-Id: I00273622423fa99d41621969f6ecbbdaa0e18664
2023-04-13 15:59:08 +02:00
hjk
7e63574764 CMake: Disable the default "install into temporary host" deploy step
This is not needed with the new option in the actual cmake build step.

Change-Id: I3bf8bd4ed96c44223ad401406a168d3c8d07fa23
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-06 10:07:48 +00:00
hjk
4753b658bb CMake: Allow to run staging installation in CMakeInstallStep
User configurable, on by default (only) for cases where build and run
device are different.

The staging dir is by default a randomly named directory on the build
device, but can be changed by the user if needed.

Overall, this does not change anything for a pure local setup (but
would let the user opt-in into staging, too)

Change-Id: Ic1c5fd1f1261e067692710c9e3aa9d821897478d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-04-06 10:07:37 +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
Eike Ziller
7fc0dcec0d Fix lots of tr.h files not being mentioned in CMakeLists.txt
Change-Id: I63d364ac50d9587339b10a5571870cb9a81c54ee
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-04-01 04:25:17 +00:00
Jarek Kobus
b5af4501df Fix include style
Change-Id: I64cb77f8d39dac35821fe96d735bc5dda35738e7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-03-24 13:42:50 +00:00
hjk
2766b4004b Utils: Continue Environment/EnvironmentChange consolidation
Make Environment a stack of changes that gets "expanded" to
a full environment before things are actively accessed.

Later this expansion should be done lazily if possible.

Task-number: QTCREATORBUG-28357
Change-Id: If1c7bfdb9f58b81e71c51ed87ee75d6964a47019
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-24 07:45:35 +00:00
Christian Kandeler
65814b124c CMakeProjectManager: Add lib and app binaries to project tree
Task-number: QTCREATORBUG-28815
Change-Id: I58ebcd2a6935eb4b6746b5fd58e6ab8b97fdef43
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-21 13:59:46 +00:00
Eike Ziller
0d8d4322b4 Merge remote-tracking branch 'origin/10.0'
Change-Id: Ie591b7130b33a042509e56701384f8ff4d9cb7f8
2023-03-16 11:57:01 +01:00
Christian Kandeler
76d2e7a4f3 ProjectExplorer: Add infrastructure for source -> binary mapping
Task-number: QTCREATORBUG-28815
Change-Id: Ib692981e92f5a395dbe400c2cd48042479f12c78
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-16 09:50:48 +00:00
Cristian Adam
17100d4ca9 CMakePM: add ${pathSepList} from CMakePresets version 5
Task-number: QTCREATORBUG-24555
Change-Id: Ic0bf0d7029267c71352294de428921ff52fe4359
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-15 10:53:45 +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
Cristian Adam
40a22963be CMakePM: Fix presets with macros in CMAKE_BUILD_TYPE
Fixes: QTCREATORBUG-28893
Change-Id: Ifc4927a31c6a30c3c8ab083d8724207202c75aa1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-15 09:15:16 +00:00
Cristian Adam
60e03d4805 CMakePM: Do not pass QTC_KIT_DEFAULT_CONFIG_HASH to configure
QTC_KIT_DEFAULT_CONFIG_HASH is used to match CMake presets kits and
should not pass to the CMake configuration.

Change-Id: I27caedf03f94c1e864f16d1f735e2edbabbfe871
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-14 18:03:53 +00:00
Cristian Adam
15e1a64764 CMakePM: Add include presets support
Fixes: QTCREATORBUG-28894
Change-Id: I9359cb85c230f2db02f08427af9832f168a32c41
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-14 14:47:28 +00:00
Eike Ziller
3043f4bba9 CMake: Fix leak and crash
The crash could be reproduced by opening a project, clicking the "Kit
Configuration" button in the build configuration, closing that dialog,
opening it again, opening the settings from the "Manage" button for the
CMake tools, and closing the settings dialog.

The "KitAspectWidget"s are not really widgets, and by default do not get
a parent, or are otherwise lifetime managed. When "they" are added to a
layout, actually only their widget members are added to the GUI. When
opening and closing the "Kit Configuration" dialog, the widgets were
deleted, but the KitAspectWidget instances were leaked and lived on, the
CMakeKitAspectWidget referencing a now deleted QComboBox, and still
being connected to the CMakeToolManager's signals, which subsequented
crashed when these were sent.

Fixes: QTCREATORBUG-28740
Change-Id: I36db3b6596ef21cc01dc877bca92b9961c0606b9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-03-13 12:28:49 +00:00
Eike Ziller
c7e94d80c7 Merge remote-tracking branch 'origin/10.0'
Conflicts:
	src/shared/qbs

Change-Id: I33e13270c8c15a51b4ce4eaa6b4584041ed124e0
2023-03-13 12:30:04 +01:00
Cristian Adam
05d9742a96 CMakePM: Expand CMake preset macros also for environment vars
This fixes the case when a CMake variable (CMAKE_PREFIX_PATH) would
reference an environment variable (qt_path) that would contain a CMake
preset macro (${sourceDir}/../qt_install).

Fixes: QTCREATORBUG-28606
Change-Id: Ib6239b13782b2ea854969547af46c3fe82a061f4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-11 08:56:06 +00:00
Jarek Kobus
4ae94a9910 CMakeProjectManager: Use QtConcurrent invocation for async run
Change-Id: I03b23a6bd32bfaa435ddddab1a7ab47a5203ff44
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-09 13:12:47 +00:00
hjk
5d21da74f9 Utils: More explicit host os use to make it stand out
Quite a few of the uses are actually wrong, but are better visible
now and therefore more likely to be fixed.

Change-Id: Ia51f7d6eb1b2d3a9c9f73d67dabacfd227c44b15
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-07 15:53:18 +00:00
Eike Ziller
36d9341397 Merge remote-tracking branch 'origin/10.0'
Change-Id: Idf151b6cfe87957cf905e67aab6b1275b9f0506a
2023-03-06 08:24:18 +01:00
Jarek Kobus
6efecebb10 ILocatorFilter: Provide default implementation for accept()
Change-Id: Ide3c65ac78da60c9634b8f1c3009e947e8f1e2f3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-03 14:06:17 +00:00
Jarek Kobus
215f79f580 LocatorFilter classes: Use more linkForEditor
Limit the usage of ambiguous internalData.

Change-Id: Ice67884b9fb2ff303939cd5998c6e80453e82530
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-03-03 14:06:08 +00:00
hjk
34fd28327d CMake: Use callback-based environment iteration
Hides underlying data structure.

Task-number: QTCREATORBUG-28357
Change-Id: Ib0d7fb70afa820b1bd28d23e12b9379a6de6546b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-03 14:05:07 +00:00
Cristian Adam
6a41e33908 CMakePM: Use cleaned paths for CMake parameter values
FilePath::fromUserInput will "clean" the paths, which on Windows means
that \\ will be replaced by /.

This is how CMake treats the paths internally as CMake paths.

This fixes the %{buildDir} macro which will expand to \\ on Windows.
Which causes issues with qtcsettings.cmake.

This way the expanded value of CMAKE_PROJECT_INCLUDE_BEFORE is not
displayed as red on Windows in the "Current Configuration" settings
page.

Change-Id: Ic26bf437de41ff3fb1c1b98d304ae84512cb0f1a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-03 13:57:08 +00:00
Eike Ziller
87ede95b5c Merge remote-tracking branch 'origin/10.0'
Change-Id: I7bd186df0bfae7906e980e9c2c811f8dcf29750d
2023-03-02 10:17:58 +01:00
hjk
3e7d93c788 ProjectExplorer: Move some not-fully-session related bits
... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-03-01 09:26:50 +00:00
Cristian Adam
cdee94d641 CMakePM: Ensure Initial Parameters values on build config Clone
Fixes: QTCREATORBUG-28759
Change-Id: I8d7fa476ff487cf4bf5005f1ccfec65ffc59ed1c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-28 11:47:48 +00:00
Jarek Kobus
b364e4a9cd LocatorFilter classes: Use Core namespace
Change-Id: I4fd1b1ed6aa9d844ed49123e80bfb066b9fa7af2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-23 08:28:45 +00:00
Orgad Shaneh
a5e98b1fa0 CMake: Avoid redundant copy
Amends commit e8802d92e3.

Reported by Coverity.

Change-Id: Ibc0b1cdf1918d5bfed5104f14098096d158526e2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-21 10:48:58 +00:00
Cristian Adam
10bbc7ce33 CMakePM: Add QTC_RUN environment variable for the CMake run
This way one can do certain things knowing that CMake is being run in Qt
Creator.

Change-Id: If3ac8a52f30f9fa73a756212199a25632c757dcd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-02-21 10:08:48 +00:00
Alessandro Portale
e27f82b49e Translations: Merge "OpenWith::Editors" into "QtC::Core"
Change-Id: I241ccc53afa11fa3faa1f1ca9363421827081812
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-02-20 08:00:37 +00:00
Alessandro Portale
6e24d3eec8 Translations: Fix some Tr::tr() calls
Tr::Tr::tr("Foo") would introduce extra translation contexts.

Change-Id: I43903d53d7d65677bb6b7a8bfd85eb5013c1fe6b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-02-17 10:17:40 +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
e8802d92e3 CMakePM: Add support for "external" arch and toolset
Fixes: QTCREATORBUG-28693
Change-Id: Id36f334c27f26a1f2ce65351de77e18d93b1a064
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-02-15 11:32:38 +00:00
Alessandro Portale
9f2f2f3390 Translations: Change translation context prefix from "::" to "QtC::"
lupdate would be confused by translation contexts starting with ::

Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:55 +00:00
Alessandro Portale
226799858c Translations: Replace QCoreApplication::translate() with Tr::tr()
Calling <Module>::Tr::tr() is preferred over
QCoreApplication::translate("::<Module>", "..."). This changes
occurrences in .cpp files.

Change-Id: I3311ef0dbf3e7d105a3f181b6b988f3b444468f1
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:37 +00:00
Alessandro Portale
64aaf66c3b Proliferate Tr::tr in various places
This changes several tr() calls which were either missed during Tr::tr-
ization or were added later.

Found with regular expression: (?<!(Tr::)|([\w]))tr\(

Change-Id: I1c0c03589e941614a7a8449ecfebc7d2cad396c3
Reviewed-by: hjk <hjk@qt.io>
2023-02-10 16:27:19 +00:00
Eike Ziller
b29cb4efe1 Merge remote-tracking branch 'origin/9.0' into 10.0
Conflicts:
	src/plugins/texteditor/codestyleselectorwidget.cpp
	src/plugins/updateinfo/updateinfoplugin.cpp

Change-Id: Iac33b852ccef6018bd81188716526aa70c3f5a2d
2023-02-10 10:29:14 +01: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
Christian Stenger
f5bd330277 Qbs: Update some qbs files
List respective tr files and while at it shuffle some
of the listed files to match common sort order.

Change-Id: I73845ad1dae5e8c86d3741067f40b7b2b37e2a6e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-02-08 14:37:03 +00:00
Eike Ziller
075f39e543 CMake: Fix editing of CMAKE_PREFIX_PATH
When editing e.g. CMAKE_PREFIX_PATH in the initial configuration
settings it was resolving the path(s) in there, thinking that it was
relative to the project directory.

Fix that after editing the resolved file path was set as the new value,
instead of the raw unexpanded data.

Fixes: QTCREATORBUG-28779
Change-Id: I14d097e3a3a51b78006dd30a67b08477cfe0f2d8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-02-08 11:39:21 +00:00