summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* Always build tests by default when building standalone testsAlexandru Croitor2019-11-131-0/+4
| | | | | | | | Amends 021c17c62f963a682c6a4b19f0c3d362c28a97ee Change-Id: I8181270ef7506eb5da4d3b43e105e100ed5581e4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> 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>
* Fix qt_skip_warnings_are_errors_when_repo_unclean for executablesAlexandru Croitor2019-11-131-1/+1
| | | | | | | | Amends f00068561287e64c8c664ee1af3feff08b22b669 Change-Id: I48d7a42e11e609fa3a387b7669ee96bd10c856e4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for skipping warnings are errorsAlexandru Croitor2019-11-122-9/+27
| | | | | | | | | | | | | | | | | | | Unfortunately not all repositories are marked as warning_clean in their .qmake.conf files. For instance qtconnectivity and qttools are not warning clean. Therefore we need to skip warnings_are_errors flags on all targets created in that repository. Add support for skipping the warnings are errors flags, by setting a QT_SKIP_WARNINGS_ARE_ERRORS property on a target, and use that within a generator expression with all the accumulated flags. To mimic behavior of qmake, and set the property on all targets created by add_qt_module, add_qt_plugin, etc, one simply needs to set the QT_REPO_NOT_WARNINGS_CLEAN variable in the repo project CMakeLists.txt. Change-Id: Ib5a487af6601ae1519a0988a89f8083f94f92267 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add add_qt_manual_test()Leander Beernaert2019-11-121-0/+34
| | | | | | | | | | | This patch adds add_qt_manual_test() which is a simple wrapper around add_qt_executable() which does not build under ${CMAKE_BUILD_DIR}/bin or install the targets. This could potentially be used later to tag manual tests. Change-Id: Ic4e0a1d133009f5a858b9394347a0996cf42683f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't install QtFooTestsConfig.cmake if no modules were builtAlexandru Croitor2019-11-121-0/+6
| | | | | | | | | | | | | | | When configuring qtx11extras on macOS, we ended up installing the file, which made Coin think that at least one module was built, and thus it tried to build tests as well. Don't install the file if no modules were built, thus preventing from trying to build tests in Coin. Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Change-Id: I920a0b40a6ded12140f251352da53b68eef6560d Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make sure to install QtStandaloneTestsConfig.cmake.inAlexandru Croitor2019-11-121-0/+1
| | | | | | | | | Otherwise leaf modules fail to configure. Amends de3a806def4b9a754825a2233c9d4952a9b2d0eb Change-Id: Ie304c0021ada9911044abdb7e460b8da8e986a8f 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>
* Fix armv7 embedded Linux buildSimon Hausmann2019-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | In gui's CMakeLists.txt we have if (NOT ANDROID) ... add_qt_simd_part(Gui SIMD neon SOURCES ...) ... endif() and later if(UNIX AND NOT ANDROID AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64")) add_qt_simd_part(Gui SIMD neon endif() Since add_qt_simd_part internally uses an OBJECT library to compile the sources with different flags and then link into Gui (in this case), we may end up with an error when add_qt_simd_part is called twice for neon, because the constructed target (Gui_simd_neon) exists already. We can re-use an existing target though, as the SIMD features is the same. Change-Id: I7a21c6e66b47e918a53fa3b1a7db9e053ecc8d87 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix architecture config tests values to be written only onceAlexandru Croitor2019-11-082-6/+7
| | | | | | | | | | | | | | | | Every time the qtbase project was reconfigured, the list of config tests results was appended to a cache variable which was never reset, resulting in multiple copies of the same values being written to QtBuildInternalsExtra.cmake. Make sure to clean the cache variable before appending to it. Also change the variable to be all upper-case, to be consistent with other cache variables. Change-Id: Ic12046730a080595e19377981a726bc330641dc1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for -nomake-tests and -nomake-examples equivalentsAlexandru Croitor2019-11-083-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-085-42/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 handling of _nolink targets for the QtNetwork moduleAlexandru Croitor2019-11-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | When a _nolink target is exported, instead of getting the original namespace prefix, it gets the Qt6 prefix (OpenSSL::OpenSSL_nolink -> Qt6::OpenSSL_nolink). There is some special case code in Network autotests which tries to access the former target name, which doesn't exist when building standalone tests. Make sure to create a Qt6:: library alias for _nolink targets during a build (so before the library is exported), and change the Network autotests project to use this Qt6:: namespaced library, which will ensure it is found both in a standalone tests build and in a regular Qt build. Also make sure to actually call find_package to find the OpenSSL library when building standalone tests, otherwise configuration will fail. Change-Id: I3da5b958e72e745a50380f8ab1644459a7c6b005 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix interface library issues on AndroidAlexandru Croitor2019-11-082-1/+5
| | | | | | | | | | | 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
* Don't add linker scripts to interface librariesAlexandru Croitor2019-11-081-4/+6
| | | | | | | | | It only makes sense for non-interface libraries. Change-Id: I80ac942ed546a6ac866e827aa2026e4e6ac897b2 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Don't query MODULE_PLUGIN_TYPES property on interface librariesAlexandru Croitor2019-11-081-3/+7
| | | | | | | | | | | | | The reason is that interface libraries have to have properties prefixed with INTERFACE_ and more importantly we don't set the property for interface libraries at the moment. Amends d1542e8a73f535011d42970cc5b1b28a414c14c9. Change-Id: I86bf99995278b9086fa0e3815e10d5d54d9ea4dc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Fix Android x86 buildsLeander Beernaert2019-11-081-0/+9
| | | | | | | | | | | | Replace condition x86 to i386 to match other platforms. Regenerate src/gui/CMakeLists.txt Disable SSE4 on android x86 to match qmake. Change-Id: Ic0d330206f2d70a79d72553aa3ff0f91ff58119c Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support for benchmark conversionLeander Beernaert2019-11-043-1/+44
| | | | | | | | | | | | | 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>
* cmake: Fix setting QT_DISABLE_DEPRECATED_BEFOREFrederik Gladhorn2019-10-311-3/+4
| | | | | | | | The last set would override the variable instead of appending to it, thus QT_DISABLE_DEPRECATED_BEFORE was never set. Change-Id: I173b91704a855fcda1f2b86172d318e3953466db Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Distinguish between qt_plugin and regular pluginsLeander Beernaert2019-10-281-0/+4
| | | | | | | | | If we do not encounter the load(qt_plugin) statement in the .pro file but we do see the entry CONFIG+=plugin, treat the target as a regular CMake library instead of treating it as a qt_plugin by default. Change-Id: I67ad5c865a1a5ab691a6b0d86c2db4b686aa04dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Enable running test on AndroidLeander Beernaert2019-10-282-9/+55
| | | | | | | | | This patch converts all add_executable calls when building for Android to a module library and replaces the call to add_test() to use the android testrunner binary. Change-Id: I10ba5919217cdc93cc2cbbb7d13ad9d10fc5ac1a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix declarative testsAlexandru Croitor2019-10-251-3/+0
| | | | | | | | | | | | | | | | | | | e1fd6074935cd0be0df14d89eb0244fcbd1677cf in qtbase removed the qml1 imports enum from qlibraryinfo.cpp, qconfig.cpp, etc. With the recent merge from dev, this was not adjusted in qt_generate_qconfig_cpp, and thus we generated one too many strings in qconfig.cpp, which resulted in QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) returning "imports" instead of "qml" subfolder, thus causing all qml modules not being found. Fix this by removing the extra qconfig.cpp entry, and all other references to the location. Change-Id: I128f667281138e2e0ef0fe1ced4af0405c532fef Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add custom targets to generate Android APKLeander Beernaert2019-10-232-1/+31
| | | | | | | | | | This patch adds two custom targets to generate android apks. The targets are named ${TARGET}_prepare_apk_dir and ${TARGET}_make_apk. The first one insures the binary is copied to the right location and the latter invokes androiddeployqt on the apk directory. Change-Id: I8152cef387b50ec03ee2bfd92b56910a6f22754c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtBuild: Use STRING type for install locationsTobias Hunger2019-10-211-15/+16
| | | | | | | | | | | | | Use STRING type for install locations as we use them relative to the CMAKE_INSTALL_PREFIX. PATH type will get expanded to absolute paths by newer CMake versions, so that breaks our logic. Change-Id: I36be1f0378c4fb07ad8db0051d540f9d243000be Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Write out a module description fileTobias Hunger2019-10-213-0/+32
| | | | | | | | | Write out a file with some JSON data to describe a module. This file contains information on how that module has been built. Change-Id: I8a604692663cbb7b76b96b97124130e30b822e4b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add ALLOW_UNDEFINED_SYMBOLS to add_qt_pluginLeander Beernaert2019-10-211-4/+6
| | | | | | | | Allow plugins to be built with undefined symbols when ALLOW_UNDEFINED_SYMBOLS is specified. Change-Id: I6bc809e3e5257302157bf8484f850d8319674a4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Rename builtin test data resource nameLeander Beernaert2019-10-181-1/+1
| | | | | | | | | | Rename the builtin test data resource name to something more unique as there are name clashes when building tests which also add a resource named 'testdata'. Change-Id: Icc1bbff3134e1dbc6ea4f6a87a1715b936c723cc Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add conversion code for Java codeLeander Beernaert2019-10-181-0/+12
| | | | | | | | | | Add support to pro2cmake to convert java code for android. Add support to override API_LEVEL for the Android sdk jar file. If the sdk is not found, we'll default to the one located by QT_ANDROID_JAR. Change-Id: If0b746dc7f9148ac43e6592a4a4dd23d46bbd4cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Pick the latest available C/C++ standard when compiling QtSimon Hausmann2019-10-172-5/+21
| | | | | | | | | | This maps the behavior of mkspecs/features/qt_common.prf and enables the use of C++17 for example in Android, where the toolchain supports it anyway. Change-Id: I41f4bdb160a3929e2fb78f36efb1ad5f2ad391a5 Reviewed-by: Qt CMake Build Bot Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix C++ standard detectionSimon Hausmann2019-10-171-1/+15
| | | | | | | | | | | We cannot use a generator expression in an if statement, it does not work. Instead, we could inspect the CMAKE_C/CXX_COMPILE_FEATURES list, but unfortunately that's not reliable. For example it detects that ICPC supports C++17 when in fact that depends on the installed libstdc++. Therefore this patch revives our own configure tests. Change-Id: Ic3bc5762fbe81837722523e3881ac16e84628519 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix precompile header usageAlexandru Croitor2019-10-151-1/+1
| | | | | | | | | | | | | | Latest CMake will try to compile the given precompiled headers as C files, due to enabling the C language in the project + also having c files. Make sure to wrap the precompiled headers in a CXX language only generator expression. For details, see https://gitlab.kitware.com/cmake/cmake/issues/19839 Change-Id: Ib3508ad920092455c300b1a566ba6152bab032db Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add QT_RESOURCE_TARGET_DEPENDENCY source file propertyLeander Beernaert2019-10-151-1/+12
| | | | | | | | | | | | | | | | | | | In the plugin test in QtBase we have a scenario where we have target binaries that are inputs to add_qt_resource(). If we do not remove these files from the dependency list for add_custom_command() cmake will fail to generate the build files. If we mark them as generated source files, we'd have to add a special rule to generate them. Furthermore, using $<TARGET_FILE:...> does not work due processing done by add_qt_resource. To bypass this we check whether the property is set and instead of adding the file to the dependency list we add the target referenced in that property. RCC will still work as expected but will fail if the files aren't present. Change-Id: I16855a54f5606d6fe27ab1347ed7ff4f40392c98 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix output property for add_cmake_library()Leander Beernaert2019-10-151-1/+3
| | | | | | | OUTPUT_DIRECTORY by itself is not a valid cmake target property. Change-Id: Ic3a2a81b8b982ad7ccf0551000a157f9a4d3ef22 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove compatibility code for old call sites of qlalr processingSimon Hausmann2019-10-151-8/+0
| | | | | | Change-Id: I48801c336f7546b9366c70d877d20222c16dd4ff Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate files after dev -> wip/cmake mergeAlexandru Croitor2019-10-142-0/+78
| | | | | | | | | | Note the following bigger things that had to be done: Handle GSS library / feature with a new custom find module. Implement rudimentary support for relocatability (does not currently handle extprefix). Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't include header directories that don't existAlexandru Croitor2019-10-141-1/+1
| | | | | | | | | | | | If a module is marked as NO_MODULE_HEADERS, we shouldn't try to include the non-existing include directory which is usually generated by syncqt. Note it seems that NO_SYNC_QT and NO_MODULE_HEADERS seems to converge, so it might make sense to merge them in the future. Change-Id: Iab4e2907ed68776632337b37496b015535da8784 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Always try to find dependencies for pluginsAlexandru Croitor2019-10-141-2/+0
| | | | | | | | | | | | | | | | Generated plugin CMake files should always try to call find_dependency, especially in static builds. pkg_check_modules sets a cache value for foo_FOUND instead of a directory scope foo_FOUND, which means that find_dependency will not be called in another scope, and thus fail to create needed imported targets. Note this makes the code be the same as in ModuleDependencies.cmake.in. Change-Id: I0b58b038afcb72cb27d0b433371bc9cb5e4bfec9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Android build from multi-arch qmake changesLeander Beernaert2019-10-141-2/+2
| | | | | | | | | | Add condition replacements for the android ABIs. Add a replacement for QT_ARCH to ANDROID_ABI, since QT_ARCH is only used with the android build for now. Change-Id: I553d7910546de32236f723ec2e9a05a18da76130 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix handling of OUTPUT_DIRECTORY in add_cmake_libraryLeander Beernaert2019-10-111-2/+7
| | | | | | | | extend_target() does not handle the OUTPUT_DIRECTORY argument, so we must handle it ourselves. Change-Id: I31880a516ae185f3255b2a51f41d61ee6b1d9838 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Minor fix to qt_process_qlalr APISimon Hausmann2019-10-111-1/+9
| | | | | | | | | It's probably best to make it follow the usual calling convention that the associated (consuming) target is the first parameter of the function. So first this change accepts both formats. Change-Id: I1f20706b23d5e819e0eb689eecedb3afb49df3b7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add SKIP_INSTALL to add_qt_plugin()Leander Beernaert2019-10-111-43/+47
| | | | | | | | Provide a SKIP_INSTALL argument to add_qt_plugin for test cases with plugins lacking install information. Change-Id: Iddb3843fab1790d69d64686530a46057a2ff0477 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Create output directory for qmlcachegenJoerg Bornemann2019-10-111-0/+4
| | | | | Change-Id: I395de27bfe0eed46c595ac664b2c7218abbdb28b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add 'add_cmake_library' to QtBuild.cmakeLeander Beernaert2019-10-101-0/+62
| | | | | | | | | | | Add add_cmake_library to allow us to create normal cmake targets using all the information we have collected via the conversion script. This function is only meant for tests. For an example, see tests/auto/corelib/plugin/qpluginloader/lib/lib.pro. Change-Id: I738cb8ac241b8da1a1da3ef957c24dc7a754d43f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add install directory for plugins without typeLeander Beernaert2019-10-101-3/+3
| | | | | | | | | | | | | | | | When we run into a plugin that does not have a type and is not a qml plugin, we try to see if we can find the target installation path and provide INSTALL_DIRECTORY AND ARCHIVE_INSTALL_DIRECTORY to the add_qt_plugin call. We run into this frequently with the unit tests. This patch also changes add_qt_plugin() to use the value provided in INSTALL_DIRECTORY for ARCHIVE_INSTALL_DIRECTORY if no value is provided for the latter. Change-Id: I61278904a4d2d72308079cd362bd085b4e2f540c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix automatic plugin importing in static buildsAlexandru Croitor2019-10-091-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | QtPlugins.cmake.in uses file(GENERATE) and target_sources() to propagate the generated cpp files which contain plugin initialization code to their consuming targets. Unfortunately due to a bug in CMake, if the file is generated in a different scope than the consuming target, the CMake generation step will fail saying that the source file can not be found. See https://gitlab.kitware.com/cmake/cmake/issues/18399 for details. In the case of qtdeclarative, find_package(Qt6) is called at the top level scope (this is when the file gets generated), but the targets are created in subdirectory scopes, and the GENERATED source file property is not propagated across scropes. Circumvent the issue by instead using file(WRITE) and configure_file() which create the file at configure time rather than generate time. This will pollute the current binary directory with some more files, but at least successfully fixes the build. Change-Id: I3ab3b12dcbf6a9d0ab9ee87173e4a1952325b37b Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Match qt_import_plugin API with qt5'sJean-Michaël Celerier2019-10-094-13/+101
| | | | | | | | | | Some work was needed to make the plug-in types, and which plug-ins are available for each type in client code. Change-Id: Ib71feca31069deca3d3f54c8613054f5f8ae410c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Update add_qml_module() to use INSTALL_QML_FILESLeander Beernaert2019-10-081-0/+1
| | | | | | | | | | | Update add_qml_module() to use the new INSTALL_QML_FILES argument from qt6_add_qml_module(). This patch also updates pro2cmake.py to remove the QT_QML_SOURCE_INSTALL property from qml files. Change-Id: I6623b2de76bb55bd6750e48f7d45c53ca536b391 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Update add_qml_module to use DO_NOT_INSTALL_METADATALeander Beernaert2019-10-081-1/+1
| | | | | | | Update to match latest changes to QtDeclarative. Change-Id: Ie455c0418e95c288149b4b1a29b065a8876e8b7e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Add IOBluetooth to list of apple system frameworksOliver Wolff2019-10-011-0/+1
| | | | | | | | The framework is needed for qtconnectivity. Change-Id: I6a502564fb5543ca94ba5ae458a544286e34564c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Enchance qt_find_package with opt-in debug capabilityAlexandru Croitor2019-10-011-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes when writing a qt_find_package and configuring a project, you might get the following error from CMake: CMake Error at QtBuild.cmake (set_property) Attempt to promote imported target "WrapFreetype::WrapFreetype" to global scope (by setting IMPORTED_GLOBAL) which is not built in this directory. This means that another find_package call, found WrapFreetype in another directory scope other than the current one, and thus the found target cat not be made global. Sometimes that implies that the qt_find_package might not be needed if WrapFreeType will always be found via a transitive depdendency. By setting QT_DEBUG_QT_FIND_PACKAGE=1 on the command line, you can make qt_find_package skip all of its behavior if the package was already found and the provided targets were also found. Unfortunately this behavior can not be made the default, because there is no way to find out in what scope the package was found, and if it's legal to make the targets global. At least I haven't found a way to do that yet. Thus the opt-in QT_DEBUG_QT_FIND_PACKAGE is a means to help with debugging such cases. Change-Id: I04242ed0f2fd0a75bc199386d28a1a0bd92da41a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>