Commit Graph

71 Commits

Author SHA1 Message Date
Eike Ziller
f99e46c148 cmake: Fix version information about unsupported cmake tool
When registering a CMake version without fileapi support and setting
that in a kit, the kit shows a warning about unsupported version. It
didn't show the version of the registered CMake though. Make CMake tools
without fileapi return their version number.

Change-Id: I388d3e0a17ff4145238c5c90109522665a6f6fac
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-19 07:06:38 +00:00
Eike Ziller
953db51a15 cmake: Remove unused variable
Change-Id: I17d373088c3f2085c52ebf9230b3ce2f0f64074a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-19 07:06:31 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Orgad Shaneh
21e9947c21 CMake: Fix GCC warnings
warning: control reaches end of non-void function [-Wreturn-type]

https://stackoverflow.com/q/33607284/764870

Change-Id: Ia8d0a8d42d5db786c6800ab91a1ef790fe2387f1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-05-04 08:41:15 +00:00
Tobias Hunger
494b9f5287 CMake: Remove servermode support
Task-number: QTCREATORBUG-23915
Change-Id: I2a58e1d6d95c28e25787722fa37448d86c4aebc9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-29 14:30:16 +00:00
Tobias Hunger
f51f3c897e CMake: Do not crash without a supported CMake
Do not crash when a CMake < 3.7 (no server-mode and no file-api) is
used.

Change-Id: I72a4ce6bb81d4fcf3d59508c72e46f422a8a00c0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-22 10:38:27 +00:00
Tobias Hunger
9b78b9f766 CMake: Fix WS in cmaketool.cpp
Change-Id: Iffd3a7b8f53989c6756acb084e00543eba6d564c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-04-21 10:13:23 +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
Eike Ziller
62aed34077 CMake: Fix build with older GCC
Change-Id: Ib606c91039a4389e7f3fbb3d9c733240106da441
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-21 08:58:59 +00:00
Tobias Hunger
57662de841 CMake: Remove tealeaf reader mode
*** This removes support for CMake < 3.7 ***

Change-Id: Iddb0bab1a61b814adb4cb7ffa217284e96cb1140
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-19 14:05:42 +00:00
Tobias Hunger
12ee28f090 CMake: Fix snap-ed CMake installations on ubuntu
Snap packages apparently work by sym-linking the cmake binary to snap.

So keep the sym-link if it points to a file called "snap" on Linux.

Task-number: QTCREATORBUG-23376
Change-Id: I065457c26b32a191760e8dda1ef1bdc7a79712ad
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-22 13:51:33 +00:00
Eike Ziller
4e6142c932 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/autotest/testresultspane.cpp
	src/plugins/cmakeprojectmanager/cmaketool.cpp

Change-Id: Iade695ac9cab8bf3e3a1abd6e2c71f4a19132ac0
2019-11-21 22:18:35 +02:00
Tobias Hunger
cca33e2e26 CMake: Do not make the CMake tool invalid on timeout
Do no mark the CMake tool as invalid when it times out when fetching
auto-completion information. This happens the first time a CMakeLists.txt
file is edited in Creator.

Also increase the timeout so that there is less of a chance
to trigger have the information retrival time out -- which breaks
auto-completion of cmake variables, etc. in the CMakeLists.txt editor.

Closes: QTCREATORBUG-18530
Change-Id: I914377a6ece90c6f78ea5eb007da8fbe07785563
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-11-14 16:17:12 +00:00
Eike Ziller
900ef05d37 Merge remote-tracking branch 'origin/4.11'
Change-Id: I48e406d43f185e893523cc5e0dcf288afdc3e36c
2019-10-17 07:32:01 +02:00
Tobias Hunger
e38ccf16cd CMake: Make use of CMake-provided .qch files
* Have UI to select a .qch file location in CMake Tool setup
* Auto-detect CMake's .qch file in its default location (relative
  to the cmake executable)
* Register the .qch files with the HelpManager

Task-number: QTCREATORBUG-21338
Change-Id: I4057eec42c39535012d9f0daf788fc62ef20d544
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 10:40:03 +00:00
Tobias Hunger
5d1fe43a7a CMake: Run CMake less often
Run CMake less often to extract information on the CMake tool.

Change-Id: I959df99fee16e6196db61c84aee7908d66af222d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-10-10 08:14:04 +00:00
Cristian Adam
e186df1ba3 CMake: Properly reset CMakeTool on file path change
Fixes: QTCREATORBUG-18530
Change-Id: I46842aeb4bcfc2ae1267a485fd454b888cd1a885
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-10-09 14:27:57 +00:00
Eike Ziller
dbfa55f5fc CMake: Do not run GUI CMake tool on macOS
We may neither run "/some/path/CMake.app" nor
"/some/path/CMake.app/Contents/MacOS/CMake",
so add a missing workaround for the latter, and use the "resolved"
executable path for the retrieval of version info and capabilities.

