Commit Graph

33 Commits

Author SHA1 Message Date
hjk
f9c97d23c7 Utils: Add optional recursion for file system iteration
Change-Id: Icded897b129aebd7132376cff55717e16dffc040
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-01-18 11:52:29 +00:00
Cristian Adam
86825283ed CMakePM: Allow loading of projects that do not have any targets
Fixes: QTCREATORBUG-25509
Change-Id: I4e56576f0d9fdffa50c81f4901fb30d17952553e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-09-16 17:35:18 +00:00
David Schulz
ed8b87d4f6 CMake: correctly track remote cmake files
Change-Id: I6685ed7ba77282d9d5154ba4192841f5bd093783
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 12:59:33 +00:00
David Schulz
335a74353f CMake: parse remote json files
Change-Id: I2dd8e160140e6eba35b9968d5afb0953c5cfa43c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-09 12:43:35 +00:00
hjk
bdefc13eba Utils: Rename FilePath::absolutePath(FilePath) to resolvePath
There was already a similar function taking a QString.

After that, the remaining no-argument version of absolutePath()
can be deprecated.

Change-Id: I5b9ad8c8b68a5723891b0aa9f5a37e90db0fe09e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-09 05:42:30 +00:00
Cristian Adam
27f0dd134f CMakePM: Do not treat generated files as project files
This would trigger an infinite loop.

Fixes: QTCREATORBUG-26207
Fixes: QTCREATORBUG-26204
Fixes: QTCREATORBUG-25346
Fixes: QTCREATORBUG-25995
Fixes: QTCREATORBUG-25183
Fixes: QTCREATORBUG-25512
Change-Id: Iaf081a00dcf318a0ec2708e839e0ab6535e0ef4d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-02 08:04:17 +00:00
Cristian Adam
c1c70d339d CMakePM: Fix build library search path with CMake 3.20+
CMake 3.20 has changed the relative path to dependent libraries
from current binary directory to main binary directory.

See https://gitlab.kitware.com/cmake/cmake/-/issues/22556

Fixes: QTCREATORBUG-26110
Change-Id: I39c1d6b2998ebb079e7017e8d349881752d80354
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-20 13:58:15 +00:00
hjk
2ff446bd25 CMake: Simplify CMakeConfigItem::toBool() use
Change-Id: I60120a152174b7c3751b99ac92d31bdb9c3ab1d9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-21 06:25:17 +00:00
hjk
d8bd855c02 CMake: Use FilePath::dirEntries file api parser
Change-Id: Id83284518029414721cf1a44111d8f63cae9246f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:16:53 +00:00
hjk
d857e17b13 CMake: Use FilePath::ensureExistingFile in file API
Change-Id: I38c2e97711bbc1c72c51eeb59429572ea7931e4d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 12:35:02 +00:00
hjk
24190d9c0b CMake: Use local paths with file system watcher
Change-Id: I6eb831255f90b56115a5c5d79175a8985052ff83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-29 08:58:25 +00:00
hjk
cf8a05fbec CMake: Use FilePath in FileApi{Reader,Parser}
Helps docker.

Change-Id: I2e1eba61be983340260211bbee6c1bab8a59f883
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-16 07:21:08 +00:00
hjk
d254cf5845 CMake: Use Utils::FilePath in fileapi parser and reader
It still relies on local host execution in some places.

Change-Id: I36adfeb93ea26b285bbf6da2aee7e0fac64a7d94
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-09 12:15:02 +00:00
Eike Ziller
58d03f3f2f CMake: cancel file api parsing
Change-Id: Ie59370fa4329f92dd28bf3e147b2828cbd75330b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-01 12:35:25 +00:00
Cristian Adam
c9053256d3 CMakePM: Better error message when CMake file-api config is missing
Now the available configuration list is displayed, alongside with
the hint that CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES needs
to match / contain the "Build type" field.

In order to test this just clear (or set a random value) in the
"Build type" field and click "Re-configure with initial parameters"
button.

Fixes: QTCREATORBUG-25506
Change-Id: I44558c45c7050d03e72a3a0b9ce2c8d89bd6e4bc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-23 15:27:08 +00:00
Cristian Adam
69afdcd290 CMakePM: Use case insensitive search for file-api configuration
Fixes the case of CMAKE_BUILD_TYPE=RELEASE on Linux, when the project
loading would fail due to "Release" build type name used by Qt Creator.

Change-Id: I2b1a643df190fd02acc422d154a717ed5cd9ce31
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-05 12:16:22 +00:00
Cristian Adam
6cbdae8070 CMakeProjectManager: Support for multi-config generators
CMake has multi-config generators like:

  * Visual Studio
  * Xcode
  * Ninja Multi-Config

The first two have different special targets for "all", "install",
"package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE",
"RUN_TESTS".

