summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuildInternals
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Provide script to configure and build one or more testsAlexandru Croitor2020-03-232-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch there were a few ways to build tests - Configure all tests as part of the repo build - Configure all tests as part of the repo build, but don't build tests by default (-DQT_NO_MAKE_TESTS=ON) - Configure all tests as a standalone project in a separate build dir using -QT_BUILD_STANDALONE_TESTS=ON All of the above incur some time overhead due to the necessity of configuring all tests. Sometimes you just want to build ONE test (or a few). To facilitate that use case, a new shell script called bin/qt-cmake-standalone-test(.bat) can now be used to configure and build one or more tests. The script takes one single argument pointing to the desired test project path and configures a generic template project that sets up all the necessary Qt CMake private API, afterwards calling add_subdirectory on the passed in project. Example $ path/to/qt/bin/qt-cmake-standalone-test ./tests/auto/gui/image/qicon or $ path/to/qt/bin/qt-cmake-standalone-test ./tests/auto/gui/image After that, simply run 'ninja && ctest' to build and run the test(s). This is the CMake equivalent of calling qmake on a test .pro file (or on a tests SUBDIRS .pro file) There are 3 details worth mentioning. Due to the add_subdirectory call, the built artifacts will not be in the top-level build dir, but rather in a nested build_dir. The script currently can't handle more than one argument (the path to the project), so you can't pass additional -DFoo=bar arguments. If a test uses a 3rd party library (like Threads::Threads) which was not a public dependency for any of the Qt modules, configuration will fail saying that the target was not found. Perhaps we should consider recording these packages when generating the StandaloneConfig.cmake files. Change-Id: Icde6ecb839341d34f341d9a19402c91196ed5aa0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add global / top-level docs targetsAlexandru Croitor2020-03-181-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously you could use either module-specific or repo-specific 'docs' targets. For example 'ninja html_docs_qtbase' or 'ninja html_docs_Core'. Now there's a global / top-level target called 'docs', so 'ninja docs' works. For super builds it will build the documentation of all configured repositories. For a single repo build, it's equivalent to calling 'ninja docs_repo_name'. Also for consistency, add the "docs_Core" target, which was missing before. So now a 'docs' target exsits for repo names AND targets. New global target names are - docs - prepare_docs - generate_docs - html_docs - qch_docs - install_html_docs_docs - install_qch_docs_docs - install_docs_docs Amends 0095ff4e0659906595d281b37c3b7f89e37250af Change-Id: I686be1e0962e40cbce860e8ac2cabb056b360ac2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix incorrect argument in QtBuildInternalsAndroidAlexandru Croitor2020-03-121-2/+2
| | | | | | | | Uncovered while building qtdeclarative. Change-Id: If1a36f2640a3a5d765e7ca74b0ba1d39ef2a18f0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port most of the configure summary supportAlexandru Croitor2020-03-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Teaches configurejson2cmake about summaries / reports, so things like enabled features, configure sections, notes, etc. Add relevant CMake API for adding summary sections and entries, as well as configure reports. The commands record the passed data, and the data is later evaluated when the summary needs to be printed. This is needed, to ensure that all features are evaluated by the time the summary is printed. Some report and summary entries are not generated if they mention a feature that is explicitly exclduded by configurejson2cmake's feature mapping dictionary. This is to prevent CMake from failing at configure time when trying to evaluate an unknown feature. We should re-enable these in the future. A few custom report types are skipped by configurejson2cmake (like values of qmake CONFIG or buildParts). These will have to be addressed a case-by-case basis if still needed. Change-Id: I95d74ce34734d347681905f15a781f64b5bd5edc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use correct C++ standard flag when building standalone testsAlexandru Croitor2020-02-181-0/+5
| | | | | | | | | | | | | | Before the patch we set the standard flags in two places: - once when building qtbase - and always when including QtSetup (for every repo that is built) This change makes sure to also set the correct standards flag when building standalone tests, because QtSetup is called to early in that case. Change-Id: Iad130b731e9eb9605bb91637364c33fdd49ce3cb Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
* Implement qtbase fixes for superbuildsJean-Michaƫl Celerier2020-01-081-36/+13
| | | | | | Change-Id: I0d3445cf0740e3925fa9342dac4d07892518afe5 Reviewed-by: Qt CMake Build Bot Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Add custom targets for documentationLeander Beernaert2019-12-181-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds custom targets which take care of generating and installing documentation files. Every module has a global set of targets suffixed with the module name in order for them to be unique when we implement super builds. The targets are the same as the list below, but replace ${target} with the module's name. Eg.: docs_qtbase. For every target which has an qt_add_docs() call, we now create the following set of custom targets: * docs_${target} * html_docs_${target} * qch_docs_${target} * prepare_docs_${target} * generate_docs_${target} * install_docs_${target} * install_html_docs_${target} * install_qch_docs_${target} Fixes: QTBUG-75859 Change-Id: Ie84cb9a2dedbe7333d9a84f4d73383442deca477 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't include standalone tests config file if none existsAlexandru Croitor2019-11-131-1/+1
| | | | | | | | | | | Some repos like qtimageformats don't generate a config file for standalone tests because the repo creates no modules. Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Change-Id: Id42338804605a883f975feb5dd81eda5acc6e687 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build test/manual if it contains a CMakeLists.txtLeander Beernaert2019-11-121-0/+3
| | | | | | | Change-Id: Ibada60b0902f9c6a6a7284489a56106e0021a9de Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for -nomake-tests and -nomake-examples equivalentsAlexandru Croitor2019-11-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A developer can pass either -DQT_NO_MAKE_TESTS=ON or -DQT_NO_MAKE_EXAMPLES=ON to exclude tests or examples from being built as part the default make target (when you write just make or ninja). With ninja, tests and examples can be built separately one by one, by typing $ ninja tst_foo or $ ninja example_bar Same can be done with the Makefile generator. $ make tst_foo All tests / examples can be built in one go by typing $ ninja tests/all or $ ninja examples/all With the Makefile generator unfortunately it's not as nice and is most likely an implementation detail, but it can still be done by running something like $ make -f CMakeFiles/Makefile2 tests/all or $ make -f CMakeFiles/Makefile2 examples/all Change-Id: I34f168b3ab41e952a21d3ace5634e25a9f41922e Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make standalone tests build via top level repo projectAlexandru Croitor2019-11-081-39/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously repo/tests/CMakeLists.txt was a standalone project on which CMake could be called. This was useful for Coin to be able to build and package only tests, but was a bit troublesome because that means having to specify the usual boilerplate like minimum CMake version, which packages to find in every tests.pro project. Instead of having a separate standalone project, modify the top level project and associated CMake code to allow passing a special QT_BUILD_STANDALONE_TESTS variable, which causes the top level project to build only tests, and find Qt in the previously installed qt location. This also means that when building a repo, we generate a ${repo_name}TestsConfig.cmake file which does find_package on all the modules that have been built as part of that repo. So that when standalone tests bare built for that repo, the modules are automatically found. qt_set_up_standalone_tests_build() is modified to be a no-op because it is not needed anymore. Its usage should be removed from all the other repos, and then removed from qtbase. Non-adjusted tests/CMakeLists.txt projects in other repositories should still be buildable with the current code, until they are updated to the new format. Adjust the Coin build instructions to build the standalone tests in a separate directory. Adjust pro2cmake to generate new structure for the tests/tests.pro projects. Adjust the qtbase tests project. Fixes: QTBUG-79239 Change-Id: Ib4b66bc772d8876cdcbae1e90ce5a5a5234fa675 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix interface library issues on AndroidAlexandru Croitor2019-11-081-0/+4
| | | | | | | | | | | Don't call qt_android_dependencies for interface libraries. Also make sure not to set properties which don't start with INTERFACE_ prefix. Change-Id: I0afdffd34c9aebe0d7ac4731b57dd4d505f84570 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Add support for benchmark conversionLeander Beernaert2019-11-041-1/+1
| | | | | | | | | | | | | Convert benchmark executables to add_qt_benchmark(). Currently add_qt_benchmark just calls add_qt_executable() and ensures that it they build under CMAKE_CURRENT_BUILD_DIR and do not install. Add QT_BUILD_BENCHMARKS option to enable/disable building of benchmarks. Change-Id: Id0bc676698d21d50048d97d9abef51d92ccb6638 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Include QtPlatformSupport as part of find_package(Qt6BuildInternals)Alexandru Croitor2019-09-271-7/+11
| | | | | | | | | | | This is needed because the ported over requires() clauses from qmake to CMake are executed before qt_repo_build(), which means that all the custom platform variables that we set (like LINUX, APPLE_OSX) need to be available immediately after finding BuildInternals. Change-Id: I7345b69edf72c266508846766e64f42c99862d1d Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Include repo-specific setup filesJoerg Bornemann2019-09-231-0/+10
| | | | | | | | | | | This is useful for providing private CMake API which is not part of QtBase. Also, fix the setup files to be included when building standalone tests. The old ${PROJECT_NAME}Setup.cmake file inclusion will be removed once all usages are adjusted. Prompted-by: Alexandru Croitor <alexandru.croitor@qt.io> Change-Id: I5bc2bca7371660c00b0301e94d025a29b68d6975 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix examples find_package calls to work in prefix buildsAlexandru Croitor2019-09-211-1/+6
| | | | | | | | | | | | | | | | | | | To build examples as part of a non-installed Qt prefix build, not-yet-installed Config files need to be found by find_package() calls inside example projects. Facilitate that by propagating the CMAKE_PREFIX_PATH and QT_EXAMPLES_CMAKE_PREFIX_PATH paths in all relevant find_package() calls where NO_DEFAULT_PATH is used. Also adjust the inclusion of the QtFeature.cmake file to be relative to the qt6 directory, rather than the current list directory. This is needed to successfully find the file when parsing a Config file from a non-installed build directory. Change-Id: I36031279628f1f7741d8f4d7571484a6545227f7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Init uic only if Qt::Widgets is a targetJoerg Bornemann2019-09-201-1/+4
| | | | | | | | | | Otherwise we get errors like the following in non-gui projects: Error evaluating generator expression: $<TARGET_FILE:Qt6::uic> No target "Qt6::uic" Change-Id: I8a3a6f8ec5e5c1c3d1f73369c5739a321c64bfbb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Print build instructions when configuring qtbaseAlexandru Croitor2019-09-171-0/+25
| | | | | | | | This is similar to how we show the instructions when configuring in qmake land. Change-Id: Iabd28acc3d74fd0175eab812a412744dac89e6f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use $$source_path/qtbase/cmake modules when doing non-prefix buildsAlexandru Croitor2019-09-061-3/+14
| | | | | | | | | | | | | | | | | | | This is similar to qmake, where the .prf files from the source location of qtbase/mkspecs are used in a non-prefix build. This means that if a developer changes the source QtBuild.cmake, and then runs make in qtdeclarative, cmake will reconfigure qtdeclarative because the timestamp of QtBuild.cmake changed. Before this change you first had to make && make install in the qtbase build directory, before qtdeclarative saw the modified QtBuild.cmake. This change also makes the module paths be prepended to CMAKE_MODULE_PATH instead of appended, which means they will take precedence to any path provided via command line. Change-Id: I9178d5183a95b3b67bfe1b1fe91d3d3371ffe5c5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Disable Examples in static buildLeander Beernaert2019-09-031-1/+1
| | | | | | | | | Do not build examples in static builds as they are not prepared for this configuration. Change-Id: Ia0fd0a6cdfa3733bf13eb2ca8398668f26c0bedf Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Decide whether to build tools when doing a standalone test buildAlexandru Croitor2019-09-021-0/+1
| | | | | | | | Needed for qtdeclarative standalone tests. Change-Id: Ie012528d0d553cb63c2d79f3ded35e45872ee89a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Update Android build configurationLeander Beernaert2019-08-301-12/+17
| | | | | | | | | | | | | | | | | | Update Android build configuration to be compatible with the multi-arch android build patch to qmake. We can now build and generate the apk correctly. Executing on the device/simulator will only work once the latest changes from 5.14 have been merged in. We now replace target suffix with ${CMAKE_ANDROID_ARCH_ABI}.[so|a] so we don't have to deal with handling targets which might have any of the OUTPUT_NAME properties set. The dependency and deploy settings generation has also been updated to append the file contents to a string and then do a single file write at the end. Change-Id: Id3c5bd0428141ecaf962124a100390e3a4e41feb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add missing qml-root-path for AndroidLeander Beernaert2019-08-281-1/+3
| | | | | | | | | | | | Add missing qml root path variable in the deployment configuration file. Not having this variable will cause androiddeployqt not use the qml dependency scanner to package all relevant dependencies. This patch also fixes QT_ANDROID_BUNDLED_FILES files not being processed. Change-Id: I5bca33cdbb57098f283b38516b777571806da9e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix Android build for other Qt modulesLeander Beernaert2019-08-161-1/+1
| | | | | | | Install missing QtBuildInternalsAndroid to installation path. Change-Id: I6141ff72b57a6445f1718bc17d64a7ed59a91620 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Perform check for tool builds before srcLeander Beernaert2019-08-071-2/+3
| | | | | | | | | | Perform the test whether tools should be built before entering the source directory of a project. In QtDeclarative this would result in a configuration error since the tools are used while building everything under src. Change-Id: I33ce2cb317ef221836d696654f3bb4e39db47e54 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Final changes for APK generationLeander Beernaert2019-06-262-0/+210
| | | | | | | | | | | | | | | | | | | | Generate the ${MODULE}-android-dependencies.xml for the androiddeployqt tool. This will ensure all the right plugins and dependencies are packaged when generating the apk. This change also changes the visibility for executable to default/public. Not having this will cause the application to crash as we can't locate main() in the executable (shared library). Additionally pro2cmake conversion script has been updated to perform the required conversions for the Android settings. Finally, the 6 projects in QtBase that have Android dependencies have been updated with the new script and the step that produces the xml files in run at the end in QtPostProcess.cmake. Change-Id: I9774ba1b123bc11cae972fa37054ef2c51988498 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-141-1/+1
| | | | | | | | | | This changes many different CMake places to mention Qt6 instead of Qt5. Note that some old qt5 cmake config files in corelib are probably not needed anymore, but I still renamed and kept them for now. Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
* Try to find Test package before calling add_subdirectory(src)Alexandru Croitor2019-06-131-1/+7
| | | | | | | | | | | in qt_build_repo(). This is important for qtdeclarative for example, which builds QmlTest functionality in ./src, and thus needs Test lib to be available. Change-Id: I84326d79844526f2f177c19de30bab0c858773e3 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Automatically find apple frameworks when building a repoAlexandru Croitor2019-06-131-0/+3
| | | | | | | | | Instead of doing it just in qtbase/src, we need to do it for all repos before building ./src. Change-Id: I57f226b849cd5370ffbbbea8a694697d400957a4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Fix linking of examplesSimon Hausmann2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Provide add_qt_gui_executable() as function in our public API that takes care of automaticWinMain linkage. We can use this in the future to encapsulate similarplatform-specific behavior and adjustments, such as module generation onAndroid. In order for the examples to see the function in Qt5CoreMacros, three more additional fixes were required: * Do the build_repo_end() call _before_ attempting to build the examples, as we need the build_repo_end() to include QtPostProcess and complete the creation of all the target config files. Otherwise the find_package() calls in the examples see something incomplete. * Add more QT_NO_CREATE_TARGET guards * Always call find_dependency on the dependencies, regardless of the target creation mode. This way a find_package(Qt5 COMPONENTS Widgets) will still load Qt5CoreMacros. Change-Id: I03ce856e2f4312a050fe8043b8331cbe8a6c93e6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change qt_build_repo to build tools if present and neededAlexandru Croitor2019-06-071-0/+6
| | | | | | | | | This is needed for qtdeclarative, to automatically start building the tools if needed. Change-Id: I3cbe129e8bb6fa8572a8e34fd3653b51727cb244 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Standalone Example build when crosscompilingLeander Beernaert2019-06-061-0/+31
| | | | | | | | | | | | | | | | | Added qt_examples_begin() and qt_examples_end() macros to setup the example list so it can be re-used in other projects. When cross-compiling, we also need to set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to BOTH in order for find_package() to work correctly. Removed support for building the whole qtbase/examples folder as a standalone project. Building examples is only supported when building the whole of qtbase (qtbase + examples together) or each individual example is built separately against an installed Qt version. Change-Id: I9d26b94b48b95af230b76ab618becb21d2d45581 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake/ does not necessarily exist in a moduleKevin Funk2019-06-051-4/+6
| | | | | | | E.g. qtsvg does not have a cmake/ folder Change-Id: I216776a4997709222064aa76195a32e7bdb6b080 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Optionally include ${repo}Setup.cmake file in qt_build_repo_beginAlexandru Croitor2019-05-281-0/+3
| | | | | | | | | | This is meant to keep repo specific functions and macros that should not pollute QtSetup.cmake. For example QtDeclarativeSetup.cmake will automatically be included when building qtdeclarative. Change-Id: I4d26cbb1a7ffafb153a888fc918af337000d5e41 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix qt_build_repo to be more robustAlexandru Croitor2019-05-281-5/+4
| | | | | | | | | Check for the existence of CMakeLists.txt files before trying to call add_subdirectory on examples, tests and src folders. Change-Id: I7be76de5f7520c1dd181c610fd1dc2200ac74672 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Allow building the tests directory as a standalone CMake projectAlexandru Croitor2019-05-221-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, Coin builds tests as a separate qmake invocation against an installed Qt. We need to support the same with CMake. Change the tests subdirectory to be a standalone CMake project when CMake does not detect an existing QtTest target while processing the subdirectory. If the target exists, it means we are building the whole repo, if the target does not exist, we need to call find_package to find the installed Qt. Refactor and move around a few things to make standalone tests build successfully: - add a new macro to set up paths to find QtSetup - add a new macro to find all macOS frameworks - add a new macro to set up building tests - add a new macro that actually builds the tests - export the INSTALL_CMAKE_NAMESPACE value into the BuildInternals Config file - export the CMAKE_BUILD_TYPE value, because a test project doesn't have a .git subdir and thus defaults to be built in Release mode, even though qtbase might have been built in Debug, so to avoid the mixing, the propagate the build type - stop overriding INSTALL_CMAKE_NAMESPACE and QT_CMAKE_EXPORT_NAMESPACE inside QtSetup if they are set, because the tests project doesn't specify a major version, and if we override the values, the moc / uic targets don't get the correct major version prefix and configuration fails Change-Id: Ibdb03687302567fe325a15f6d1cb922c76240675 Fixes: QTBUG-75090 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Simplify top-level CMakeLists.txt for modulesSimon Hausmann2019-05-211-0/+20
| | | | | | | | | | Implement some aspects of qt_parts.prf to simplify the top-level CMakeLists.txt for repositories that follow the common qt structure (src, tools, tests, examples). Change-Id: Ia35f4e9207e92c1cf0406353561b0cc52dcb0e59 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Automatically install repo specific cmake find modulesAlexandru Croitor2019-05-201-0/+15
| | | | | | | | | | | | | | Some qt modules need to find 3rd party packages for which there are no Config files. We need to write custom CMake Find modules to find those packages. These find modules need to be installed so that they are used when a user consumes the Qt packages. Automatically include and install these find modules if they exist, as part of qt_build_repo_end(). Change-Id: I14aad35ed2999cac8bdda65ca4aeaf74d04fdb71 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Use the qt_build_repo() macros for building qtbase as wellAlexandru Croitor2019-05-151-0/+40
To implement this, create a new Qt5BuildInternals package. All child Qt modules like qtsvg should use find_package(Qt5BuildInternals) or find_package(Qt5 COMPONENTS BuildInternals) in the their top level CMakeLists.txt. This will make the qt_build_repo() macros available. For qtbase we slightly cheat, and specify a CMAKE_PREFIX_PATH pointing to the source folder that contains the BuildInternals package. For the other modules we actually use a configured and installed package Config file. This change moves variables that used to be written into the QtCore Config file into the BuildInternals package. This way things that are relevant only for building additional Qt modules does not pollute the QtCore package. Task-number: QTBUG-75580 Change-Id: I5479adff2f7903c9c2862d28c05c7f485ce3e4eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>