Commit Graph

3443 Commits

Author SHA1 Message Date
Cristian Adam
afea900b96 CMakePM: Add directory icon overlay for know source groups
This way the CMake Project Manager will behave in the same way as QMake
Project Manager!

Change-Id: I3c4bd6b2f4f0f5d4dfc73edb2049d6e251154d54
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-08-09 07:08:55 +00:00
Cristian Adam
716c1d03f2 CMakePM: Treat "Forms" and "State charts" as special source groups
Amends 76dcc069d6

As a user I expect that the "Forms" and "State charts" source groups
should go away if I select the filter "Hide Source and Header Groups" in
Projects view.

They are not meant to be user defined source groups.

Change-Id: I17db9eb7e1da17b93a45f6093782add19c2b5cb1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-08-09 07:08:46 +00:00
Cristian Adam
6fd9a3c807 CMakePM: Refactor display of CMakeLists.txt
All CMakeLists.txt from the Project view are marked as generated, except
the root one. This means that in normal case they will be hidden.

Every CMake Target (except Utility) will get a CMakeLists.txt:<number>
entry with the definition line of the target.

The CMake Folders will get an entry with the CMakeLists.txt which can be
accessed via context menu and "Open...".

The CMake Folder that only had a CMakeLists.txt will be removed when the
filter "Hide Empty Directories" is checked. This for example makes a
reduced plugin Qt Creator only display the enabled plugins, and not all
plugins!

With this change the "Simplify Tree" view will no longer have many
CMakeLists.txt entries, which makes the view more useful.

Fixes: QTCREATORBUG-31362
Change-Id: I708171e4b114100fae6fb592044a19fc36239261
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-08-09 07:08:40 +00:00
Cristian Adam
5f3a343352 CMakePM: Show the target callstack in top order
In Projects view you can right click on a CMake target and select
"Open...", in the context menu you will have a stack of functions that
were used in the creation of the target.

If you are using a custom CMake API you would want the highlevel
function on top, and not on bottom.

Task-number: QTCREATORBUG-31362
Change-Id: I42e436d99f6c5f7a8d1cd67da84a6087bc18e8cd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-08-07 10:39:07 +00:00
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
Christian Stenger
fca63b75bc CMakePM: Silence soft assert
Amends 04b9c08153.

Change-Id: I7de369307a68ed2f243ccf40ab8ffa435f808aca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-08-05 12:00:39 +00:00
Christian Kandeler
1b2493259c CMakeProjectManager: Fix warning
"loop variable ‘var’ of type ‘const QByteArray&’ binds to a temporary
constructed from type ‘const char* const’ [-Wrange-loop-construct]"

Change-Id: I663dcb0c990ee125be9b90640e2925014f7166d1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-07-31 10:43:47 +00:00
Cristian Adam
04b9c08153 CMakePM: Mark CMake modules from prefix path as generated
This will result in "Project View" the "CMake Modules" folder to be
hidden if it only contains CMake files from CMAKE_PREFIX_PATH or
CMAKE_FIND_ROOT_PATH.

Users of QtQuick or Qt Widgets applications will no longer have to see
the "CMake Modules" with "<Other Locations>" and the paths to the Qt
CMake files.

This way the CMake projects will resmble the QMake projects.

Change-Id: Icde9a556be5bceccdb4abb11072fbd17b59dce4d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-30 16:39:44 +00: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
Cristian Adam
5dccb8072c CMakePM: Allow slashes for CMake "FOLDER" separators
Previously only backslashes were taken into consideration. Now also
slashes, since CMake supports them for Xcode and Visual Studio
generators.

Fixes: QTCREATORBUG-31305
Change-Id: I096540769ee53ce7c30c0543d1bd250f098ac19c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-30 16:38:49 +00:00
Eike Ziller
2373c4c0a4 iOS: Do not enforce architecture for CMake builds
Do not set CMAKE_OSX_ARCHITECTURES, the defaults are fine.
It builds for x86_64 for Qt/Simulator/x86_64 and for arm64 for Qt/
Device/arm64 automatically, and then also for custom Qt/Simulator/arm64
builds that didn't work before because we enforced x86_64 for Simulator.