All of them need to get the build type passed via "--config <build-
type>" and not via "CMAKE_BUILD_TYPE".

The multi-config generators will use only one build directory.

Fixes: QTCREATORBUG-24984
Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-21 09:31:30 +00:00
Eike Ziller
c5a70e7daa CMake: Use new MessageManager API
Flash when CMake is started, write all other output silently.
This avoids re-popping up the general messages pane all the time.

When an error occurs, that is put into the issues pane, so no need
to pop up the general messages pane for that either.

Task-number: QTCREATORBUG-24430
Change-Id: I07ae4182cbc43147fbb343b360baf9da7e65f224
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-04 10:52:52 +00:00
Christian Stenger
617a8aee2b CMakePM: Start integrating ctest
Gather some more information of a CMake based project to be
able to provide this later on to the AutoTest plugin.

Task-number: QTCREATORBUG-23332
Change-Id: I2beaf0a6456d57871dcf65832f0a79f37fe5fddc
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-09 11:02:37 +00:00
Robert Loehning
64a641ec6a Use IDE_DISPLAY_NAME
Change-Id: If8ae9399a40a460b535faeec2320d1450e5099c5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-08-03 09:13:52 +00:00
Eike Ziller
8b8ecfa28f Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/fileapiparser.cpp

Change-Id: I39f8c2be859be043f506bef77de9bb5b42d38165
2020-06-15 11:30:34 +02:00
Tobias Hunger
182c460a2b CMake: Do not treat project with the empty string as a name as invalid
CMake will happily accept the empty string as a project name, so do not
treat that is invalid in Creator. Apparently the empty project name will
get generated by CMake itself if no project() command is found in the
top level CMakeLists.txt file.

Make sure to set a sensible name if the top-level project has no name,
using the directory name of the source directory instead.

Change-Id: I3b861daa13c1d0fec31c294ef0ac15338310020d
Fixes: QTCREATORBUG-24044
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-11 12:34:25 +00:00
Tobias Hunger
8c830f79e7 CMake: Improve debugging output when parsing projects from file-api
Change-Id: Ifaed0e5a6566923052a4e2f00adbb3617cd42c8b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-11 12:34:01 +00:00
Tobias Hunger
7c985c14ad CMake: Move notification on outside cmake runs into FileApiReader
Move the detection of outside cmake runs into FileApiReader and
make the FileApiParser non-interactive.

Change-Id: I70afc1df35fcfe90e88822569579154aabbdb1cd
Fixes: QTCREATORBUG-24015
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-05-15 08:36:50 +00:00
Tobias Hunger
517cb05db0 CMake: Clean up API of FileApiParser
Clean up the API of FileApiParser in preparation of moving
the FileSystemWatcher out of that class and into FileApiReader.

Change-Id: I5618252dd98a39f6a70f56b50fb50327e8b43e84
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-05-15 08:36:37 +00:00
Tobias Hunger
5350288e45 CMake: Fix includes all over the CMake plugin
Keep internals internal, remove some unnecessary includes, add
some that should have been there.

This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.

This patch also moves some code around that ended up being
in the wrong file.

Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-20 10:05:24 +00:00
Leena Miettinen
4354ea8df9 CMake: Fix UI text according to the guidelines
https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html

Task-number: QTCREATORBUG-23683
Change-Id: I56af56e745fe4237e1bb9df94f8cd423585e63a4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-03-11 10:06:41 +00:00
Alessandro Portale
9904464074 Make various Q_LOGGING_CATEGORY's static
Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 14:54:10 +00:00
Leena Miettinen
5b943b6e7a CMake: Fix UI text
Change-Id: I5bf6e8a67bb09500502b4d35e227354390a3be19
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-28 15:20:54 +00:00
Eike Ziller
9cc45fe1fb CppTools: Move RawProjectPart to ProjectExplorer
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.

Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
2019-09-11 06:22:12 +00:00
Tobias Hunger
eab0df22f9 CMake: Make fileapi not race against its own reply file detection
Fix broken logic to prevent CMake fileapi from detecting the change
its own cmake run triggered via file watching.

Remember the last file that was parsed and do not attempt to parse
this again. Remember the file on a per-project basis, too:-)

Change-Id: Ia6e155b65d77994f6e3d2a3677f770a4ba53539d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-25 13:32:21 +00:00
Tobias Hunger
09ae77d0a9 CMake: Update code to decide whether to run cmake in fileapi mode
Change-Id: Iea841bb49876a580abc80cc7ea21a88b153cc224
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-23 11:11:30 +00:00
Tobias Hunger
a95eb53d3b CMake: Add initial fileapireader class
Change-Id: I620cba7cc1c2a5ac56789fa9770dce573c6b19cd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-20 12:25:36 +00:00