Commit Graph

3443 Commits

Author SHA1 Message Date
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
hjk
39570fb675 Utils: Rename PathChooser::rawFilePath() to unxepandedFilePath()
That's what the implementation does, and judging from the using code
wasn't quite clear.

Change-Id: I4ca776ba4da83a36162adad2dd595eb39eb0f43d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-19 14:26:05 +00:00
Cristian Adam
b240bfb3db CMakePM: Fix crash when hovering in CMake file without a project
Fixes: QTCREATORBUG-31077
Change-Id: I60526fb37e5d8c7713a5b22dfddb3e52c50fc5f7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-18 15:51:45 +00:00
Cristian Adam
a8e2ccdea6 CMakePM: Expand CMake macros in the "vendor" debugger settings
Qt Creator will use the CMake macro expander for the "vendor" string
entries.

This would allow the following CMake preset snippet to work as a CMake
preset user would expect it to:

```
  "vendor": {
      "qt.io/QtCreator/1.0": {
        "debugger": {
          "DisplayName": "LLDB Dap 18.1.7 Debugger",
          "Abis": ["arm-darwin-generic-mach_o-64bit"],
          "Binary": "$env{HOME}/llvm/clang/bin/lldb-dap",
          "EngineType": 1024,
          "Version": "18.1.7"
        }
      }
    }
```

Change-Id: I4ea5ce0b004ff05cebbe3e0ce4b6bcc09c716322
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-18 14:48:21 +00:00
Cristian Adam
b66a800045 Revert "CMakePM: Set platform codegen and linker flags for GCC compilers"
This reverts commit 831b93905b.

Reason for revert: breaks Android and it looks like magic. For CMake one
should use a toolchain file. But this revert keeps the CMAKE_C|
XX_FLAGS_INIT parameters update / merging.

Change-Id: I1c3c61e4a9345a29e72db7f5f5a2d6e3fdba52f1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-11 09:52:22 +00:00
hjk
d308b86847 Utils: Centralize aspect macro expansion setup and handling
Let each aspect have a macro expander, and let aspect-owned lineedits
use this for expansion.

Change-Id: Ifa6f5a678cf81c169643e4145f41e69eafedeb93
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-10 06:31:20 +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
Eike Ziller
c935f69827 Merge remote-tracking branch 'origin/13.0' into 14.0
Change-Id: I7ca7fc0d963b30257fd735eca8b00aedef1443ae
2024-06-06 09:01:03 +02:00
Cristian Adam
0fa8047f12 CMakePM: Transform a few raw C strings into constant literals
This way you can have code completion for the constant literals and not
do any accidental typos.

Change-Id: I1f9dc36327052fcda9575dddec909db93c4b225c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 13:14:02 +00:00
Cristian Adam
e04c727043 CMakePM: Don't remove QML debugging flag with the preset value
If a CMake preset has the CMAKE_CXX_FLAGS_INIT parameter defined, it
would override the QML debugging flag set before.

This patchset makes sure that both are present.

Change-Id: I2012567af04c2fa0b0097331c05d96770dd86503
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-05 13:13:14 +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
f17c0fe19c CMakePM: Fix Presets macro expanding of environment
Amends a25bbf23c6

The commit broke evironment variable usage in CMake presets. For example
"$env{HOME}" would have been expanded to "/home/user:/home/user" because
of code thinking it deals with paths.

Change-Id: I3ef34179e2ebaf55b25a42dcce87438c1a72b73e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-05 06:59:13 +00:00
Cristian Adam
831b93905b CMakePM: Set platform codegen and linker flags for GCC compilers
If a GCC compiler has platform codegen flags they will be set into
CMAKE_C_FLAGS_INIT or CMAKE_CXX_FLAGS_INIT initial CMake parameters.

The linker flags are set they will be set into
CMAKE_EXE_LINKER_FLAGS_INIT, CMAKE_MODULE_LINKER_FLAGS_INIT and
CMAKE_SHARED_LINKER_FLAGS_INIT initial CMake parameters.

If the kit has a Qt the CMAKE_CXX_FLAGS_INIT value will merge both GCC
C++ platform codegen flags and the QML Debugging flags.

Fixes: QTCREATORBUG-24420
Change-Id: I066d30b816ae8575f615654bb85bd82a394f9737
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-04 18:32:57 +00:00
Cristian Adam
a9995e23b1 CMakePM: Allow CMake custom build types
CMake can have custom build types. Qt Creator can rename existing build
types.