Task-number: QTBUG-101276
Change-Id: Ic33eab6d418210ad6384951e0b0f1972a2287a6b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-07-29 10:50:41 +00:00
Eike Ziller
81f7325a0c macOS: Remove code handling Qt Creator running under Rosetta
Remove code that was added to handle the case of Qt Creator running as
an Intel binary on ARM Macs, which required some passing of flags to
qmake/CMake/LLDB.

Nowadays, Qt Creator can be built for the corresponding architecture
(and by default we provide universal binaries).

Partially reverts a71d725e46

Change-Id: I842f85b85a26d09cff72199ae86c602fd8f14e33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-07-29 10:50:28 +00:00
Alessandro Portale
a0e37a76fa Plugins: Add URLs to manual page to plugin metadata
Fixes: QTCREATORBUG-31199
Change-Id: Ideadc75499f32a8f1d1c95cd38dc4669a3d422c3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-29 07:27:29 +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
a8cbd17733 CMakePM: Implement "FOLDER" property for targets
See the CMake documentation https://cmake.org/cmake/help/latest/
prop_tgt/FOLDER.html

This allows placement of targets in the project view in specific folders
like e.g. "tests"

Qt Creator (ab)uses the FOLDER property for the "qtc_runnable" feature,
see https://doc.qt.io/qtcreator/creator-run-settings.html
which would not allow to have both.

The "qtc_runnable" should be fixed by having a property "QTC_RUNNABLE"
for a target and have Qt Creator parse the code.

Fixes: QTCREATORBUG-28873
Change-Id: I73433de78b9a86f631ee9d7903db535b69b734f6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-25 11:37:14 +00:00
Eike Ziller
3bbfd66bad Merge remote-tracking branch 'origin/14.0'
Conflicts:
	src/plugins/android/androidmanager.cpp
	src/plugins/android/androidrunner.cpp
	src/plugins/android/androidrunner.h
	src/plugins/qmldesigner/components/texteditor/texteditorview.cpp
	src/plugins/qmldesigner/components/texteditor/texteditorview.h
	src/plugins/qmldesigner/designmodecontext.cpp
	src/plugins/qmldesigner/designmodecontext.h
	src/plugins/qmljseditor/qmljseditingsettingspage.cpp

Change-Id: Idada49bb7441e8c5b748bd75b2e6bb2351bd323e
2024-07-25 12:56:53 +02:00
Eike Ziller
dbce96d888 CMake: Fix endless recursion if context help doesn't find anything
Amends baf20b8491

which removed the inheritance from the contextHelp method.
CMakeEditor now registers a context help function, which called
BaseTextEditor::contextHelp if no documentation was found, which was
correct when contextHelp was still virtual. Now
BaseTextEditor::contextHelp is the same as IContext::contextHelp which
calls the function that CMakeEditor registered again, leading to endless
recursion.

Change-Id: I912f69e0d0d3285c9fa77194f84b0819085c99b7
Reviewed-by: hjk <hjk@qt.io>
2024-07-18 08:23:12 +00:00
Cristian Adam
bef8cf703d CMakePM: Mark CMake presets registered toolchains as Manual
By default are marked as Autodetected, which is not the case for CMake
presets.

Fixes: QTCREATORBUG-31255
Change-Id: I5c3da7c6e7c68a8a2e80e415393010121b33efb4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-17 14:53:50 +00:00
Eike Ziller
18937fd44b Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	src/plugins/qmljseditor/qmljseditordocument.cpp

Change-Id: Ibef70b4c0eba5ccd5da7b05ca2bd3a9e8ee1cc0c
2024-07-17 11:43:34 +02:00
Cristian Adam
6e79888943 CMakePM: Fix code model for cross-compiler CMake presets
CMake Project Manager is using a small CMake project as a compiler probe
when a CMake preset is being setup. Now this CMake project is saving
more variable as cache variables.

