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>
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>
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>
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>
... 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>
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>
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>
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>
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>
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>
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>
Makes for way more robust (and featureful) generator discovery.
Change-Id: I7df837500e1c3a200960e9d157b5c105dacd4068
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
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>
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>
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>
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>
Use SynchronousProcess::runBlocking in favor of SychronousProcess::run.
This avoid nested event loops which can produce really strange crashes
if not use carefully.
This patch only converts those processes that have a timeout of less
than 5 seconds or use the default timeout.
Change-Id: I9de8899dcc946af7049ea357a91972996c0256a1
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Do not run cmake 5 times during startup. Delay that as far as possible.
Also add a supportedGenerators() method while visiting the code anyway.
Fix up and simplify the other cmake help output parsers.
Change-Id: I6622d552ffe559bf099b4b278618676a045e350e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* Shorten header guards
* Use override and auto where possible
* Remove useless destructors, etc.
* Remove private slots sections, unify private: sections
* Use member initialization where it makes sense
Change-Id: I00eaf6d706adc16859176d1b68c631d3336bb39f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Provide a way for plugins to map include paths into a build chroot.
Plugins can register a path mapper if required, otherwise the paths
are not touched.
Change-Id: I621982831fa354d6d0f558a6c1dce4e014421f12
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Instead of waiting until the timeout is hit, calling CMakeTool::cancel
should kill the process. The output of the process is not required in
that case. Otherwise when having multiple cmake instances startup of
QtC and using the settingsdialog can be slow.
Change-Id: I1013f69f72171304ddf8ff3dc4fce9a7cddc6758
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This patch adds support for binding a specific CMakeTool to a Kit.
When creating a new Kit or loading a existing one without a valid
CMakeTool, the default CMakeTool will be set.
Change-Id: I28d0843a01c583c4b31fc680a0ec556b40cd9c0d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This patch add the CMakeToolManager, a central repository for cmake instances.
One instance is always the currently used "default". By that its possible to
switch between different cmake installations. The next step will be adding
it to the Kits.
Change-Id: I310fdd805e0ed239077a5632303e891dbd1d9ea1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>