This changeset allows having a custom build type like for example:
  * CMAKE_BUILD_TYPE=MyRelease
  * CMAKE_CONFIGURATION_TYPES=MyDebug;MyRelease

Fixes: QTCREATORBUG-30014
Change-Id: I3d81d9ff867bfaab29aaf1741606f9c586da82e0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-04 15:30:37 +00:00
Eike Ziller
ca3c4537d8 Merge remote-tracking branch 'origin/13.0' into 14.0
Conflicts:
	src/plugins/copilot/copilotsettings.cpp

Change-Id: I6d17cf8968d6efbafb883da8346c7950349f7d84
2024-06-04 14:43:35 +02:00
hjk
b10d5581e4 Utils: Make LayoutBuilder setter setup less repetitive
Change-Id: I9113f7a97566c21cf83dcb95ce8e75e9707360b4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-06-04 12:15:37 +00:00
Cristian Adam
725cf0637f CMakePM: Skip .obj/.o for static qml plugins in PATH
Amends 5d159e6185

This commit reverts to Qt Creator 12 behavior, plus skipping .obj/.o
parts which are needed for linking but not for finding out library paths
that need to be added to PATH environment.

Tested with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/
qml/tutorials/extending-qml/chapter6-plugins

Without the patch (Qt Creator 12 behavior):

"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_resources_1.dir/.qt/rcc",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_init.dir/chartsplugin_init_autogen",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts/CMakeFiles/chartsplugin_init.dir",
"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts",
"C:/Qt/6.7.1/mingw_64/lib",
"C:/Qt/6.7.1/mingw_64/bin"

With the patch:

"C:/Projects/chapter6-plugins/build/Desktop_Qt_6_7_1_MinGW_64_bit-Debug/
Charts",
"C:/Qt/6.7.1/mingw_64/lib",
"C:/Qt/6.7.1/mingw_64/bin"

As you can see above, only skipping the .obj/.o files will bring a lot.

The change also doesn't come with the side effects of the Qt Creator
13.0.0/1 releases.

Task-number: QTCREATORBUG-29662
Change-Id: I264a0ef579177b7129471919b77cd22a46e7d511
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-06-04 09:03:31 +00:00
Cristian Adam
5d159e6185 CMakePM: Only add external "bin" dirs to PATH
At QTCREATORBUG-29662 we have the issue when a program cannot be started
because the PATH environment variable had content longer than 2048
characters.

Qt Creator 12 had only one place that added paths to librarySeachPaths
namely the "bin" directories.

Qt Creator 13 tried to filter these "bin" directories to the ones that
have .dll files. This fixed QTCREATORBUG-29662 but had issues with dlls
having different names than the link libraries provided by CMake.

By only allowing "bin" directories from paths not from the build
directory we allow Qt, or OpenSSL dependencies, but not just existing
"bin" directories.

Amends 0d8a542b4f
Amends 8713919f31
Amends ac97ab1abf
Amends 2ce6255a7d

Task-number: QTCREATORBUG-29662
Change-Id: If0b162f25ae1e5bfc1e1ff313720c54c5ae936c5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-03 13:33:55 +00:00
Eike Ziller
3d828123be Merge remote-tracking branch 'origin/13.0' into 14.0
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: I71bfee426a3e25ab7c7cd276ffe1e7d8fe550ffe
2024-06-03 12:23:06 +02:00
Cristian Adam
2ce6255a7d CMakePM: Do not check the existence of dlls for PATH handling
In order to fix QTCREATORBUG-29662 the check of existence of an dll was
a prerequisite to add the path to the PATH environment variable.

As it turns out this is not an easy thing to do, since the ".lib" file
name can be different than the ".dll" file name.

Also for MinGW you can have ".dll.a" or ".a" as library filename
extensions. You can also have a "lib" as prefix for the library
filename.

Amends 0d8a542b4f
Amends 8713919f31
Amends ac97ab1abf

Task-number: QTCREATORBUG-29662
Fixes: QTCREATORBUG-30827
Fixes: QTCREATORBUG-30932
Change-Id: I90afad825d43fd4f801c2aac20ed98f013861152
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-31 16:31:21 +00:00
Christian Kandeler
36f2a21f2d ProjectExplorer: Support column numbers in file path linkification
... for task details.
As a result, clicking on a linkified file path inside a task in the issues
pane will now open the editor at the column specified in the compiler
output, if there is one. We used to consider only the line.

