summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Update .prev cmake filesAlbert Astals Cid2019-06-053-1/+3
| | | | | Change-Id: I440a3cb0288670424cf20c5d56e641a6741fee91 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Regenerate cocoa qpa pluginAlexandru Croitor2019-06-052-1/+140
| | | | | Change-Id: Ie8838846e758542b3ae18cbda00c0a54cb6c5f49 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Add WrapPCRE2 packageCristian Adam2019-06-056-18/+25
| | | | | | | | 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-059-50/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-052-0/+4
| | | | | | | | | | 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-058-4/+42
| | | | | | | | | 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-0511-28/+97
| | | | | | | | | | | | | 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>
* Fix linkage of QtWidgets on AndroidSimon Hausmann2019-06-051-0/+10
| | | | | | | | On Android, the OpenGL dependency is unfortunately a public dependency in QtGui. Change-Id: I50847891ba55c4646078b02e3aacf14823daf1d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix write_all_source_file_lists type annotationAlexandru Croitor2019-06-051-1/+1
| | | | | Change-Id: I6e22d21562a0923079b90cf9b3e6d15dfe16ff29 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Revert "Map module.gui to if TARGET Qt::Gui in configure.cmake"Alexandru Croitor2019-06-052-10/+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-052-0/+10
| | | | | | | | 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>
* Improve run_pro2cmake.pyAlexandru Croitor2019-06-051-33/+104
| | | | | | | | | | | | | | | | | | Add two new options: If you pass --only-existing, the pro2cmake script will only be executed on .pro files that already have a CMakeLists.txt next to them. This is useful if you modify pro2cmake, and only want to regenerate existing files. If you pass --only-qtbase-main-modules, the script will be executed on the main modules in qtbase/src. This is useful if you want to check if your pro2cmake modification works correctly on the more complicated projects. Change-Id: I5228411a252dbef6d77f01ca742a7b98583c5a75 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Regenerate the main qtbase modulesAlexandru Croitor2019-06-0518-103/+139
| | | | | | | | | | | | | | | There were some changes done in pro2cmake, so regenerate the main qtbase modules to keep everything up to date. Some new whitespace got added. Some special cases were removed (ZLIB). Some opengl code got moved around. Some plugin types were added. And some other minor things. Change-Id: Ie8cba4a9aa6b4b163c39d6cf546ea9e0bfc05c01 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix extra_keys in write_all_source_file_lists to be optionalAlexandru Croitor2019-06-051-3/+6
| | | | | | | | | | | | Initially it was added as a required argument, but not all usages of the function where adjusted, so the script failed. Make it optional. Also change the styling of the argument to be snake cased. Amends 8fea3ec4e77dfebe2e84e10ae0f014d03b9098b3. Change-Id: I568800401bb5af153b7bb5229f134c2f74b87468 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* 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>
* Fix special_case_handler to handle git add prev_CMakeLists.txt betterAlexandru Croitor2019-06-041-2/+26
| | | | | | | | | | | | | | | | | When using run_pro2cmake.py, it spawns multiple instances of pro2cmake.py. If more than 1 of the instances need to git add prev_CMakeLists.txt at the same time, git add might fail due to the acquired index.lock. The cleaner solution would be to use a file lock as a mutex, but that requires an external pypi package. Use a poor man solution of retrying the git add with a time delay for a finite amount of times. Change-Id: I2031f6e29ae499526cb4f1753e4387e7f4fab0ab Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Include the .prev_CMakeLists.txt files for selftestsAlexandru Croitor2019-06-0458-1/+1252
| | | | | | | | | | This will help with future regeneration. Amends 6d1c695b0e32b644d13a088ab3363b6aef75de68 Change-Id: I2454dc36cfc00f7aad72488fb7927d7807978fd8 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Improve special_case_helper.pyAlexandru Croitor2019-06-041-3/+13
| | | | | | | | | | | | | | Make sure to set the author user and email for the temporary git repo, so that the commits succeed on systems that don't have a global git author. Also fix run_process_quiet to print stderr and stdout in case if the execution failed for some reason. Change-Id: I0ddb61730114b3e9c59e2d23480df0ced8d6e772 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* pro2cmake: Add PUBLIC to target_include_directoriesKevin Funk2019-06-041-1/+1
| | | | | Change-Id: Ie4e882a5713022bfaec7182172be69616ff8b91c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: Always add a newline after func callsKevin Funk2019-06-041-1/+1
| | | | | | | | | | | | Fixes the situation where we end up with e.g.: ``` target_link_libraries(... )target_link_libraries(... ) ``` Change-Id: I455563b24850db7f389746385af53cd606343274 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* pro2cmake: A couple more fixes regarding examplesKevin Funk2019-06-041-8/+8
| | | | | | | | | | Changes: - Make sure the footer is passed along to callees - Make sure RESOURCES are part of add_executable(...) for AUTORCC Change-Id: I4546bacd2e41ca8acc1a9351af54d325afb715ab Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@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>
* cmake: Fix tests that need helper binariesAlbert Astals Cid2019-06-044-2/+13
| | | | | | | Compile the binaries where they are expected not in builddir/bin Change-Id: I5c9461424a4b3f9fb7f39f5b9d3cd9b96887cfbc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix testlib/selftestsAlbert Astals Cid2019-06-0457-81/+1758
| | | | | | | | | | Actually build tst_selftest Fix the subdirs of it not to be actually built as tests (so that ctest doesn't pick them up and tries to run them) Change-Id: Id9d069f44241027dbd103884d36551163382b216 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Android: Fix incorrect build config for NetworkLeander Beernaert2019-06-041-8/+1
| | | | | | | | | | Fix build configuration for qdnslookup implementations for android as UNIX is also set when building for Android. We should only have the more specific conditions enabled. Change-Id: Ib891df34e5569a20b03ce270e1eab080325549b9 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix qFindTestData with cmake and ninja generatorSimon Hausmann2019-06-044-8/+31
| | | | | | | | | | | | | | | | | | 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-0412-168/+453
| | | | | | | | 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>
* cmake: Fix xcb buildAlbert Astals Cid2019-06-045-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Need qt_find_package(X11_XCB) in src/gui/configure.cmake since we're using it in the file qt_feature("xcb_xlib" PRIVATE LABEL "XCB Xlib" CONDITION QT_FEATURE_xlib AND X11_XCB_FOUND ) Need qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) in src/plugins/platforms/xcb/CMakeLists.tx since we're using it in the file extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender PUBLIC_LIBRARIES PkgConfig::xrender ) Use capital XRender in pkgconfig to be more consistent on how XRender is called everywhere else Change-Id: I403ead2cc123b08f741c5142f20db88987657ba8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@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>
* Handle a few more condition types in pro2cmakeAlexandru Croitor2019-06-042-0/+64
| | | | | | | | | | | | | | | | qtdeclarative has a few conditions that check the gcc version via variables like QT_GCC_MAJOR_VERSION. To handle that, parse the CMake compiler version using qt_parse_version_string() into separate variables like QT_COMPILER_VERSION_MAJOR, QT_COMPILER_VERSION_MINOR and QT_COMPILER_VERSION_PATCH. We can then map the conditions appropriately. Also, handle isEqual(foo, bar), which is equivalent equals(foo,bar). Change-Id: I74575c733b44f1f42451e00038b3f113fd353915 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QtConfig.cmake.in: Fix typoKevin Funk2019-06-041-1/+1
| | | | | | | | | | This var needs the cmake namespace as prefix. Follow-up commit of c5e2838b642d2a50d951efe7b582d9261d55dfb7 Change-Id: I595306301313b1ff911134776480d28b3194bcf8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* More fixes to conversion script while porting qtdeclarativeAlexandru Croitor2019-06-032-1/+10
| | | | | | | | | | | | | | | | | | | | Hardcode a few cases regarding scopes containing "qtConfig(opengl)". These arew few, and contain regular expressions, to just manually check and replace them. Add a new entry to _qt_library_map for handling QmlModels module. Fix Scope.children property to recursively access the .children property on included scopes (instead of just ._children) so that we get the full list of scopes from included children that include other scopes. This is needed for nested .pri files. Fix mapping of "win*" to WIN32. Change-Id: If949a8051f517683e56cda605733719daadb384a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot
* Generate the c++xx standard features instead of skipping themAlexandru Croitor2019-06-033-8/+42
| | | | | | | | | | | The features are reused in qtdeclarative (and maybe somewhere else too), so they should be present. We can still map the conditions to proper CMake compile feature tests. Change-Id: I4d307d29d4d293cc23ab005b195ea346087c7162 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add some basic instructions for cross-compiling for AndroidSimon Hausmann2019-06-031-0/+15
| | | | | | | Change-Id: I0113a7b1e4e3b4d2fc7f93f9809d08fcaf4715d7 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-06-03161-1921/+2590
|\ | | | | | | Change-Id: Ide5b3408bfefca410323cf26b810b44c06d3a227
| * QGraphicsWidget: overload two margins-setters with actual QMarginsF overloadsMarc Mutz2019-05-274-60/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace manual memory management with unique_ptr and manual re-implementations of QMarginsF with The Real Thing™. The only noticeable difference should be that the checks for 0 now use qFuzzyCompare() (by way of QMarginsF::isNull() and its operator==). [ChangeLog][QtWidgets][QGraphicsWidget] Added QMarginsF overloads of setContentsMargins() and setWindowFrameMargins(). Change-Id: I6b3bb87015fa52fdde245b7528cca4b8f9ce41e1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QTextBrowser: detect and load markdown rather than assuming HTMLShawn Rutledge2019-05-305-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So we add the QTextDocument::ResourceType::MarkdownResource enum value to indicate the type. QMimeDatabase is generally unable to detect markdown by "magic", so we need to use the common file extensions to detect it (the same extensions as declared in the mime database XML). Change-Id: Ib71f03abd535c17e5a8c99bd92d0a6062e972837 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>