Some time ago the all the wizards for the Plain C++ were coalesced into one wizard.
Since then the wizard asks first for the targets via a targetsetuppage and then
in the CMakeOpenProjectWizard asked for the kit again.
This patch clean thats up, by always using the TargetSetupPage for kit
selection and removing code from the CMakeOpenProjectWizard for kit selection.
It also adds more types of buildconfigurations
Offer: Debug, Release, ReleaseWithDebugInfo, MinSizeRelease with the
corresponding -DCMAKE_BUILD_TYPE parameters. That argument is saved
in the build configuration and used once for the first cmake run. (Subsequent
runs of cmake don't require passing that to cmake again.)
Also do not require running cmake on creating the buildconfiguraiton, instead
postpone that until the buildconfiguration is made active. With the current
cmake wizard, selecting multiple kits would show a dialog per buildconfiguration.
Change-Id: I3bb806113f4f529f8e291830647d2515a6c4df8a
Task-number: QTCREATORBUG-12219
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
At the moment RC factories are ignored when creating
runconfigurations or updating them. This patch changes
the behavior so the RCs are first created/removed and
then updated to match the build targets. This way plugins
can provide custom factories and RCs for cmake projects.
Change-Id: I4a7797e7382784e33ecf016e322eab00e20c07e0
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
The first getCmakeCXXFlags that reads the build.ninja file
stores the contents in the inout parameter cachedBuildNinja.
Further calls to getCMakeCXXFlags just use this cached value.
This prevents excessive locking of this file while constructing
the code model information.
Change-Id: I81e1431194bed6913c69abb2d954068c999a5c1b
Task-number: QTCREATORBUG-14639
Reviewed-by: Tom Tanner
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Instead of just a bool, return a tristate of: Ok, Error and UserAbort.
Also add a out parameter errorMessgge.
Change-Id: Icb076de49998e9372839d0631c2776e905e4a0f6
Task-number: QTCREATORBUG-13223
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
For ninja projects the "build.ninja" file is parsed to extract the cxx
flags for each target. This file is located in the working directory
of the "all" target, however since commit "65c113bc" qtcreator searches
in the build directory of the current target. I have restored the
search behavior to the previous state and added some code to ensure
that the parsed flags really belong to the target
Change-Id: I7cc7f6dbd4f12aec698133206da889037131bb13
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@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>
Don't consider targets that end in _unittest or _automoc. Also don't
read CMakeDirectoryInformation.cmake as that doesn't work with
add_subdirectory.
Change-Id: If06af60e1637e94cccd32d09fc26c6b87488671b
Task-number: QTCREATORBUG-12183
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Export CMakeProject to make it possible for plugins
to inspect the BuildTargets of a cmake project.
Change-Id: Ia7eb94689afefee7789e32ec009579856746787a
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Preparing for exporting the CMakeProject symbol. Removing all APIs
from the header file that will continue to be interal API.
Change-Id: I820ea0efb909e6a75be70ccb3b419f841a15cfb3
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
When trying to find the corresponding source directory for a build directory,
it is better to just read it out of the CMakeDirectoryInformation.cmake file
found in the CMakeFiles subdirectory of the build directory, instead of
guessing it using the relative paths.
Change-Id: Ie96b3255a27f46bcd7f0ab1566dfb91ac52f3be9
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
...instead of going through CppModelManager::projectInfo().
Now CppModelManager::projectInfo() returns an invalid ProjectInfo in
case there is no valid data for the given Project.
Change-Id: I11908bf2ddf865b1d3d71ff176eaf4139292b21c
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
The logic for mapping files to targets is a heuristic, and a pretty bad
one. Add some logging output, which can be enabled by setting the env
variable QT_LOGGING_RULES to
qtc.cmakeprojectmanager.filetargetmapping.debug=true . This will allow
easier debugging of problematic cases.
Change-Id: I17086a30beb8962333109fce9198edde4540d169
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Instead of requiring that the target's source directory is a parent of
all source files, use a distance between the source and directory and
the file. This will find the wrong CMakeLists.txt in more cases but also
is much more likely to lead to using the fallback target.
This makes code completion work for http://github.com/dream3d/dream3d/
Change-Id: Ic035454c5eabe361bc7c46bd943e9a9cdee730e3
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Ignore targets that have no include directories, those are in general
not targets that are very useful.
Change-Id: I1cd1f7dffc73eace2f7a0897bc15dea7e6bc5fee
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
The affected cmake projects have the CMakeLists.txt in a subdirectory
of the project's root. We can't figure out the right project part in
that case. Falling back to the "all" target is wrong though, since
that has not every include path. Instead search for a good target
that has more include paths.
Change-Id: I1a874042fcb9533888a41c001fbf8adc2aa90a39
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This fixes regression 65c113bcbc that caused
files to be likely assigned to "all" target when all CMake targets were having
sources residing in same directory using Ninja generator. As "all" came first
then it became best match in such case.
This introduces slight modification, so target with most include paths is
chosen from these having best file system proximity to source file. Doing so we
select likely real target and get all #include preprocessor directives resolved
properly in the editor.
Change-Id: Ifb85bb5954b4cf5618a6d8444c993c69ebab2259
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Stephen Kelly <steveire@gmail.com>
This can use the faster route through QFileInfo::exist now.
Change-Id: Idb41b5d5185d7f02eacba498fb01f483d95e8d57
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
All static functions, can live closer to related code.
Change-Id: I54c5680256c78f1d09b4bee3e8843b2f4350b75a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Allow multiple expanders to be registered for lineedits, e.g. a
local and the global ones, and actually show them.
Use a tree view in the chooser for somewhat more structured display.
Change-Id: I769f92144e5249f45e54381de52aa6973eb20118
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Replace the CppModelManagerInterface/derived CppModelManager
combo by a more common CppModelManager/CppModelManagerPrivate
pimpl pattern.
Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
So that recalculating the information is not O(n^2) but linear.
Change-Id: I69903e0b5ad321d071804d782ad634a3f300e71a
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
The current approach fails for all build systems where one project file
can define more than one executable.
Change-Id: Ieda413975709fbd6e7ea87b185aa962f63cb7c1f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This is in preparation for changes to the ProjectParts, where one part
can only hold files for 1 language.
Change-Id: I669e4f5b20e6553caad3a9ea2ed0e7c4455a8db7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This was introduced by adding the remote linux support for 3.0 in
328a24edee. If the user cancels the
run cmake dialog, no buildconfiguration is created. The adding of kit
should then not happen. A target without a buildconfiguration should
not happen.
Task-number: QTCREATORBUG-12773
Change-Id: Ic43c5cc13f9e114ea24cc97154a6c084125f6318
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
The only project manager that actually sometimes changes the displayname
is the cmake project manager. And that one failed to emit the right
signal. And since the signal was never emitted a few places handled the
signal wrongly.
Change-Id: I4aa75dc3032efe49263143dbadb7585a378b9be9
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
While we do know all the parts, we don't know to which part each file
belongs. So we guess that based on file system proximity.
Task-number: QTCREATORBUG-12359
Change-Id: I9d2a2ca0171b4e43f4a65d2f4b7b318f4e8b451c
Reviewed-by: Daniel Teske <daniel.teske@digia.com>