Change-Id: Idccba33b5b33029abfa8f29c7888af6c7f2e1622
Reviewed-by: hjk <hjk@qt.io>
2024-05-31 13:04:27 +00:00
Christian Stenger
b87e3a53db Fix json templates
Amends 6cd7aed8eb.

Change-Id: Ia8369c69530854488007ef28c191fdfbca4c082c
Reviewed-by: hjk <hjk@qt.io>
2024-05-31 08:22:46 +00:00
Leena Miettinen
6cd7aed8eb Add long descriptions to some plugins
Edited the short descriptions to answer the question
"What can I do with this extension" to help users decide
whether they need it.

In long descriptions, tell users what else they need to
be able to use the plugin.

Change-Id: Iefce7505b61fc77cf38cc915f1f7dbd25c9cb570
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-31 06:42:53 +00:00
Cristian Adam
968051eb72 CMakePM: Presets: Add ability to register a Debugger via "vendor" field
This adds "Debugger" as a dependency for the CMake Project Manager.

The "vendor" field of a configurePreset can look like:

```
      "vendor": {
        "qt.io/QtCreator/1.0": {
          "debugger": "C:/Qt/Tools/mingw1120_64/bin/gdb.exe"
          }
        }
      }
```

or with all the DebugItem details as:

```
      "vendor": {
        "qt.io/QtCreator/1.0": {
          "debugger": {
            "DisplayName": "GNU gdb 11.2.0 for MinGW 11.2.0 64-bit",
            "Abis": ["x86-windows-msys-pe-64bit"],
            "Binary": "C:/Qt/Tools/mingw1120_64/bin/gdb.exe",
            "EngineType": 1,
            "Version": "11.2.0"
          }
        }
      }
```

Fixes: QTCREATORBUG-30836
Change-Id: Ia89ff29ce5fad713ee8617477ec798bd86f2f811
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 15:47:10 +00:00
hjk
efae651924 Utils: Introduce a convenience function creatorColor()
... forwarding to creatorTheme()->color(...)

Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 13:49:25 +00:00
Cristian Adam
322944469f CMakePM: Add/remove CMake parameter for "Package manager auto Setup"
The CMake parameter is CMAKE_PROJECT_INCLUDE_BEFORE used in the "Initial
Configuration".

This commit will add or remove the above parameter in the "Initial
Configuration" list.

Previously, the parameter would have been added only on the first time.
Now with project CMake settings this is needed also for already
configured projects.

Change-Id: I7293032ef3e7e6e0ad0b51c68ef5fbe0cab48919
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-29 10:17:15 +00:00
Alessandro Portale
7bc65cf9f3 PluginSpecs: Change URLs from http:// to https://
Avoid the redirect that is inevitable nowerdays.

Also, change necessitas.kde.org to www.qt.io, since the orgininal page
is offline.

Change-Id: Ib1823f0df97d2df87822fd2bb7552e2f2c7e971e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2024-05-28 20:13:29 +00:00
Cristian Adam
1a5f61adca CMakePM: Set CMakePM project settings via CMakePresets's vendor field
The field name is "qt.io/QtCreator/1.0":

```
  "vendor": {
    "qt.io/QtCreator/1.0": {
       "AskBeforePresetsReload": false,
       "AskReConfigureInitialParams": false,
       "AutorunCMake": false,
       "PackageManagerAutoSetup": false,
       "ShowAdvancedOptionsByDefault": true,
       "ShowSourceSubFolders": false,
       "UseJunctionsForSourceAndBuildDirectories": true
    }
  }
```

Fixes: QTCREATORBUG-25972
Fixes: QTCREATORBUG-29559
Fixes: QTCREATORBUG-30385
Change-Id: Ifac0d10eebda85f8d97e7a1387325a555101ea6d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-28 17:19:27 +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
hjk
971938421c Use LayoutBuilder V2
This puts the implementation introduced in acf1ecb47f into use, after
significant simplifications in the class hierarchy. CRTP is not used
anymore, and the new tag based dispatch is also used for Layout::addItem,
effectively reducing the number of different code paths.

The Lua based settings access is disabled for now.

Change-Id: Idb6d1a25675378757c5267bdb630bcd4c1f52d34
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-27 12:38:48 +00:00
Cristian Adam
fa39d0490e CMakePM: Remove per CMake tool "Auto Run" setting
The setting is global for a few Qt Creator versions now, and it was
marked for removal in Qt Creator 13.