Change-Id: I6fed8cc478c0d0b9946a934fd83126e157bde992
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-12 13:52:25 +00:00
Eike Ziller
ff503740ce Run CMake via canonical path instead of warning
Running CMake via a non-canonical path (including '..' in the path, or
via a symlink) can result in funny errors.

de6faa0f15 added a warning for that
condition. Unfortunately the auto-detection of CMake can return a path
to a symlink (e.g. for CMake from brew on macOS). Also it is helpful to
use a symlink to e.g. manage different CMake versions.

Instead of warning about the condition, and forcing the user to resolve
it manually, simply run CMake via its canonical path when actually
running it from Qt Creator.

Change-Id: I95623b45c5436a6d61c1419b7aba23e2a73a0650
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-08-12 12:54:28 +00:00
Tobias Hunger
de6faa0f15 CMake: Better warnings for strange/invalid CMake binaries
Warn when cmake is configured to use a non-canonical path. This might
trigger problems in CMake itself.

Show this warning in the Kit as well as in the CMake options page.

Also complain other issues in the CMake options page.

Task-number: QTCREATORBUG-22583
Change-Id: I841341db8305f9152543487ce9ceeab2eca0b2b9
Reviewed-by: hjk <hjk@qt.io>
2019-08-05 15:13:40 +00:00
Tobias Hunger
551d876db3 CMake: Fix fileApi detection
Fix fileApi detection: It returns a list of versions in -E capabilities
output, not just one version.

Change-Id: I94a59806f3c4577b01342cae6f05cdc8385131a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-25 12:15:32 +00:00
Tim Jenssen
333b33edbe Merge remote-tracking branch 'origin/4.10'
Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
2019-07-12 15:53:56 +02:00
hjk
79fd852f70 Cmake: Fix deprecation warning
... and use the result of the expression, which was previously computed
but not used.

Change-Id: Ic995d2842e71bf57ea404494e3586205a0c154e9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-05 13:29:29 +00:00
Christian Stenger
9c49cb65d3 CMake: Fix compile for gcc5.3
Change-Id: I207af16d54ad14ba27780ce82208c315db8e5170
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-21 08:59:21 +00:00
Tobias Hunger
c61c499970 CMake: Add an option to override cmake reader type
Add an option to override the cmake reader type that is going to
be used.

By default the reader type is "auto" for autodetection, but that can
get changed in the cmaketools.xml settings file. Other supported options
are "tealeaf", "servermode" or "fileapi" and that will force that reader.

You can also set QTC_CMAKE_IGNORE_FILEAPI=1 in your environment to force
creator to ignore the existence of fileapi support in all cmake tools.

Change-Id: I2006616312090ce2909154dc1966f7a8eaa2949a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-20 13:42:02 +00:00
Tobias Hunger
f02fcaf02c CMake: Fix WS
Change-Id: I24a265db05f4678a07f582f2e9a66ed1a17b0ac2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-20 12:22:05 +00:00
Tobias Hunger
a51b8a061e CMakeTool: Update cmake fileapi detection
CMake rejected a patch to add fileapi detection via cmake -E capabilities
output and asked to base the detection on the version number. This decision
has been revisited now and starting with cmake 3.15 the supported fileapi
object kinds and there version are reported.

Update Creator to use this information and to fill in the missing data for
cmake 3.14.

Change-Id: I382310a098925491921acf1b59099bbe0859cde2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-06-12 11:56:19 +00:00
hjk
ca4ba34229 Use Utils::FilePath in SynchronousProcess
Adapt callers and surrounding code.

Change-Id: Ie6c1883a44169cf9d790d06b660f46d24dc24c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:11:07 +00:00
Tobias Hunger
aad9828dca CMake: Detect fileapi in cmake
Detect whether cmake supports fileapi or not. This is based on the
version number since cmake upstream does not want to add a flag into
the capabilities output:-/

