Commit Graph

134 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Cristian Adam
c0dfb3ce57 CMakePM: Hide QML clutter project files
Hide some of the QML files that we not marked as generated by the Qt QML
CMake code

Fixes: QTCREATORBUG-29631
Change-Id: I01fb571c0c3ff7d8a3861ddaaf7c6d6817c8cc51
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2024-04-18 13:14:17 +00:00
Cristian Adam
01538332da CMakePM: Treat all default CMake source groups as …
… "Header|Sources Files" groups
Amends f76e0de7bc

Change-Id: I5e19427a481e87fb4d9761e3fad1727df52ca28b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-18 10:16:24 +00:00
Eike Ziller
0fe7350368 Merge remote-tracking branch 'origin/13.0'
Change-Id: I0892d8e54930bb5a65dc51117b8ca7d70ce300a3
2024-04-17 13:29:02 +02:00
Cristian Adam
f76e0de7bc CMakePM: Do not show subfolders for custom source_groups
CMake does have a few default source groups (cmMakefile.cxx):
  this->AddSourceGroup("", "^.*$");
  this->AddSourceGroup("Source Files", CM_SOURCE_REGEX);
  this->AddSourceGroup("Header Files", CM_HEADER_REGEX);
  this->AddSourceGroup("Precompile Header File", CM_PCH_REGEX);
  this->AddSourceGroup("CMake Rules", "\\.rule$");
  this->AddSourceGroup("Resources", CM_RESOURCE_REGEX);
  this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");

This commit will get Qt Creator to display the actual subfolder
structure only if the CMake setting "Show subfolders inside source group
folders" is set and for "Source Files" and "Header Files" source groups.

Any other source group or a custom source group defined by `source_group`
will not get this treatment, since this what the oder IDEs (e.g. Visual
Studio) and what the users expect to have.

Task-number: QTCREATORBUG-27432
Fixes: QTCREATORBUG-30620
Change-Id: I3c30814df2f76d18ee5fd4fd1356d4dfc4b9b09b
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-04-15 13:08:40 +00:00
Cristian Adam
4a95a2d63d Revert CMakePM: Treat all sourceGroups as sourcesOrHeaders project nodes
This reverts commit 973e9dcf90.

Fixes: QTCREATORBUG-30602
Change-Id: I9db6dc6d3fbd7d9a5e48a25bca725a4f86124318
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-15 13:08:30 +00:00
Eike Ziller
310d3cc041 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	src/plugins/remotelinux/linuxdevice.cpp

Change-Id: Iad28a1bfa4632922931d351d2fe27757cf21dec3
2024-04-15 08:33:39 +02:00
Cristian Adam
ac97ab1abf CMakePM: Add build artifacts to the PATH env variable
Projects that have dll artifacts need to have the build paths added to
PATH so that the dependent executables would start.

Previously the code checked only if the dlls were present on disk, now
it also checks if the dlls are part of the project's build artifacts.

Fixes: QTCREATORBUG-30644
Change-Id: I924753ffaf0a9720acb70585ccd589abab1b9cc1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-04-09 12:59:15 +00:00
Eike Ziller
c19f97bd23 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	src/plugins/cmakeprojectmanager/cmaketool.cpp
	src/plugins/python/pythonutils.cpp
	src/plugins/qtsupport/baseqtversion.cpp

Change-Id: Ia3e35c763ff9475d17ad922718b54152209893b8
2024-03-14 11:35:07 +01:00
Cristian Adam
8713919f31 CMakePM: Fix dll path addition for MinGW
Amends 0d8a542b4f

Fixes: QTCREATORBUG-30529
Change-Id: Ic786f1e7075ef68cf9d590d27ef90b9d1e8631b0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-12 21:37:48 +00:00
Eike Ziller
6c2df76737 Merge remote-tracking branch 'origin/13.0'
Conflicts:
	src/plugins/android/androidsettingswidget.cpp

Change-Id: Ifcb16aa16c7bc2792de25d0ee7a22cf0e39a05f8
2024-02-29 12:44:58 +01:00
Cristian Adam
0d8a542b4f CMakePM: Only add paths with dlls to PATH
Skip adding object libraries paths to runtime PATH.
Also add only the paths that contain the dll files.

Fixes: QTCREATORBUG-29662
Change-Id: I58cd9b24c6c079b99ed51ae2ebd315a1aa195f04
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-02-28 18:33:37 +00:00
Eike Ziller
5af531cd39 Utils: Fix build with MSVC with C++20
Rename process.h back to qtcprocess.h

