Commit Graph

54 Commits

Author SHA1 Message Date
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
Tobias Hunger
d8ed91c44f CMake: Add per-cmake option to not automatically run cmake
Task-number: QTCREATORBUG-15934
Change-Id: I54fdb505a451fb269c3747a370c8dfd7043c6c9d
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-28 09:09:10 +00:00
Tobias Hunger
5d3823ac47 Use SynchronousProcess::runBlocking
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>
2016-05-26 11:50:03 +00:00
Jarek Kobus
3f19774c0f Set LC_MESSAGES instead of LC_ALL for parsing the error output
Task-number: QTCREATORBUG-15855
Change-Id: I05aa83acb356840cfdacc92796b190fb8754ada0
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-04-11 12:36:29 +00:00
Tobias Hunger
5aca8ca27e CMake: Remove no longer used code
Change-Id: Icdd132b891e223a874051448bb4e5a090bdc245e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-01 14:30:44 +00:00
Tobias Hunger
4a1a29d9c5 CMake: Fix generator parsing on Windows
Change-Id: I8afc8651fc1299a2a8782749966fd7ba770c9423
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:23 +00:00
Tobias Hunger
d400959d7e CMakeCbpParser: Small cleanups
* Do follow-up fixes to CMakeTool

Change-Id: Ia3c587acb85d613499e91988200d8bbae32eca3d
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-12 12:37:11 +00:00
Tobias Hunger
fa17e27b7f CMake: Delay initialization of CMakeTools
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>
2016-01-27 12:43:45 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Tobias Hunger
8146402e05 CMake: Use Qt5-style connects
Change-Id: I5ec451b55237fcceca86f0134ae081b435dab5c5
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-08 13:33:44 +00:00
Tobias Hunger
b2b6d3c526 CMake: Semi-automatic cleanups
* 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>
2016-01-08 12:17:41 +00:00
Benjamin Zeller
255b5850e2 CMakeProjectManager: Support mapping chroot include paths
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>
2015-04-21 09:58:53 +00:00
Benjamin Zeller
adf70c1a84 CMakeProjectManager: Kill cmake process on cancel instead of waiting
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>
2015-03-10 14:52:33 +00:00
Benjamin Zeller
1e2d266541 Make CMakeTool known to the Kits
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>
2015-03-03 12:47:36 +00:00
Benjamin Zeller
99e9643dea Make it possible to register multiple cmake instances
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>
2015-02-24 09:54:43 +00:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Montel Laurent
0d0a6d119a Use new qt5 connect api
Change-Id: I6c0d4ec60759b3c2fedac3e6649b7ec5102a6487
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-29 14:29:30 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00