Commit Graph

3443 Commits

Author SHA1 Message Date
Tobias Hunger
653f60ae33 CMake: De-noise CMakeProject
Change-Id: I9d5df01d0d4699df30c1f01c0cfe7f3da310457a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:39 +00:00
Tobias Hunger
01149ad955 CMake: Remove unnecessary members from CMakeTargets
Change-Id: I6428496f4eab0d42f44525477c716f74714f8824
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:31 +00:00
Tobias Hunger
d41e10a595 CMake: Keep buildTargets private
Nobody needs those, so do not export them.

Change-Id: Ia8866ea2a514855c029974645d9b3f3dbcaa14ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-06 10:03:22 +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
69627e494b Add helper code to generate trees of project nodes
Add helper code to FolderNode that enables the creation of a tree
of File- and FolderNodes from a FolderNode and a list of FileNodes.

Change-Id: Iba4b6a768fc3d0501851f141372e7e34913ba518
Reviewed-by: hjk <hjk@qt.io>
2016-10-05 15:42:47 +00:00
Christian Stenger
d4024642fe CMakeProjectManager: Fix compile with Qt5.6 / gcc 4.8
Broke with b3b6cfb5ef.

Change-Id: I0a105c16168a7b6652b8880c190dad309979ffff
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-04 07:40:09 +00:00
Tobias Hunger
a223e59d85 CMake: Polish cmakelocatorfilter
Change-Id: I02566f27c57c2531c4c6085dc9c703f379a194f1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-30 17:59:21 +00:00
Tobias Hunger
87f7ec4ec9 CMake: Clean up CMakeProject
Some polish for the CMakeProject. Remove unnecessary includes, etc.

Change-Id: I3a73aac79b2177adc613f31865074f778ef21360
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-30 17:59:15 +00:00
Tobias Hunger
01903c8c72 CMake: Switch generator/extraGenerator
Swapped that around in the last commit:-/

Change-Id: I2d31af86aecd8e9e6469c9fd573f4dea809fca2a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 12:34:23 +00:00
Tobias Hunger
bb8cd10a04 CMake: Rename method
Change-Id: I6d30bdd7cf6d290f33601c766049e48c3def393a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-30 10:54:09 +00:00
Tobias Hunger
0b1f6d83c3 CMake: Fix possible crash
Change-Id: Id33b51b8ea2d84a51f328adfed052322634c297e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-30 10:33:01 +00:00
hjk
e9fab5896f CMakeProjectManager: Compile fix for gcc 5.4
Change-Id: I8afc2cb29088ff9296959d870473c09a749d78d7
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 09:31:06 +00:00
Tobias Hunger
ea0643c3ab CMake: Hint at Qt version to be used
Set variables to hint at the Qt version being used.
QT_QMAKE_EXECUTABLE is used to point to qmake (only relevant for Qt4),
and CMAKE_PREFIX_PATH is set to point to the QT_INSTALL_LIBS directory
which should hold a cmake folder with all the information on the
Qt5 version being used.

Update the warnings on the kit based on whether a Qt4 or a Qt5 is used
in the kit.

Change-Id: I77f95febd4c42c15568ebaf3f82bf82464058f61
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Gunnar Roth <gunnar.roth@gmx.net>
2016-09-30 07:28:07 +00:00
Tobias Hunger
de664161a2 CMake: Warn on kits using unsupported cmake versions
Change-Id: I6a3a940280baab78e9f56352008452f694534e76
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 07:27:58 +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
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
e21df69354 CMake: Handle more information on the generator being used in a kit
Change-Id: I5834fdfa04b91beb7a61fa897209391c7fcf7d74
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 07:26:06 +00:00
Tobias Hunger
dbca4488ae CMake: Add a helper method to split a ;-separated list
Add a helper method to split a ;-separated list cmake-style.

Change-Id: I334c31109f442f48a22e91e32b3d810882d6682e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-29 13:36:11 +00:00
Tobias Hunger
2431b7f4a2 CMake: Use final for KitInformation specializations
Change-Id: Ifb2f30f86d1ba1d6ee89db1660d74872c6dcf35c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-27 12:45:49 +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
5478be7676 CMake: Report cmake version
Report cmake version in CMakeTool options page.

Task-number: QTCREATORBUG-16089
Change-Id: I506f87bd7037394dc46e9772305c9f909bcc3548
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-27 08:48:28 +00:00
Florian Apolloner
669d04a686 Massively speed up CMakeProject::buildTree
This is done by updating folders once and not per file.

Task-number: QTCREATORBUG-16930
Change-Id: I6c1959031e7ad774cfd22c7364c88e1d0bd32962
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-23 13:18:42 +00:00
Alessandro Portale
e809594fae Core: Make IOptionsPage::categoryIcon a Utils::Icon
This is necessary for themable + HighDPI icons in the options dialog.

Change-Id: I8e3ff87a24591af40bb76b39cd970443d7678fae
Reviewed-by: hjk <hjk@qt.io>
2016-09-20 12:52:49 +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
b5c3b3159c BuildInfo: Fix operator == to work better with subtypes
Different buildconfigurationfactories will always return different
BuildInfo, as the factories will turn the information into a different
set of objects (even if the information those objects are created from
are identical).

Each factory will always produce the same (sub-)type of BuildInfo, as
they need that information to proceed. So using the factory-address
as a kind of type-identifier is save.