MSVC's "threads" standard header includes <process.h>, and that ends up
including our process.h from Utils.

There already was a hacky workaround in place for a similar issue with
MINGW, but that doesn't work with MSVC because that doesn't have

Simply use a name that doesn't conflict.

Change-Id: I1159cd2096b4f2dbc4a1728d0131dd6edd30ebd3
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>
2024-02-28 08:09:05 +00:00
Eike Ziller
30d048a256 Merge remote-tracking branch 'origin/12.0'
Conflicts:
	src/plugins/cppeditor/cppfilesettingspage.cpp
	src/plugins/haskell/haskellplugin.h

Change-Id: I880693c2e4986853b7aa600a5b7d6c09ad14634e
2024-01-30 09:19:06 +01:00
Cristian Adam
76a8966739 CMakePM: Refactor CMakeLists|Cache.txt as constants
Change-Id: I7165fa1d219a0c59bc519a9af1cd194414c4311c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-01-29 11:50:21 +00:00
Cristian Adam
c05ad8b446 CMakePM: Fix bad "path" backtrace generation
CMake can generate backgraces with absolute paths, and the commit
246f33c20d removed this support from Qt
Creator.

This commit fixes this issue with absolute paths.

Fixes: QTCREATORBUG-29914
Change-Id: Ib911e80aee1ff9f4a26435f7e693f7766551cc90
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2024-01-24 15:02:49 +00:00
Dominik Holland
ca3fab3a93 CMake: Add information about all sourceFiles to the CMakeBuildTarget
Change-Id: I13b978b2cd344c499c405ce11213261bf224296a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-12-22 10:25:01 +00:00
Eike Ziller
1c4de485da Merge remote-tracking branch 'origin/12.0'
Change-Id: Ib09af70f157a6c7d6cbda4e3de678fd2bbceb229
2023-11-20 09:48:43 +01:00
Cristian Adam
7affb80fc3 CMakePM: Do not show source/group/path twice
For the cases of:
  source_group(TREE ${CMAKE_SOURCE_DIR} FILES my/subdir/file.cpp)

Treat the "my\\subdir" part in the project view as part of the source
group name.

Fixes: QTCREATORBUG-29799
Change-Id: I92bf581be25d085783bcdadd8a418b849a29c708
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-11-16 16:39:38 +00:00
hjk
6685f0255d Utils/all: Move mime constants into a central place
They are reasonably standardized, and generally usable cross-plugin,
so this can help to avoid a few cross-plugin compiletime dependencies.

Change-Id: Icb2b010c3e12dee69df54ab16f6f8e90d9cffba6
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-11-08 09:59:26 +00:00
Cristian Adam
973e9dcf90 CMakePM: Treat all sourceGroups as sourcesOrHeaders project nodes
Previously only "Source Files" and "Header Files" were treated as
sourceOrHeaders project nodes.

But source_group can introduce a new source group which needs to be also
treated as sourcesOrHeaders project node.

Fixes: QTCREATORBUG-29799
Change-Id: I833d80155fba3fb0269aeab149ea74b0d2edd271
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-31 15:52:31 +00:00
Cristian Adam
4a220ab20a CMakePM: Fix coverity PASS_BY_VALUE warnings
Coverity-Id: 1569153 Performance inefficiencies  (PASS_BY_VALUE)
Change-Id: I03663b09ac3cbbaf3dec87dc9389c2015c16fafd
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-31 14:38:43 +00:00
Cristian Adam
3581d1c5dd CMakePM: Fix C/C++ code model preparation
Only set the compiler flags for the active language.
Select source and header files accordingly to the active language.

Fixes: QTCREATORBUG-29707
Change-Id: Ieeaa56f85ccc937f31253ac047538fa19ae4166f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-10-30 12:26:17 +00:00
Cristian Adam
423315178a CMakePM: Fix display of header / source files
Qt Creator will display the header / source files based on the
sourceDirectory of the target as base directory.

The source_group(TREE <dir>) will result CMake in making a source group
named "TREE" which should not be displayed in the project view.

Amends 9280f7f757

