Commit Graph

29 Commits

Author SHA1 Message Date
Tobias Hunger
b7f15d8cdf CMake: Do not crash when restarting a filesystem scan
Change-Id: I7a86169f4dd891c91295a7d6daadfd2bac8db751
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 10:29:59 +00:00
Tobias Hunger
4b4dc9d06c CMake: Project tree for server mode data
Change-Id: Ief884a76c1b4211501dd6515b17b6e88a8e881e5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-14 10:29:53 +00:00
Tobias Hunger
c286d16c00 CMake: Scan cmake tree for files
CMake is pretty poor with the data on which files are contained in a project.
Run a filesystem scan of the project directory to find more files.

Change-Id: I9cc3293a9faf9a967efa5f586c144c3e7773588b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-04 13:31:12 +00:00
Tobias Hunger
36cfa32a86 CMake: Use ServerModeReader to retrieve data
Change-Id: I415dbf7ca79c909eea23ef3dc3a1d87438e9f261
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-31 13:03:27 +00:00
Tobias Hunger
9a980adf3c CMake: Implement different backends to run cmake
Only the original one is implemented so far, but at least
in theory backends for retrieving data from cmake can now
be switched at runtime.

Change-Id: Id73a81c7d40f078be95defd30a38511dca3a3720
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-10-31 10:40:24 +00:00
Tobias Hunger
fe23c71414 CMake: Slim down BuildDirManager's interface
* Make parse() private

Change-Id: I587f72296e4520ed62db06b7d46987907975eb2d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-17 10:09:47 +00:00
Tobias Hunger
9e67dfbe17 CMake: Move more code into BuildDirManager
Continue to concentrate all the code reading random cmake files in
BuildDirManager. Now the task is to clean up the code, make it less
dependent on values it should not depend on (kits, etc.), make it
handle changes better and finally add another implementation that
uses the cmake server mode to extract the data.

Change-Id: I533625e376b969b64287bc205bd2e4be7a605306
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-10 14:45:51 +00:00
Tobias Hunger
b17c98ad6f CMake: Trigger cmake run *before* build when files changed
Make sure to run cmake *before* cmake --build when cmake files just
got saved. This helps e.g. when editing CMakeLists.txt files and the
hitting "Built" and "Save all" (or "Always save before build").

Task-number: QTCREATORBUG-16187
Change-Id: I16b1d02eb342a447003380946ce7a9d785476a0e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-07 08:47:02 +00:00
Tobias Hunger
9b40c1fc04 CMake: Move code from CMakeProject into BuildDirManager
This is in preparation for having support for cmake's server
mode.

Change-Id: I6cc04fe7c5132c491c3f3c0f46560b8ad88808e8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:16 +00:00
Tobias Hunger
4bce0d7c36 CMake: Use generator arguments, not generator
Generator is only part of the picture now that the extraGenerator
is separate. Use CMakeGeneratorKitInformation::generatorArguments
instead, that is always the complete thing.

Change-Id: Ifb6238397e70b36e2dc1b145d3dfad1afa2caa3f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-30 07:26:15 +00:00
Tobias Hunger
703c410085 CMake: Only start parsing when creator gets focus again
Rip out QFileSystemWatcher and use Qt Creators IDocument for file
watching instead. The latter properly delays any action till creator
gets focus again.

Task-number: QTCREATORBUG-16354
Change-Id: Ibb71963416b09712a80ee95347425550453b7fd4
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-28 09:10:02 +00:00
Tobias Hunger
5bc0d12c6d CMake: Check CMakeCache.txt for changes
Check CMakeCache.txt for changes and ask whether to apply these to the
project going forward.

This will only consider settings that were previously changed by Qt Creator
and will not pick up on newly changed settings.

