summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-141-7/+7
| | | | | | | | | | 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
* Revert "cmake: Make CMake superbuilds work"Alexandru Croitor2019-06-141-16/+9
| | | | | | | | | | | | | Builds fail on Windows, due to splitting on ':' on absolute file paths, when handling syncqt injections. Revert for now to get qt6 merge in faster. This reverts commit 7559d508d1993dd90a4939441eaf353d55462ae5. Change-Id: If139a8a1eb4ae7ccc8d7b835b12e83b03176e28b Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot
* cmake: Make CMake superbuilds workKevin Funk2019-06-141-9/+16
| | | | | | | | | | | | In case of a CMake superbuild, the actual install root in a non-prefix build is the top-level build directory (not $TOP_BUILDDIR/qtbase anymore). This is more in line how CMake lays out things by default. Task-number: QTBUG-75582 Change-Id: I4e1744b5c877508fedc33e237eec28cb7436010b Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix the 'Fix static builds' commitAlexandru Croitor2019-06-121-1/+3
| | | | | | | | | | | | The GlobalConfigPrivate target should also be filtered out when registering target dependencies, because there's no standalone Qt5GlobalConfigPrivate.cmake file. Amends fbfa067a304e8aea6ba6719395fd12a05688b6f8. Change-Id: If89732bc2fd004b9644959f71339e22210483d7c Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix static buildsAlexandru Croitor2019-06-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | There were a few issues: - Third party dependency info for plugins was not generated, because the depends and public_depends variables were not fetched. This caused issues when trying to use the qcocoa plugin in a consuming application, because Cups::Cups was not found. - Privately linked libraries in extend_target were not considered when generating dependency info for modules. This caused issues in QtThemeSupport, becauese it could not find Qt::DBus, due to that target only being added as a private library in a conditional scope. - Make sure to handle privately linked internal modules like PlatformModuleInternal to map to the Qt5 package, because there is no standalone package for it. Also remove a TODO comment that says that qt_register_target_dependencies should maybe be called in extend_target. That's already the case. Change-Id: Ie99c52e800cd89e6f82008f1e38f4da5cd602929 Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix linking of examplesSimon Hausmann2019-06-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Prospective Windows build fixSimon Hausmann2019-06-121-6/+0
| | | | | | | | | | | Commit abe12f600b1f626c9d228ad5234c14784e7845f1 moved the _LARGEFILE64_SOURCE define to a central place and commit 449eee2d108589d2b8549d6682c8b5e792e659b8 made it conditional to UNIX (not WIN32). Somehow these two were left over though. Change-Id: I23b08e84db804e9d5a4dde706af501c0918b460e Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Generate deployment-settings.jsonLeander Beernaert2019-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate the android deployment settings json for android apk targets. QtPlatformAndroid is now also deployed as a public build dependency of QtCore. Some minor refactoring has been performed to the naming of variables and functions to better match the public facing apis. Extra settings for the file can be configured using the following target properties: set_target_properties(Core PROPERTIES QT_ANDROID_DEPLOYMENT_DEPENDENCIES "foo;bar" QT_ANDROID_EXTRA_LIBS "foo;bar" QT_ANDROID_EXTRA_PLUGINS "foo;bar" QT_ANDROID_PACKAGE_SOURCE_DIR "/foo/bar/" ) The file is generated using the function qt_android_generate_depoyment_settings(). We need to install the android template files and jar files during the android build as the androiddeployqt tool wont work if parts of it are split between the host install and the android install. Added QT_BUILD_QT variable to check whether we are building Qt from source. Finally, we also force the stdlib to shared via cmake configuration with -DANDROID_STL="c++_shared" Change-Id: I063c47e11749d56ba4c6f02101dbcc09e1b9fe87 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Handle minimal_syncqt as not running syncqt for nowAlexandru Croitor2019-06-071-2/+2
| | | | | | | | This is needed for QmlDevTools in qtdeclarative. Change-Id: I41adec15f292c91192e171b45d1e5d48764c37c4 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* MSVC: Split the warning suppression compile options stringMårten Nordheim2019-06-061-1/+1
| | | | | | | | cl: Command line error D8021 : invalid numeric argument '/wd4530 /wd4577' Change-Id: I222e779870ebacfc6f8a71e90dbf47867a84f72f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Simplify per-module option handlingSimon Hausmann2019-06-061-14/+0
| | | | | | | | Move flags/options that we use for modules from add_module to the new platform module target. Change-Id: I89e414690336dcd37253432fe5116226d1c8dd82 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Collect more known modules when considering private libraries inAlexandru Croitor2019-06-061-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | extend_target. In extend_target(Foo) we go over all the ModulePrivate dependencies to assign them to FooPrivate. To do that we use the QT_KNOWN_MODULES variable. The problem is that the variable gets reset when we build a new repository, so when we build qtdeclarative, QT_KNOWN_MODULES has no entries for Core, Gui, etc, but only Qml, Quick, etc. And yet QmlPrivate has to depend on CorePrivate. Change the module Config.cmake files to append their target name to a global variable called QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE. The global variable gets populated every time find_package(QtFoo) is called. Use the union of QT_KNOWN_MODULES and QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE when considering FooPrivate libraries. Change-Id: Ibd9449744478cea58eb5d9737cc8887b4df92420 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix "make install"Simon Hausmann2019-06-061-2/+4
| | | | | | | | | Don't try to report an installable public module .pri file for internal modules. Change-Id: Ide6a50420e0b5448b141c842df4c891baca4a9d9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Introduce Platform*Internal targetsAlbert Astals Cid2019-06-051-66/+3
| | | | | | | | | | Link to them from add_qt_module/plugin/tool This way we set the warnings_are_errors flags just once and also non-qtbase modules get them Change-Id: I2b65a81694aaebdd7c886249f217c11f79492bad Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Ensure syncqt.pl from source is foundKevin Funk2019-06-051-3/+4
| | | | | | | | ... in superbuilds. PROJECT_SOURCE_DIR points to the wrong directory in that case. Change-Id: Ic0cba254734c4693b418dd8a0d8e77063914a9de Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for private module .pri filesSimon Hausmann2019-06-051-11/+50
| | | | | | | | | Generate a pri file for public and private interfaces, but map CONFIG += internal_module to a cmake option and skip the former if set. Task-number: QTBUG-75666 Change-Id: I3f4baf1277094f4c22149a9e8769734baf9a235f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add WinMain supportCristian Adam2019-06-051-6/+0
| | | | | | | Change-Id: I85c56555bc47dcf348daeb3435c621529aa2d381 Fixes: QTBUG-75195 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Add warnings_are_errors optionAlbert Astals Cid2019-06-051-0/+63
| | | | | | | | | | | | | for modules, plugins and tools only (i.e. no tests nor examples) this mimics the qmake behavior default value is developer_build Comes with some fixes in qmake since it seems in the qmake built it was not having Werror, now does because we built it with add_qt_tool Change-Id: I6f3237f25a6fedefa958644929e90f13837a12df Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Cmake: Disable warnings when building Qt pluginsKai Koehne2019-06-051-5/+0
| | | | | | | | This mirrors what happens for qmake. qt_plugin.prf does not define these, but qt_module.prf does. Change-Id: I742d3c766f6f4bd129fa6ccf85b5a67c6758e819 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Set QT_DEPRECATED_WARNINGS_SINCE also for CMakeKai Koehne2019-06-051-0/+1
| | | | | | | This was added to the qmake build system in 220028d37c3 Change-Id: Ieee8b4d47b8f9716c14c85cf3038f1074ee8c46a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Allow to build examples as standalone projectKevin Funk2019-06-051-1/+1
| | | | | | | | | | | | | | | | Create CMake config files which can be used from the very same CMake project. These CMake config files simply do not create any targets, controlled via the QT_NO_CREATE_TARGETS. This patch also allows to build qtbase.git:examples as a standalone project, against an already-built Qt. Ran this: ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example Task-number: QTBUG-74713 Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix qt_find_package PROVIDED_TARGETS checkCristian Adam2019-06-051-1/+2
| | | | | Change-Id: Ia551dcbca2d881f8bac36158abb0ac60b79f16f0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Replace - with _ in define module namesAlbert Astals Cid2019-06-051-6/+9
| | | | | | | | | Otherwise when compiling qxcb-glx-integration we would get a warning like <command-line>: warning: ISO C++11 requires whitespace after the macro name because -DQT_BUILD_QXCB-GLX-INTEGRATION_LIB is not a valid define name Change-Id: Ie8cef93a47b14d75eaad77893f7182e1514dd616 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: don't add install-time include directories when there are noneJean-Michaël Celerier2019-06-051-6/+17
| | | | | Change-Id: I380218191139fe514ddac598992b1ba27ac33a41 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: build with exceptions disabled by defaultAlbert Astals Cid2019-06-051-4/+33
| | | | | | | | | Only re-enable exceptions for the modules that do CONFIG+=exceptions in qmake Change-Id: I9f19078adbdc1b8fa3d4102fb51a099e7e35522e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix static usage requirements for XcbQpaJean-Michaël Celerier2019-06-051-14/+21
| | | | | | | | | | | | | In particular, Qt targets extended with other qt targets (eg. Qt::VulkanSupport or Qt::LinuxAccessibilitySupport) after the first add_qt_module were not taken into account when generating Depends files. Note that this patch updates the minimum required version to CMake 3.15 Change-Id: I747deedd4d59e385876bc1a834ef9bdb6078911b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: tweak largefile definesAlbert Astals Cid2019-06-051-5/+11
| | | | | | | | | so they are actually set for all the targets and that the code is a bit simpler Change-Id: I2cd253d0a3cec3f482b868f81e852edfa158d3f1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Define _LARGEFILE64_SOURCE _LARGEFILE_SOURCEAlbert Astals Cid2019-06-041-0/+5
| | | | | | | | | when largefile feature is enabled, in qmake world this came from largefile.prf Change-Id: I064da31328ad46157354c7012c7b8397c558cd1d Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Treat Qt plugins as MODULE librariesCristian Adam2019-06-041-1/+1
| | | | | | | | | CMake will complain if you try to use a plugin in target_link_libraries, and it won't produce import libraries on windows, or use .so.number on Linux. Change-Id: I6f0cf8267b3c0e6e5c888703596afe59b3a39141 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Install plugins on WindowsCristian Adam2019-06-041-0/+1
| | | | | | | | The plugin dll files were missing from install_dir/plugins/ Change-Id: I68655faf949e4b8fcab153c6c9b8ee14d3ad8ecc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Android: Use lld as default linker for Qt ModulesLeander Beernaert2019-06-041-0/+6
| | | | | | | | | We can't use the gold linker with the android NDK, which is the default option. Using the gold linker results in linker crashes. QMake builds also disables the gold linker. Change-Id: I73de93150b160b4411715007bc7e40238b96d400 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Install dlls on WindowsCristian Adam2019-06-041-0/+1
| | | | | | | Dlls were missing from the install_dir/bin directory. Change-Id: I0b5ef685b779c91969bbfa877f226be2060f6e56 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix qFindTestData with cmake and ninja generatorSimon Hausmann2019-06-041-1/+4
| | | | | | | | | | | | | | | | | | In order for test lib to locate the file requested via QFINDTESTDATA, it needs the build directory of the test (for example $builddir/tests/auto/foo/bar) and __FILE__ expanding to a path to the source relative to this build directory. With ninja, __FILE__ is a path that is always relative to the top-level build directory, not the per-test case one. Therefore the path resolution in testlib fails. To accommodate this, add_qt_test() now always sets QT_TESTCASE_BUILDDIR as well as the newly introduced QT_TESTCASE_SOURCEDIR, which, as an absolute path, removes the need to use __FILE__. Change-Id: I16c2b0001e38162e6da9fdb1a61f4f8ce634fe46 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* CMake: Allow build with MinGW and Hunter 3rd party packagesCristian Adam2019-06-041-0/+6
| | | | | | | | | | | Hunter has recently added aliased target names that conform with upstream CMake find module target names. Extended the WrapFreetype to work with Hunter's freetype (lowercase) package name. Change-Id: I0e25f342c6930658f07f05d2e6a58cf94d2d168d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: register plug-ins, create dependencies fileJean-Michaël Celerier2019-06-041-34/+124
| | | | | | | | This commit introduces infrastructure work to allow static builds of Qt to handle importing of plug-ins. Change-Id: Ife0ca3ca7276ea8ec96fe0eb6adf934fad7620ec Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add private define _USE_MATH_DEFINES on Windows for every moduleAlexandru Croitor2019-06-041-0/+6
| | | | | | | | | | | It's needed when building QtQml on Windows, otherwise compilation fails. Add it as a private define for every module being built, as it is done in qt_module.prf. Change-Id: I1e322d1da15adea8b3f037a722b3260a552dfb62 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Stop the flood of warnings due to qt_find_package() usageAlexandru Croitor2019-06-031-4/+0
| | | | | | | | | | | | | | The warning used to be a fatal error, until we found out that certain packages might provide optional targets, or provide one target out of a possible set. Until we figure out a better way to deal with that, remove the barrage of warnings while configuring. Change-Id: Iacf93a997a8f87f81167ac7c4cc991212e7fca5d Reviewed-by: Qt CMake Build Bot Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Improve finding of sqlite with vcpkgSimon Hausmann2019-06-031-0/+18
| | | | | | | | | | | | | | | | | | | | We use qt_find_package(SQLite3 PROVIDED_TARGETS SQLite::SQLite3) which intends to find cmake's FindSQLite3.cmake and expects the existence of the corresponding target. However qt_find_package first tries to call find_package in config mode, which does not interact well with vcpkg's sqlite, where sqlite3-config.cmake is provided to support multi-config targets. So that call will appear to succeed, yet the expected targets are not there of course. Therefore this patch adds a sanity check for the target existence and allows for a fallback to the module mode for find_package, in order to find CMake's FindSQLite3.cmake. Change-Id: I660f26c38369c3504df1c590e9d3a51ff1f65c6c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add build type (debug) and static vs dynamic to CONFIG in qconfig.priAlexandru Croitor2019-05-311-1/+14
| | | | | | | | | | Also fix the QT_BUILD_SHARED_LIBS usage. While building qtbase, it is assigned later than the call for qt_generate_global_config_pri_file(), so it used always choose static. Make sure to check for BUILD_SHARED_LIBS as well. Change-Id: I66f03e5adacc89646147fc96154bee8002b2b9cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve qconfig.cpp generationAlexandru Croitor2019-05-311-8/+65
| | | | | | | | | | | | | | | | | | We used to copy a qconfig.cpp.in file verbatim. Add some plumbing to actually compute the strings and their lengths as it is done in qtbase/configure.pri. Also make sure to replace the hardcoded linux mkspec with one that is automatically determined. Of course both the detection of the mkspec, and the hardcoded strings for include, lib, etc. should be fixed in the future. This is a stepping stone to allow building a Qt application using the qmake built by CMake. Change-Id: I2e6754f44b20b09b09d14fd85785d56288e6517b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add architecture and abi to generated qconfig.priSimon Hausmann2019-05-311-1/+3
| | | | | | | Task-number: QTBUG-75666 Change-Id: If2933005038557c2b5041da6bd02c5890ac786ef Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Add basic support for compiling applications with qmakeSimon Hausmann2019-05-311-1/+93
| | | | | | | | | | | | | | | | | * Generate module .pri files * Generate qconfig.pri * Propagate MODULE_CONFIG from the .pro files This enables the basic use-case of simple application builds that for example use the moc. Omitted from the patch is support for private module configurations, prl files (should we do this?) and possibly more hidden gems that need to be implemented to for example support building Qt modules with qmake. Task-number: QTBUG-75666 Change-Id: Icbf0d9ccea4cd683e4c38340b9a2320bf7951d0d Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix Android buildSimon Hausmann2019-05-291-0/+6
| | | | | | | Make sure that we can qplatformdefs.h. Change-Id: I781fe77d1332ab97b8711e25cc819862ccf28fd0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix linker flag detection on AndroidSimon Hausmann2019-05-291-2/+2
| | | | | | | | Since LINUX is not set when targeting Android, we must extend these conditions manually. Change-Id: Ie78167d452e0806bfa64773c1e311a99f4a28f8c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix syncqt call and injected file forwarding and add comments about itAlexandru Croitor2019-05-281-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location of the forwarding headers when not yet installed, depends on whether we do a prefix or non prefix build. In a prefix build the /include folder should be in the current repo build dir. In a non prefix build, it should be under qtbase/include. But the actual generated files to which the forwarding headers point, are always in the current repo build directory. Also syncqt needs to know both the current repo build directory specified by -builddir, and the output directory specified by -outdir. In a prefix build, both are the same. In a non-prefix build, builddir should be the current repo build dir, and outddir should be qtbase's build dir. Also for non-qtbase repo build directories (like declarative), examples need to have the current_repo_build_dir/include directory as an include path, so that framework style includes like #include <QtQml/QQmlEngine> work correctly. Take care of all that, and add a bunch of comments explaining the whole injected / generated headers interaction. Change-Id: I612ad7549ce499c4979ee994e998b558716d45ca Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add some qtdeclarative related functions to QtBuildAlexandru Croitor2019-05-281-0/+49
| | | | | | | | | | QtQml uses QLALR to generate a grammar, but the qmake qlalr feature seems to be a general one, so the corresponding CMake implementations are kept in qtbase for now. Change-Id: Ibe916878b18155ddc5bb08793dd2075ebfa8f282 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Change the default enabled AUTOGEN tools list to contain only mocAlexandru Croitor2019-05-221-36/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch we enabled AUTOMOC, AUTORCC, AUTOUIC for all targets that did not opt out. Aside from being wasteful from a performance point of view, this also caused issues when trying to build qtimageformats which does not depend on Widgets which is the package that exposes uic. To avoid this, enable only AUTOMOC for all targets by default, and UIC and RCC can be opted in via the ENABLE_AUTOGEN_TOOLS option. To facilitate this some refactoring had to be done, like moving some common setup for all autogen tools into a separate call, and making sure that extend_target understands the autogen options, because some ui files are only added conditionally. Also the conversion script has been adapted to output the ENABLE_AUTOGEN_TOOLS option whenever a .pro file contains at least one FORMS += foo assignment. Note that we don't really use AUTORCC while building Qt, so nothing opts into that at the moment. Task-number: QTBUG-75875 Change-Id: I889c4980e9fb1b74ba361abed4044737f8842ea4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Allow building the tests directory as a standalone CMake projectAlexandru Croitor2019-05-221-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Avoid accidental clash with .qrc files that are checked inSimon Hausmann2019-05-211-1/+1
| | | | | | | | Add a prefix for generated .qrc files so for in-source builds we don't end up overwriting htem. Change-Id: I8eef582479eb45d67585f6aab87b288393bbadb5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Propagate QT_CMAKE_EXPORT_NAMESPACE via QtCore packageAlexandru Croitor2019-05-171-0/+10
| | | | | | | | | | | | | | | | QT_CMAKE_EXPORT_NAMESPACE is used by the Qt packages to make features available to the consuming CMake project. The value was moved to the BuildInternals Config file, but that's wrong because consuming applications not including the BuildInternals component would fail to use any other Qt package. Move QT_CMAKE_EXPORT_NAMESPACE to be propagated with QtCore package again. Amends 9542e78525b422159406d8fa63e30dcd0f926411. Change-Id: I9841ac8c2828b00c0111d59e8976c889554e0ce1 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>