These CMake variables could be only visible inside the CMake preset
probe project via a CMake toolchain file.

CMAKE_SYSROOT was important to be set in the Kit. The CMAKE_C|
XX_COMPILER_TARGET variables are set to override the original triplet
for the code model.

Fixes: QTCREATORBUG-31249
Change-Id: I3c3294b839629c22ce760596b92b2b393eed6a8b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-15 11:45:22 +00:00
Christian Kandeler
fec896e712 Utils: Add convenience function for generating a unique Id
Change-Id: I74516ef5077009ebcf1d47c724ca63e502729ede
Reviewed-by: hjk <hjk@qt.io>
2024-07-12 11:47:05 +00:00
Cristian Adam
751cfa7bc3 CMakePM: Do not allow staging dir setting for clean build step
CMake will fail with an error for the "--target clean install"
combination.

Change-Id: I6de31539a3ead57bbcde5ce9905a22c9aeb3fd12
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-12 10:52:11 +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
hjk
cba64c460b Use the new BaseAspect::addOnChanged in a few places
... and in some cases move it closer to the aspect setup. I kept
the original location in cases where the order possibly matters.

Change-Id: I4774ea355d0d1e3cf890676a84121195fca6d406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-07-12 07:40:10 +00:00
Eike Ziller
42a8b5b432 Merge remote-tracking branch 'origin/14.0'
Change-Id: Id00d72a8707d122b72d89ed0ecf03ad5ed8230d2
2024-07-11 12:10:59 +02:00
Alessandro Portale
3775750a80 CMakeProjectManager: Use LayoutManager in CMake tools settings page
Change-Id: Ied210a8311e8d83cb44056d544308c19930b479f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-07-10 14:46:48 +00:00
Cristian Adam
e451f42fc7 CMakePM: Use FilePath::path() instead of toString()
Amends 412eeefafa

Change-Id: I82fa1eadd61a4acc2ab25499ef16dd40ef284942
Reviewed-by: hjk <hjk@qt.io>
2024-07-10 12:00:05 +00:00
hjk
495418d4c4 CMake: Simplify CMakeBuildSettingsWidget::kitCMakeConfiguration()
Change-Id: Ie64500c42128f5e38ebdd83b0853a016e36cfc0d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-07-10 09:21:53 +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
hjk
baf20b8491 Core: De-virtualize IContext::contextHelp()
Adapt the using code.

Change-Id: I2f46de253d5f00c4bd74b2adea163b7c23145393
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-07-08 13:51:08 +00:00
Cristian Adam
dd1f76d85b CMakePM: Do not use "edit-copy" icon for source folders
This "edit-copy" icon used for source folders is very confusing. The
linked bug report has screenshots comparing Qt Creator and Xcode. Xcode
just uses consistently a folder icon for all nodes that are actually
folders.

This change will make Qt Creator also display a folder icon for the
source folders.

Task-number: QTCREATORBUG-30012
Change-Id: Ibfcc4f55e779ed368edd30bfbc711bd81a4aa499
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-08 11:39:13 +00:00
Eike Ziller
8d99cd800b Merge remote-tracking branch 'origin/14.0'
Change-Id: Ic3c53630e16712b6493873d21485b726f0d06574
2024-07-08 10:31:06 +02:00
hjk
9e413cb458 Utils: Make Aspect::addToLayout() const
It's conceptionally const, and would be useful to use as such, but
the current implementations often modifie mutable state.

To ease the transition pain, rename the previous non-const version to
addToLayoutImpl() and call it after const_cast'ing.

Change-Id: Ic8ca38e40f5df69c3d11121f96ea37648cf4feb7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-07-08 05:53:24 +00:00
Cristian Adam
412eeefafa CMakePM: Detect CMAKE_PREFIX_PATH from qmake's path when empty
If qmake -query fails for some reason then %{Qt:QT_INSTALL_PREFIX} would
evaluate to an empty string and CMAKE_PREFIX_PATH will not help CMake
find Qt packages.

