summaryrefslogtreecommitdiffstats
path: root/cmake/QtFeature.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Fix internal features to also be evaluatedAlexandru Croitor2019-03-211-3/+10
| | | | | | | | | | | | | This amends 4f1a155909dfcba7353ebe9eee669d65336bd943 and 37b154858f41c0aa32ad124878fae96c39563d39 which caused the regeneration of some json features to be internal. Some of those features were not evaluated any more unless they were referenced in another feature. Make sure to explicitly evaluate all internal features as well. Change-Id: I4367f309585fe29dc89d8a6b793de381956ae51d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Do define generation after feature evaluationAlexandru Croitor2019-03-181-18/+40
| | | | | | | | | | | | | | | | | | | Instead of generating defines guarded by feature ifdefs, record the define information (condition, name, value, etc), and generate the final define statement only if the feature condition evaluated to true. This removes the need to generate feature defines (QT_FEATURE_foo) for features that have neither public nor private outputs in the configure.json file. Also note that all qt_feature_definition() calls (which correspond to type:"define" outputs in json files) now generate defines only in the public header, which seems to be consistent with how qmake evaluates json files. Change-Id: I5210b405d5735dd9df5f7a55d1ea9547bb7b1159 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Add QT_CFLAGS_* when building x86simd testsTobias Hunger2019-03-181-7/+6
| | | | | Change-Id: I5caa088d517cb9d3749c3ed8ef88a41552c1d340 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use qt_evaluate_config_expression for feature enable conditionsAlexandru Croitor2019-03-141-2/+4
| | | | | | | | | | | | | | | Certain features like opengles2 can be enabled or disabled based on the conditions that are specified in the ENABLE and DISABLE parameters. Because some of those conditions use STREQUAL with a single quoted argument, we have to use qt_evaluate_config_expression to circumvent the CMake bug regarding single quotes, which is described in the function implementation. Only then will enabling / disabling work correctly. Change-Id: I3b68ef611c985f0d8416fd089055fd862da1e542 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* cmake: Search and enable the sqlite[3] pluginAlbert Astals Cid2019-02-121-16/+18
| | | | | | | | Added to QtFeature.cmake a way to be able to run feature_module begin and end without having an actual module by passing NO_MODULE Change-Id: Ib708bd3878e2591da193d18563c8932cc4b75e7f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix qt_config_compile_test when cross-compilingSimon Hausmann2019-02-121-4/+18
| | | | | | | | | | | | | | | | | | When we do qt_config_compile_test(egl_x11 LABEL "EGL on X11" LIBRARIES X11::X11 ... ) then check_cxx_source_compiles() aborts if the provided targets do not exist (we map LIBRARIES to CMAKE_REQUIRED_LIBRARIES). However we just want the test to fail. Therefore this patch verifies the presence of the targets. Change-Id: Ibd7c1b50d585339af0ca0de58bc5c9cd64d65d6d Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* cmake: Create Qt5 compat targets in config filesKevin Funk2019-02-121-2/+2
| | | | | | | | For now create targets a la "Qt5::Core" to stay compatible with the current Qt5 naming scheme. The name is controllable via a CMake option. Change-Id: If43c058221949b1900c2093f39ccc9d0f38028f1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: QtFeature: Do not error out when using QtKevin Funk2019-02-111-2/+2
| | | | | | | | ... outside of qtbase.git Change-Id: I1895ef07c881766e2b28839d0422916b6916e10e Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* cmake: QtFeature add debugging aidKevin Funk2019-02-111-1/+1
| | | | | | | Persist the target name in the CMake cache description Change-Id: I124a8b89e5845d12301993b0546c8d5c91b8d8bb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Do not rerun try_compile invocationsKevin Funk2019-02-111-0/+4
| | | | | Change-Id: I5eccf9f810d7ee55a311884bd5cf483f8086bae6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Allow passing libraries to qt_config_compile_testAlbert Astals Cid2019-02-111-2/+5
| | | | | | | | Fixes cxx11_future and ipc_posix tests Change-Id: I0f3a7b1a0452724c07198a87c2fc25344e7451eb Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Store Qt features in CMake CacheTobias Hunger2019-01-171-46/+27
| | | | | | | | | | This is less self-contained than what we have, but significantly speeds up cmake configure/generate runs. This patch also warns when a feature is already defined. Change-Id: I8cab63e208ba98756b47d362a39b462f5ec55e20 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: QtFeature optimizationTobias Hunger2019-01-171-2/+0
| | | | | | | Remove some unnecessary sorting, speeding up cmake by about 10s on my machine Change-Id: Ieafbd16f6dd8cfe6d1af3c739bfe58e8bf724441 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Error out on mis-use of qt_pull_features_into_current_scopeTobias Hunger2019-01-171-1/+4
| | | | | | | Make it a bit harder to mis-use qt_pull_features_into_current_scope. Change-Id: I2a6be28d7c0e6207217cb1908ec22cc757acd01a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Introduce Qt::GlobalConfig to hold the global featuresTobias Hunger2019-01-171-7/+8
| | | | | | | | This simplifies the handling of features a bit as it removes the special code to store two sets of features in Qt::Core. Change-Id: I536d41cfc76a02af054e3cfbad6bda50b1e9e49a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Check for visibility onceTobias Hunger2019-01-161-5/+6
| | | | | Change-Id: I5c729f4509eed16409df5eb048afb7f60c5ca57c Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Remove one unnecessary feature push into parent scopeTobias Hunger2019-01-141-2/+0
| | | | | | | | During qt_feature_begin_module no features are changed, so there is no need to push features. Change-Id: Id7ebcfad373caa284e790b7eb0a178eaa72216e5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CMake: Get rid of useless underscores in QtFeature.cmakeTobias Hunger2018-12-141-102/+101
| | | | | Change-Id: I87eb55ed2ce01ab136dac3e2a587b43bd3f8a98e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix cmake test for featuresTobias Hunger2018-11-221-3/+5
| | | | | | | | | Features are now always defined (to OFF) when they are not emitted. Adapt the test for that. Change-Id: Id5f662f07fea15c22027b9b00d1b53a288b4a0dc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CMake: Simplify Feature handlingTobias Hunger2018-11-051-39/+13
| | | | | | | | Simplify the scope handling of features by providing a function that just pushes all QT_FEATURES into the parent scope. Use it. Change-Id: Ic6552fe495394d73fcec6becf6852745ec2d6d59 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QtFeature: (Re-)evaluate QT_FEATURES based on cached valuesTobias Hunger2018-11-051-5/+42
| | | | | | | | (Re-)evaluate QT_FEATURE_* based on the corresponding cache values named FEATURE_*. Change-Id: I57e76af90221937e45979a6d0c366923983ca7d5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QtFeature: Prefix temporary values with _Tobias Hunger2018-11-051-16/+20
| | | | | | | This gets makes it easier to see the QT_FEATURE_foo variables;-) Change-Id: Ide9354d90eecdb15d6d5cec7c2bfb9cee348fb29 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Store QT_FEATUREs that are not emittedTobias Hunger2018-11-051-16/+18
| | | | | | | | | | | | | Store QT_FEATUREs that are not emitted, but do not show them in the UI. Also separate out the UI (FEATURE_foo) from the internal CMake value (QT_FEATURE_foo). This does break the overriding of settings, but that did not work well before either. This will be fixed in follow-up patches. Remove fallout: xkbcommon_system was now evaluated where it was not before. Remove it as that is always the case now. Change-Id: I2d303827a1cc9afeef93ad73285a2043ddaa9766 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+435
Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>