Change-Id: Ia30355c26e045d453c0c2b75da893a4bac38b048
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-15 09:21:26 +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
2e284db28d CMake: Add tooltip to autorun cmake checkbox
Task-number: QTCREATORBUG-16778
Change-Id: I94cdb9058943774007b406e29f5ca52251b5ab59
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-08-29 12:45:09 +00:00
Tobias Hunger
c0d1c0c587 CMake: Make Autorun CMake checkbox translateable
Change-Id: Ia2c5094e08efa8dffc9a7a843a65d825e3e95ff0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-08-29 12:45:05 +00:00
Tobias Hunger
c44e5826e7 CMake: Handle files being in multiple targets when parsing cbp files
Change-Id: Ic85a7318e91e8a10a48c8433f22947fb71071832
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-25 11:35:54 +00:00
Tobias Hunger
53747b76dd CMake: Do not process UtilityType build targets
Those produce no direct artifacts, so there is no need to check those

Change-Id: Ic10720c1f3c3a7b602c45b870bfd39604754ddee
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-25 11:35:46 +00:00
Tobias Hunger
bda9bf6755 CMake: Do not map all unknown build target types to "ExecutableType"
There is UtilityType now, so use that if there is no executable being
generated.

Change-Id: I9e8d512077b8352ec056b49c8db03644482b8fbc
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-25 11:35:37 +00:00
Orgad Shaneh
cb5c03ea41 Cmake: Remove redundant qualification
Confuses lupdate... See QTBUG-55480.

Change-Id: I09061af2052a269fa519fc6521939f234b7292d7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-24 06:27:44 +00:00
hjk
99604c369f Cmake: Compile fix after 59bab5e0
cmakesnippetprovider.cpp:40:23: error: could not convert ‘(const char*)(&
CMakeProjectManager::Constants::CMAKE_SNIPPETS_GROUP_ID)’ from ‘const char*’ to ‘QString’
     return Constants::CMAKE_SNIPPETS_GROUP_ID;

Change-Id: Ica98b3851e4f4165e692a8eb276e040904ecba75
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-08-23 21:46:23 +00:00
Tobias Hunger
05a965f161 Allow for snippets in cmake and qmake project files
Change-Id: I593595ad130b3fc7b86e22dc2c6fc4cf2c8935bf
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-23 12:12:47 +00:00
Tobias Hunger
59bab5e0ac CMake: Add CMakeSnippetProvider
This allows to define snippets for CMakeLists.txt files. They can not
be used yet:-/

Change-Id: Iad68632798ecfe04018d08d284f9b5a8b0e564ee
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-23 12:12:37 +00:00
Tobias Hunger
da29da9bbd CMakeEditor: Code cosmetics
Change-Id: I44dcd6dbe63e45e870efa9438c7c6f26bf2b06b6
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-23 08:50:54 +00:00
Eike Ziller
b43765b3e8 Merge remote-tracking branch 'origin/4.1'
Change-Id: I5cacf96b5be4053d3a32a7c2a78fad463b9600d0
2016-08-17 15:14:57 +02:00
Tobias Hunger
a7cbae1e4d CMake: Make sure top level CMakeLists.txt file is listed exactly once
The toplevel CMakeLists.txt file should always be visible in the project tree,
otherwise there is no way to fix problems that stop creator from reading the
project structure.

Since the cmake configuration may add that file itself, creator needs to
check before adding that file. All other files are taken straight from
cmake, which makes sure they are unique.

See the minimal project attached to QTCREATORBUG-16671 for an example
triggering this issue.

Change-Id: Iff3e307134b023e6955f47657e998a5981b03da0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-17 13:08:45 +00:00
Tobias Hunger
906e81c745 CMake: Delete watched files when closing a project
Fixes a crash when re-opening a cmake project.

Change-Id: I5fc747f19787594964fe55c19e29e944c4a5092d
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-08-17 12:48:03 +00:00
Ulf Hermann
bac2d18405 ProjectExplorer: Resolve any CurrentProject:<foo> in default build path
If ProjectMacroExpander doesn't resolve it we fall back to the generic
ProjectExplorer resolution, which is likely to pick the wrong project.

Task-number: QTCREATORBUG-16724
Change-Id: I201b722c5fe184905f744a1f344ec46941f92ae3
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-15 16:27:50 +00:00
Ulf Hermann
15fbfaf2e9 Move icons to Utils
This way we can use them from libraries, not only from plugins.

Change-Id: Ic35cfd5f04d638d87606bf272b2c00ded1267c1b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-08-05 10:52:53 +00:00
hjk
53415cece1 Utils: Streamline TreeModel API
The LeveledTreeModel case is general enough to cover
the UniformTreeModel case, so merge them and rename to
TreeModel. The former TreeModel is now BaseTreeModel.

BaseTreeModels should not be instantiated directly,
a tree model with non-uniform basic items is available
as TreeModel<>.

Done-with: Eike Ziller <eike.ziller@qt.io>
Change-Id: I64a65617ab68c0cde39cf65f4bc092ef808ee6fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-07-27 08:00:40 +00:00
Leena Miettinen
3a9f242afe CMake: Fix grammar in warnings
Change-Id: Iaadab95ffa102c02fe8de70b11dd1dd5ad224520
Reviewed-by: Aaron Barany <akb825@gmail.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-07-26 06:50:55 +00:00
Orgad Shaneh
1b34f2a4b8 Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia90424d479936a898705c433e5810c77ae088b2c
2016-07-22 15:18:00 +03:00
Aaron Barany
80b229a7ab CMakeKitInformation: Separate C and C++ compilers
Task-number: QTCREATORBUG-16501
Change-Id: I25a40afc39ad80deae6d1708816a2a9e527e9ece
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-07-18 13:18:52 +00:00
Tobias Hunger
94b7c72a8c CMake: Make the editor for cmake varibales in the kit options page wider
Change-Id: I88ed1a915c69af9b4f351a5ef28aff807de2611c
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-18 12:57:11 +00:00