By using the path to qmake itself we can safely determine a valid
CMAKE_PREFIX_PATH and CMAKE_FIND_ROOT_PATH.

Fixes: QTCREATORBUG-31194
Change-Id: Ib649dd57bfe3a97ef93a42603d83331922f99612
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-07-05 09:01:23 +00:00
hjk
43977018b6 CMake: Rename CMakeConfigurationKitAspect{Widget->Impl}
It's not a widget.

Change-Id: I617dd189cbdc815bf9055ab4908dc7239b784e64
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-07-02 14:27:21 +00:00
Eike Ziller
0283b81392 Merge remote-tracking branch 'origin/14.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: If39fe80197537c489361810e91ee221c6c52ea01
2024-07-01 12:01:27 +02:00
Eike Ziller
38e005692e Plugin meta data: Add full stop to descriptions
Where they were missing. The text is shown as a paragraph in the
extension manager.

Change-Id: I6e15c89fe4023b222e9c476f4312e13fcb0905c0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-28 06:46:52 +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
e2be8f9d16 CMakePM: Fix having duplicate CMAKE_CXX_COMPILERS entries
Do not apply the changes directly to the model, cache and then apply at
the right time.

Fixes: QTCREATORBUG-27005
Change-Id: Id099f21196900cd0e9787ac27887f2eec36f8045
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-27 16:01:19 +00:00
Cristian Adam
3572fdce03 CMakePM: Fix Qt SDK Kits when ninja is missing
Qt SDK is setting "Ninja" as default generator, make sure to get a
working generator when CMake is newly registered as a default tool.

Fixes: QTCREATORBUG-31129
Change-Id: I6b93a8904696eedadec04c882495c644db7ddce7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-27 16:01:11 +00:00
Eike Ziller
8dccc9c59e Merge remote-tracking branch 'origin/14.0'
Conflicts:
	src/plugins/qmljseditor/qmljseditorsettings.cpp

Change-Id: I443424afdfe48cdfc3d083d8e91335e937fcfdb6
2024-06-27 11:41:54 +02:00
Eike Ziller
e20f33cd4c Fix various translatable strings
Change-Id: I08e81f188a68c8e820f20a35249d1b318178a7b9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-06-27 06:02:04 +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
cc05c16377 CMakePM: Ask for a build configuration name for new configurations
Amends f866b03b19

This would do what the QMake build system does on new build types, it
asks for a name and uses that name in the build directory.

Fixes: QTCREATORBUG-26066
Change-Id: Iec5b4ace1e203affad718b42ec2bcbbc87aef51f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
2024-06-25 15:30:46 +00:00
Leena Miettinen
a9a611e21e UI text: Add dots to ends of messages
Use consistent wording for things that failed.

Change-Id: If8593077352b48418ca739d6933beef588057ac1
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2024-06-25 09:15:54 +00:00
Cristian Adam
660e579760 CMakePM: Code readability fix
Amends b240bfb3db

Having the assignement sepparate makes the code easier to understand.

Change-Id: I10112224c9752788e157012d53f638406b79793b
Reviewed-by: hjk <hjk@qt.io>
2024-06-24 14:48:17 +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
Christian Kandeler
c0bfd9bbd6 CppEditor: Clean up cpptoolsreuse.{h,cpp}
A lot of code had a more suitable place to live in, some was even
unused.

Change-Id: I36478ef473aa14395a182c9ac5e3738fc93134b6
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-06-24 09:14:47 +00:00
Cristian Adam
739b4fc5f4 CMakePM: Fix crash on non-cmake projects when viewing project's settings
Amends 1a5f61adca

Change-Id: Ife8eac40365d06e06a9177eb7a1886eb65a84095
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-06-21 13:28:47 +00:00