Change-Id: I036adf65cbd1b171f0f98a7c86230a7ca33fff32
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-06-06 14:33:17 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
Tobias Hunger
c17a1ce249 CMakeTool: Move introspection data into separate class
Change-Id: I53dd2f6f09f164042fe796761678b93f1f99bb75
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-12 12:21:40 +00:00
Tobias Hunger
7478c4aef1 CMakeTool: Split parsing out of data retrievel methods
Change-Id: I237d90310bc032b7537ab33e0cb181e2163be5a7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-07-11 08:30:50 +00:00
José Tomás Tocino
caf935b60f CMake: Fix cmake version detection
Task-number: QTCREATORBUG-19966
Change-Id: I0834e1c117e96d05912b7bba7362b4d3d4c6c28d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-05-23 14:14:49 +00:00
Tobias Hunger
8fb3105e25 CMake: Add option to auto-create build directories
Add an option to CMakeTools to force auto-creation of build directories.
This does lead to cmake cluttering up the file system with directories, but
does not force users to go through the oftentimes long configuration process
twice (once in a temporary directory and once in the real location).

Task-number: QTCREATORBUG-16794
Change-Id: I68d92fc58638ad0a0a7622b7ef1621e055c9f2a7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-20 12:39:18 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Orgad Shaneh
7b3642cce4 Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
2016-11-28 15:27:51 +02:00
Ulf Hermann
31749b76b8 Cmake: Don't take QStringRefs of a temporary QString
This crashes.

Change-Id: I3f81466f504fdff8d47372425ea8f84048f89b76
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-11-28 08:19:09 +00:00
Friedemann Kleint
840e787175 Use QString::splitRef() instead of QString::split()
Avoid string allocation where it seems feasible.

Change-Id: I61b23d4ef8a459f5aa77727a75f4e1d2b140da3b
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-25 11:32:47 +00:00
Tobias Hunger
9ff2bd16d3 CMake: Use Utils::FileName where appropriate
Change-Id: I3ab0a68920e27ebcf4e1dd58180a72ded58b892e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-17 11:41:51 +00:00
Tobias Hunger
b1433e2a05 CMake: Only pass the path mapper to the cbp-parser
No need to pass in the complete kit. Remove a couple of unnecessary
namespace names.

Change-Id: I2ac895535a80b4a54a423ce62dbdede65b67437b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-17 11:02:26 +00:00
Tobias Hunger
38b21ad04d CMake: Report version information on cmake tool
Improve data retrieval from cmake while at it.

Change-Id: I0329804b800bb9c3b7e734246f795cfd6ae361fe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 07:27:50 +00:00
Tobias Hunger
8d608d2a74 CMake: Add method to query server mode support to CMakeTool
Change-Id: I88ce643749d2d8f801b20a2c6d7555348292af94
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 07:27:38 +00:00
Tobias Hunger
3ef11019e2 CMake: Parse Generators out of new cmake -E capabilities output
Makes for way more robust (and featureful) generator discovery.

Change-Id: I7df837500e1c3a200960e9d157b5c105dacd4068
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 07:27:25 +00:00
Tobias Hunger
b3b6cfb5ef CMake: Improve generator selection in kits
Allow to select generator and extragenerator in a nicer way.
Enable support for platforms and toolsets.

Change-Id: I0c9aae635cdca0ec1db7f285e9cb2785172ed338
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 07:27:14 +00:00
Tobias Hunger
3f3a43a4af CMake: Polish cmaketool a bit
Change-Id: I576197bec6e48decd5e2b4befd156ea985822835
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-27 10:06:50 +00:00
Tobias Hunger
9dda516b08 CMake: Work around bug in cmake documentation when extracting keywords
Work around a bug in the documentation of CMAKE_COMPILER_IS_GNU*, which
leads to creator offering invalid completion when editing CMakeLists.txt
files.

Task-number: QTCREATORBUG-16852
Change-Id: I7c61445a7448bdd6f5de5f235316c260ba28e757
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-15 15:25:14 +00:00
Tobias Hunger
b57f20f633 CMake: Remove some QLatin1Strings
Change-Id: I218f2cec0d5d81dca22aec564bc0140780cee317
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-15 15:25:10 +00:00
Tobias Hunger
dfbb0b64b9 CMake: Improve cmake setup on Apple
Users tend to select cmake.app, which is actually a GUI for cmake and
not what Creator expects. So check for the proper binary in the bundle
and return that if it exists.

Change-Id: I1668baa6236ee4ae88da200cef257b636f7a9e72
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-09-14 12:40:22 +00:00
Tobias Hunger
5efd82468b SynchronousProcess: Store raw bytes from stdout/stderr of the process
Only convert the raw output later in a stdOut() and stdErr() method of
the SynchronousProcessResponse.

This is necessary since we have processes that use different encodings
for different sections of the file (I am looking at you, git).

Also remove the signals for raw data on stdout/stderr, leaving only the
signals returning buffered QString lines. This should be safe, even
with UTF-16 output.

Change-Id: Ida613fa86d1468cbd33bc6b3a1506a849c2d1c0a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-15 14:16:03 +00:00