Change-Id: Ibca753b53a27ce89cba25a8c55c080e5597c4f57
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-27 09:14:40 +00:00
hjk
f30d369b99 Fix QMetaType::type() related deprecation warnings
Not in sdktool, which still builds with Qt 5.15

Change-Id: I6e6f4331127b821e471e2840e7959cd65e6419e9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-23 13:04:22 +00:00
Cristian Adam
6eaa9f099a Help: Allow open online documentation for CMake
Qt Creator opens by default the offline documentation of CMake.
But the user can click on the "Globe" to go to the online version
of the documentation.

Change-Id: I0b3a6bceb13784b232b539f1c04bd09aa3a11034
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-05-23 12:50:27 +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
Eike Ziller
eb45240649 Remove PluginManager::futureSynchronizer()
Use the global synchronizer from Utils::futureSynchronizer() directly

Change-Id: Ic8843bc1ff7951c041529a258f36117f08ec4b35
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-05-21 13:02:46 +00:00
Eike Ziller
5b83dd2430 CMake: Fix translatable string
Translatable strings should not start with a space, but always adding a
fixed string to an existing string is not a good thing to do in any case.
Languages/translators might have different opinions on this. There is no
good way to do this without breaking the original string, so just do it.

Amends 0e30918955

Change-Id: I4f240d1e0e45f12ee3a7e88dd11a0b539557ab4e
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-05-17 12:00:18 +00:00
Eike Ziller
fecf95b58e Merge remote-tracking branch 'origin/13.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	doc/qtcreator/src/projects/creator-only/creator-projects-build-run-tutorial.qdoc
	qbs/modules/qtc/qtc.qbs

Change-Id: I67a2540677a8b5c309c0c81e2a509a61d0a65aa8
2024-05-17 09:18:14 +02:00
Eike Ziller
6075904af5 CMake: Fix library build path for MinGW
The code that handled the MinGW case of libFoo.a -> libFoo.dll
broke the case of libFoo.dll.a -> libFoo.dll that is handled
by the code before that.

Amends 0d8a542b4f
Amends 8713919f31

Fixes: QTCREATORBUG-30556
Change-Id: I76f60c5e646bce97169b205860babf6a0d3b08b6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-05-13 08:53:38 +00:00
Marcus Tillmanns
dced7ce913 CMake: Use theme colors for text prefix
Also uses new Utils::ansiColoredText() function.

Change-Id: I43e59f78eb47903fc273244a9cd4e9da9b68839f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-07 11:15:04 +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
Cristian Adam
5cc8abd8bd CMakePM: Add "Clear CMake Configuration" to context menu
Fixes: QTCREATORBUG-24658
Fixes: QTCREATORBUG-30771
Change-Id: I6429e861a77663513ed3243396bdd67042c11faf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-05-06 16:25:49 +00:00
David Schulz
bf41545468 ProjectExplorer: remove confusing function from Project
Change-Id: Ifaed5d8293dadd2ae3cfdab3b027434d4f8caa3e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2024-05-02 13:37:47 +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
0f4efacb91 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	doc/qtcreator/src/overview/creator-only/creator-reference.qdoc
	doc/qtcreator/src/qtcreator-toc.qdoc

Change-Id: Ibea5488fda972321c448c64fad7f657e84d62cdb
2024-04-30 14:23:09 +02:00
Cristian Adam
84f0f6ba8b CMakePM: Fix crash with specific CMakePresets.json
The code was not taking into consideration an empty QStringList.

Fixes: QTCREATORBUG-30755
Change-Id: Ifb9f5dc3ffefd94d44b16b161bc04d381f3f6786
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-04-29 14:39:09 +00:00
The Qt Project
2ab8e2f35d Merge "Merge remote-tracking branch 'origin/13.0'" 2024-04-22 11:33:50 +00:00
Cristian Adam
6f984bd285 CMakePM: Use ILocatorFilter::createRegExp for locator filter
This presets better results, and is in sync to what other locator filters
are doing.

Fixes: QTCREATORBUG-30452
Change-Id: Ia77d2a5f22b33b55aa081d09372ab5cf297bb065
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-22 11:18:11 +00:00
Eike Ziller
e5640386f8 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	doc/qtcreator/src/qtquick/qtquick-live-preview-devices.qdoc
	src/plugins/projectexplorer/projectexplorer.cpp

Change-Id: I682b330a278a329fc6294baeff6a28040abd10bc
2024-04-22 12:18:10 +02:00