Fixes: QTCREATORBUG-23942
Fixes: QTCREATORBUG-29105
Change-Id: Ib71ffcc559376ea1596a5b21cb7e7fa779bd8d79
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-20 17:15:43 +00:00
hjk
fe129cc0c4 CMake: Reduce number of FilePath conversions in fileapidataextractor.cpp
Change-Id: If143843782b0bfdbdd68ab1a387d0feabfb60a33
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-10-20 10:27:57 +00:00
hjk
0e77cdcc2e CMake: save a few cycles
Cheaper checks first.

Change-Id: I7487862abf409ef0a885d6ac9511066a6f814039
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-18 08:08:00 +00:00
hjk
53b3255256 CMake: De-noise fileapidataextractor.cpp a bit
Change-Id: I1ed8b18e394246cbfd14394c7f9b79fd90f680d2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-17 15:22:02 +00:00
hjk
8845a7f896 CMakeProjectManager: Use a few FilePath::path() instead of toString()
... when appropriate.

Change-Id: I2c23e4688ec69f78b0ce873e578139d5c4e89c35
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-17 15:04:57 +00:00
hjk
b38c7a452e CMakeProjectManager: Fix path construction of pch files
This triggered soft asserts in FileUtils::copyIfDifferent() when
opening top-level qt.

Amends 246f33c20d which introduced a unwanted extra .parentDir() call
which removed part of the path.

Change-Id: Id0475a74a589372d37b7ec65d33d3faf6194013c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-17 14:52:35 +00:00
Cristian Adam
52fa2c369e CMakePM: Remove compiler group for all generated sources
Change-Id: Ie30bb63c96438d3582a7d2b753b9677a4a95fe9b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-10-13 13:30:46 +00:00
Jarek Kobus
ee48dba19e FileApiReader: Make shutdown faster
Check more often for canceled future.

Make more functions static.

Fixes: QTCREATORBUG-27729
Change-Id: I8dd787acea6343008c7515fb6a4fdfde50b37aee
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-06 15:37:12 +00:00
Marcus Tillmanns
34fdac0d84 CMake: Improve remote parsing speed
To improve the speed of parsing the result of a remote
cmake call, we move the file fetching and parsing into a
mapped concurrent call.

We also first uniquify the list of files to remove duplicates.

Fixes: QTCREATORBUG-29618
Change-Id: I18108928ba3b5f4f8ec3d5610b216c5ccf060877
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-10-04 13:40:36 +00:00
Cristian Adam
78f89fc777 CMakePM: Proper support for Unity builds
A Unity build can be enabled by specifying CMAKE_UNITY_BUILD set to ON
globally or per target bases via the UNITY_BUILD property.

CMake would then add unity_NN_[cxx|c].[cxx|c] sources files that would
include the existing project files.

The existing project files would then be added as "headers" to the
project and exported via the CMake file-api.

This patch makes sure that these new "headers" are added to the Qt
Creator's code model and have proper syntax highlighting, be available
to plugins (e.g. Todo) and so on.

Fixes: QTCREATORBUG-23635
Fixes: QTCREATORBUG-26822
Fixes: QTCREATORBUG-29080
Change-Id: Ie8dd542504f632c01f91691f8736e51be8b19a01
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-09-14 18:10:27 +00:00
hjk
67212a31ee Utils: Cache theme icon access
These trigger over 120k file exist check on my machine on startup,
just for a handful icons.

Change-Id: Ic73f0783142ed329c2f8c8b852f622e69fc306da
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-09-01 14:03:33 +00:00
Cristian Adam
246f33c20d CMakePM: Replace QDir with FilePath in fileapiextractor
This allows remote support.

Change-Id: I5ac46b1c2ed0e7e1fcc559522f1fcd902f83b8c0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 13:06:30 +00:00
Eike Ziller
c9fd5465eb Merge remote-tracking branch 'origin/11.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs

Change-Id: I0b0394dd68cf89b2579d623af897f55dc01aeea5
2023-08-25 11:50:14 +02:00
Eike Ziller
f2da62fd22 Fix exclusion of system directories from (DY)LD_LIBRARY_PATH
We should not only exclude children of system directories, but also the
directories themselves.

Fixes: QTCREATORBUG-29478
Change-Id: I1aa18b2faa03d241b8cc43eb157b5fa49285a12b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-25 07:16:35 +00:00
Jarek Kobus
8dd46d0399 Various Plugins: Simplify return FilePath statements
Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 08:19:23 +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
04bb8c7b02 Remove some unused variables & includes
They are set and modified, but never read.

Change-Id: I6f21ae325e21513678f1534cd05e1a2470b9627b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-06-28 12:11:15 +00:00