summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Remove redundant installation of QtPlatformAndroid.cmakeSimon Hausmann2019-06-121-8/+0
| | | | | | | | It's already installed right where QtSetup.cmake is installed. Change-Id: Ie88363ae3878cda8f92aa44160333886f64565d8 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: Generate deployment-settings.jsonLeander Beernaert2019-06-126-15/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add appropriate MSVC version check for warnings are errors featureAlexandru Croitor2019-06-111-2/+6
| | | | | | | | | | In qmake land warnings_are_errors is only enabled for specific MSVC versions, ending with MSVC2015. Presumably the warnings have not yet been fixed for newer MSVC versions, so we stick with the same status quo for now. Change-Id: Idc3741d39c888f77ed324a5eb8c654416591785f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't add _LARGEFILE64_SOURCE define on WindowsAlexandru Croitor2019-06-111-2/+3
| | | | | | | | | | | | | | In qmake land, the largefile.prf feature is automatically loaded due to 'largefile' being added to CONFIG via the equivalent feature. The prf file is in the 'unix' subfolder though, which means that qmake doesn't load it on Windows. We need to do the same, otherwise we get build errors due to the define being checked in ZLIB headers, and selecting an invalid code branch on Windows. Change-Id: Ibe9202a639754927262bb8aaa28289934f2e23ef 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>
* 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>
* 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-062-14/+14
| | | | | | | | 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-062-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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 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>
* Android: Move Platform IncludeLeander Beernaert2019-06-062-4/+5
| | | | | | | | | Move the include of the platform from QtPlatformSupport to QtSetup. This no longer causes compile tests to fail since they expect explicit include paths instead of using CMAKE_MODULE_PATH. Change-Id: I9d3bed7845104d84422afb5a976ec14b111d259d Reviewed-by: Simon Hausmann <simon.hausmann@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-053-67/+76
| | | | | | | | | | 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: Generate QtBuildInternalsExtra at conftimeKevin Funk2019-06-052-28/+22
| | | | | | | ... using configure_file. Change-Id: Ibe3522c33e20a86c454b23919547775624f84755 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>
* 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>
* 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>
* Android: SDK SupportLeander Beernaert2019-06-054-1/+51
| | | | | | | | | | | | | | | Enable building androiddeployqt when performing host builds only. Added QtPlatformAndroid.cmake to locate Java and the setup the android SDK platform when building on android. Install the androiddeployqt support files when performing a host build. Added ANDROID_SDK_ROOT configuration variable for specifying the android sdk directory. Generating the deployment-settings.json will be done in another change. Change-Id: I1bf15315af4ed904d2fb1d22b0e8e834df32d6ed 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: Also bump to CMake 3.15 in READMEKai Koehne2019-06-051-1/+1
| | | | | | | Amends fecd9d90daa Change-Id: I5373844515c83d218f840b3277ac2c49f318620e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Disable autotests for non-developer buildsKai Koehne2019-06-051-1/+4
| | | | | | | | | | | Mimic the behavior in the qmake build system, and by default build tests for developer-build, and not build it for a normal build. To do this, we define BUILD_TESTING with the right default before including CTest, which does otherwise define the option itself. Change-Id: Ifa1b1156477919abc1e916ccd9e1e0a74e969ee6 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-056-20/+39
| | | | | | | | | | | | | | | | 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>
* Fix a few of the Wrap modules to protect against double creation ofAlexandru Croitor2019-06-053-0/+21
| | | | | | | targets. This created issues when trying to build standalone examples. Change-Id: Iaaea2b537793ae25fbf3143cc205574446aa4ad1 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* 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: Add WrapPCRE2 packageCristian Adam2019-06-052-13/+20
| | | | | | | | The WrapPCRE2 package handles the PCRE2 packages that have targets, and reuse them. Change-Id: I24b0b51f507703cd8287f845f7e425f62dd2c3d6 Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
* Fix OpenGL vs. GLESv2 linkage, attempt number threeSimon Hausmann2019-06-051-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | We introduced WrapOpenGL to link against either desktop GL or GLESv2 depending on the GL feature in QtGui. This works "fine", with two caveats: (1) find_package(WrapOpenGL) must be called after find_package(Qt5Gui) in order for the feature check in FindWrapOpenGL.cmake to work. That's error prone. (2) More and more places are popping up, in particular examples, where GL linkage is required due to inline functions in Qt that forward to GL functions - such as on Android. This in particular explains the qmake behavior of making the GL linkage (desktop _or_ GLES) a public dependency of QtGui, so only Gui linkage is required. Those two aspects combined are the nail in the coffin of FindWrapOpenGL and it would seem much easier to simply make the Desktop GL vs. GLES decision once in Gui's CMakeLists.txt and let Qt5GuiDependencies.cmake propagate this well. This allows us to get rid of plenty of special cases as well. Change-Id: I3a7e8af49537ce5f215f24470e075a4ae9aeb944 Reviewed-by: Alexandru Croitor <alexandru.croitor@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>
* Map module.gui to if TARGET Qt::Gui in configure.cmakeAlexandru Croitor2019-06-051-0/+2
| | | | | | | | | | Some features check for module / target existence. Adapt conversion script to handle that. Reland after fixing it. Change-Id: If4fb942c2e0d16e76a0b9b767bf478527851b0f7 Reviewed-by: Simon Hausmann <simon.hausmann@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-058-22/+83
| | | | | | | | | | | | | 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>
* Revert "Map module.gui to if TARGET Qt::Gui in configure.cmake"Alexandru Croitor2019-06-051-8/+0
| | | | | | | | | | It breaks some conditions, and then the build fails not finding some private header files in qpa, etc. This reverts commit 35dc8f496dc324a816dc17e80b744bfe864ec261. Change-Id: I1b51eac06fe9186181d3f0a7c78f22da7be534e2 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Map module.gui to if TARGET Qt::Gui in configure.cmakeAlexandru Croitor2019-06-051-0/+8
| | | | | | | | Some features check for module existence. Adapt conversion script and QtBuild feature condition parser to handle that. Change-Id: I063e49a6fe9f8e9cf3aec985fd78ed4430398586 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Install plugin related .cmake.in filesAlexandru Croitor2019-06-041-0/+2
| | | | | | | | | This fixes the build when building qtsvg, qtimageformats, etc. Amends 0900298d466e819dd6d8fd39c0be333dc09af189 Change-Id: Ie732ef6faa99e2ebe7e8da6ee2aa5fc0cf59d3f3 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Fix linking QtGui on AndroidSimon Hausmann2019-06-042-3/+3
| | | | | | | | | | | | | Until we have some convenience in place, it is strictly necessary to set the NDK API level, otherwise the libraries from vcpkg are statically built against a newer libc headers than what we finally link against. This also means that we can remove the manual libc linkage again. Change-Id: If1f2eec4df5ed800ac6b060561edff89236891e9 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* 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>
* Fix build with clang 8.0Simon Hausmann2019-06-041-1/+3
| | | | | | | | | | | | | When qt_parse_version_string tries to parse the compiler version into separate fields, it tries to accommodate for different number of digits separate by dots by checking the length of the list as it is mutated. Unfortunately the length variable is not a live variable, so after removing an entry from the list we must change the length variable manually. Change-Id: Ieaeb091581484e8c723fbb467697f73036e64ec9 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@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-042-1/+14
| | | | | | | | | | | 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>
* Android: Fix linker erros for liblog & libcLeander Beernaert2019-06-041-0/+8
| | | | | | | | | | | | For the android platform library add dependencies on liblog and libc for every Qt target. The libraries are shipped by default in the Android NDK so they will always be present. Change-Id: Ic4a13be32118710b11effabfb16e27bd2d10809f Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: register plug-ins, create dependencies fileJean-Michaël Celerier2019-06-048-162/+424
| | | | | | | | 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>