Change-Id: Ia20c67bc2a5e9965243f08003c10ec684875387f
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:18:47 +00:00
Tobias Hunger
5d69bdfde7 CMake: Cache CMakeCache.txt
Change-Id: Ib3e7a9943d15a2e90afd29642b666892ba7b0613
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-23 13:03:20 +00:00
Tobias Hunger
54febaef31 CMake: Use pragma once
Change-Id: I946c819196c5f0f00a13d2f98bae3dff66a43428
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-14 13:23:50 +00:00
Tobias Hunger
38a051b6a4 CMake: Avoid needless cmake runs after kit changes
Do not run cmake if the kit has changed in ways that
do not effect cmake. Do clean rebuilds for changes to the generator
or cmake tool, etc. which do not work without that.

Change-Id: I4e9d43c5161246c3ded7f784cb0d44c3bd4b04e9
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-14 13:23:41 +00:00
Tobias Hunger
99a884051f CMake: Export internal cmake cache values
Those are useful for the cmake internal classes, but need to be filtered
out when they are going to get displayed to the users.

Change-Id: I0bb62fa840fa8cb9e6f3b47300ba85a2b186bad0
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2016-03-14 13:23:38 +00:00
Tobias Hunger
de9eeb233f CMake: Improve method names
I just mixed those methods up, so I'd better improve their names:-)

Change-Id: I38a37df4adb0d0402e2c3d9304c79aa414609976
Reviewed-by: Alexander Drozdov <adrozdoff@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-03-14 13:23:35 +00:00
Tobias Hunger
d122c34c96 CMake: Add ability to force CMake cache clear
Some CMake parameters changes requires to clear cache and run CMake
from scratch. Add ability to force it from the CMake configuration
dialog.

This change based on the work of Alexander Drozdov.

Change-Id: I21d8e12eec7e1f7bca560f44c43f25e4f333fcf0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-10 15:22:55 +00:00
Tobias Hunger
68b99dac2b CMake: Make parsing of CMakeCache.txt files available
Change-Id: I94876851dd4cf737418c4c00b589af1b3a9535ed
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-01 14:26:34 +00:00
Tobias Hunger
420e54281c CMake: Keep cmake state in a temporary directory till first build
This avoids creating lots of build directories as the user types
in something into the builddirectory line of the build settings.

Change-Id: Ib08a0f65e08bce104e4baf9e19fb01730d2f5f08
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 12:17:39 +00:00
Tobias Hunger
76a050cb83 CMake: Move BuildDirManager from the project into the buildconfiguration
Change-Id: I90126ff22dd394eba4145db142b3914d211af476
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 12:17:31 +00:00
Tobias Hunger
a8c2abeaa5 CMake: Register files with the locator again
Change-Id: Ib3a42c22bfac18630b968cfd78744c7827ef7fad
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-15 15:58:57 +00:00
Tobias Hunger
6c382e134b CMake: Handle deletion of builddir better
Change-Id: Ifeb35b14aba05c0e23a027b71f185ba20eed3e55
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:29 +00:00
Tobias Hunger
0d10ce3834 CMake: Disable BC if there is an error during initial cmake run
* Disable the BC and give report the cmake error
* Show a warning label in the BC

Change-Id: If5737d033fa2682c264ab7ac1189c59947e3b28d
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:19 +00:00
Tobias Hunger
28e4306865 CMake: Add UI to display and edit cmake configuration
Change-Id: I95944dcd58dc86023c2757068979f92b8989011b
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:11 +00:00
Tobias Hunger
f71b3652f4 CMake: Read CMakeCache.txt
Read the configuration from CMakeCache.txt files.

Change-Id: I7ddf9c9727420634086c973d0134059aac37ace0
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:57:08 +00:00
Tobias Hunger
fdeef866dd CMake: Report progress during project configuration
Change-Id: Icabc4a417a67984acaad0f14c6521f103621e7ab
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:05:18 +00:00
Tobias Hunger
c1a914197c CMake: Parse cmake errors during project setup
Do warn on errors during initial cmake run.

Change-Id: I520fdb8b83b9228ea71dcce050d1cab4c3e4f81a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:05:03 +00:00
Tobias Hunger
859bf2c5ce CMake: Do not run a cmake wizard all the time
Do not push the cmake running straight into the face of the user. Do it
in the background instead.

This needs some follow-up patches to become really useful.

Change-Id: I3457178b33e3f14bdeac25005a773d17abb73b65
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-15 11:04:45 +00:00