summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Remove 3rdparty/kwin/FindFontconfig.cmakeTobias Hunger2019-03-291-50/+0
| | | | | | | The one shipped with cmake is more modern:-) Change-Id: I024769825467734ff1527e91df4cf5dfc38cbe68 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Install test executables into $prefix/tests instead of $prefix/binAlexandru Croitor2019-03-271-0/+2
| | | | | | | | | The install path takes into account the path structure of the source directory, so that not all tests are bunched up into /tests, but rather /tests/auto/foo/bar. Change-Id: I5e32d2e41ae8f095f4eac6654973508efd598df0 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Set QT_STATICPLUGIN for static pluginsTobias Hunger2019-03-271-4/+6
| | | | | Change-Id: I5439935b5db2babd47cdc85647e464fe845279cf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: allow custom plugin output/install directoriesTobias Hunger2019-03-271-11/+32
| | | | | | | | Only require TYPE if no OUTPUT_DIRECTORY, ARCHIVE_INSTALL_DIRECTORY and INSTALL_DIRECTORY is provided. Change-Id: I6db1cfaa576bfa3ee3dc8ecf81db20e3afcd61e2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix AUTOMOC and friends to run only once the tools are builtAlexandru Croitor2019-03-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | While building on macOS, AUTOMOC sometimes hanged indefinitely. The problem was that AUTOMOC was executed for the qmacstyle plugin before moc was actually built. Because of an upstream bug in CMake, AUTOMOC was caught in a deadlock without reporting that spawning the moc process failed. Specifically if a libuv spawn() call failed, the condition variable for a waiting thread was not notified, and the thread kept waiting forever for the process launch to finish. Fix the dependency by setting the AUTOGEN_TARGET_DEPENDS property on all targets that have AUTOGEN tools enabled. This makes sure that moc and friends are built before they are used. Also add some special cases to disable autogen tools on certain targets to break cycles between targets. Fixes: QTBUG-74636 Change-Id: I6e689e63cba1962525f169f332a58498d173c0a6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
* Revert "Fix wrong target in qt_feature_module_begin"Alexandru Croitor2019-03-221-1/+1
| | | | | | | | | | | It broke builds because the qconfig.h file was created in the wrong directory. This reverts commit 25f67fbb073c8bedf26e165f52abacf3e20a6a94. Change-Id: Ia458ef4193a3985a9ba613d82f679b7df5ca0107 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add MSVC specific instruction set compiler flagsAlexandru Croitor2019-03-211-0/+15
| | | | | | | | | This is only a half solution, because some of them need to be set based on the detected MSVC version and Windows kit, similar to how it's done by qmake. Change-Id: Ice13c99d6fe0a033ddfebf9d4be924dcd6b8a36c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix sub-architecture (instruction sets / SIMD) handlingAlexandru Croitor2019-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In qmake there are at least 2 things to know regarding sub-architectures and instruction sets. Which instruction sets does the compiler know to compile for, represented by the various config.tests and features in qtbase/configure.json. And which instructions sets are enabled by the compiler by default, represented by the configure.json "architecture" test and accessed via QT_CPU_FEATURES.$$arch qmake argument. Before this patch there was some mishandling of the above concepts in CMake code. The former can now be checked in CMake with via TEST_subarch_foo and QT_FEATURE_foo (where foo is sse2, etc). The latter can now be checked by TEST_arch_${TEST_architecture_arch}_subarch_foo (where foo is sse2, etc and the main arch is dynamyicall evaluated). The configurejson2cmake script was adjusted to take care of the above changes, and the cmake files were regenerated as well. Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix wrong target in qt_feature_module_beginAlexandru Croitor2019-03-211-1/+1
| | | | | | | Presumably this was a copy paste that was not intended. Change-Id: I09e3bb12b3b3f7af75726d7a952d79814ea9c876 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix internal features to also be evaluatedAlexandru Croitor2019-03-211-3/+10
| | | | | | | | | | | | | This amends 4f1a155909dfcba7353ebe9eee669d65336bd943 and 37b154858f41c0aa32ad124878fae96c39563d39 which caused the regeneration of some json features to be internal. Some of those features were not evaluated any more unless they were referenced in another feature. Make sure to explicitly evaluate all internal features as well. Change-Id: I4367f309585fe29dc89d8a6b793de381956ae51d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Make add_qt_executable link to Qt::Core by defaultTobias Hunger2019-03-201-2/+13
| | | | | | | | | | Make add_qt_executable link to Qt::Core by default. Add a BOOTSTRAP flag to disable this behavior again. Pass BOOTSTRAP on from add_qt_tool to add_qt_executable. Change-Id: I26e7f1e03254122f626b3765cccc0dc4414a4fc0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle INSTALL_DIRECTORY for qt_executablesTobias Hunger2019-03-201-1/+9
| | | | | | | Allow to override the install directory for Qt executables. Change-Id: I9561976eefe9c7b573bb97ddaaa39e30d3b6d9fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix names for generated DBus adaptor/interface filesTobias Hunger2019-03-201-1/+16
| | | | | | | | | Use the same names for DBus adaptor/interface files that are also used by qmake. E.g. io.qt.something.xml will be turned into something_interface.(cpp|h) or something_adaptor.(cpp|h). Change-Id: I799b8aee7addd1fe590e8f3ec078e5325b68d5b1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Treat OUTPUT_DIRECTORY as relative to top level build directoryTobias Hunger2019-03-201-0/+3
| | | | | | | | Treat a relative path in OUTPUT_DIRECTORY as relative to the top level build directory, not to the current build directory. Change-Id: I4d409d1362a8f73d13b93cf5ab98e82e60dd62cb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add windows platform plugin and its requirementsAlexandru Croitor2019-03-181-1/+2
| | | | | | | | | | | | | - executed pro2cmake script on windows qpa plugin - added windowsuiautomation platformsupport project - fixed plugin dlls and lib files to be written to the same path - fixed an issue comErrorString which used implicit casting from QString to char*, but plugins are currently built with QT_NO_CAST_TO_ASCII Task-number: QTBUG-74140 Change-Id: I5db3b6c5264bbd5dfba2998b049fda36eb312c70 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Windows buildAlexandru Croitor2019-03-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | - Fix qmake build - Fix QtNetwork moc-ing, by including the moc files inside the cpp files - Fix sql odbc plugin by including QT_PLUGIN define - Fix Boostrap to link against the Platform target, to get the correct Unicode and WIN64 defines. - Fix vulkan headers to be found - Fix freetype bzip and png unresolved symbols / linker issues when building minimal platform plugin (also need to make sure to use the vcpkg toolchain instead of CMAKE_PREFIX_PATH because then find_package is overridden, which does magic to properly propagate static library dependencies). - Fix qfilesystementry test not to be built without private tests feature (it led to undefined symbols issues). - Make sure to remove QT_NO_CAST_TO_ASCII define when building QtCore, so that the qstringbuilder3 test builds successfully. Task-number: QTBUG-74140 Change-Id: I353d08392b604d55f8e62cdd8696d1e19a3c084a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Do define generation after feature evaluationAlexandru Croitor2019-03-181-18/+40
| | | | | | | | | | | | | | | | | | | Instead of generating defines guarded by feature ifdefs, record the define information (condition, name, value, etc), and generate the final define statement only if the feature condition evaluated to true. This removes the need to generate feature defines (QT_FEATURE_foo) for features that have neither public nor private outputs in the configure.json file. Also note that all qt_feature_definition() calls (which correspond to type:"define" outputs in json files) now generate defines only in the public header, which seems to be consistent with how qmake evaluates json files. Change-Id: I5210b405d5735dd9df5f7a55d1ea9547bb7b1159 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Add QT_CFLAGS_* when building x86simd testsTobias Hunger2019-03-182-7/+7
| | | | | Change-Id: I5caa088d517cb9d3749c3ed8ef88a41552c1d340 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Handle SIMD sourcesTobias Hunger2019-03-181-0/+52
| | | | | Change-Id: Ib445888e769432e8c247ae2d2fb5d8af2d5cd275 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use qt_evaluate_config_expression for feature enable conditionsAlexandru Croitor2019-03-141-2/+4
| | | | | | | | | | | | | | | Certain features like opengles2 can be enabled or disabled based on the conditions that are specified in the ENABLE and DISABLE parameters. Because some of those conditions use STREQUAL with a single quoted argument, we have to use qt_evaluate_config_expression to circumvent the CMake bug regarding single quotes, which is described in the function implementation. Only then will enabling / disabling work correctly. Change-Id: I3b68ef611c985f0d8416fd089055fd862da1e542 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Update README to mention setting the vcpkg toolchainAlexandru Croitor2019-03-111-1/+2
| | | | | Change-Id: Icac2ba956246901e02bb6aa257f81cccf56560e8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix header Depends file generationAlexandru Croitor2019-03-111-0/+1
| | | | | | | | The script used to write incorrect dependency headers due to not clearing the qtdeps variable at each loop step. Change-Id: Icf293be7cea596daa096ab19d390c0bb468a8654 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Improve add_qt_resource functionTobias Hunger2019-03-111-8/+24
| | | | | | | | * Handle BASE to give the directory files will be relative to. * Support lang="foo" for qresource sections. Change-Id: I36087220d03789a97105dc6dd1aca7a25a063d9f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: fix the order of parameters for homebrewLiang Qi2019-03-071-1/+1
| | | | | Change-Id: I7b597a8d6bc81eafb21e5368a29700638c351bdf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update README to specify the minimum version of CMake neededAlexandru Croitor2019-03-071-3/+6
| | | | | Change-Id: I10e594859129bddfa56f078389b2272a0072fda0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Fix moc on macOSMikhail Svetkin2019-03-061-10/+48
| | | | | | | | | moc does not generate moc_defs.h and that's why moc does not understand that he runs on macOS. It happens because cmake can not find Qt version. Change-Id: I34c51ebb69dc1ff782a0f129e114cda819122805 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle gc-sections linker flagsTobias Hunger2019-03-041-11/+21
| | | | | | | Add a function to set gc-sections flags on the linker. Change-Id: I9ac02364836d2aa8de239adb8d3a5d29659a4007 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix usage of linker -no-undefined flag for macOSAlexandru Croitor2019-02-271-6/+15
| | | | | | Change-Id: I41c55871a8db3d860fc20ad17eb9a97b01d62448 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Fix build without double-conversion on macOSMikhail Svetkin2019-02-271-8/+15
| | | | | | Change-Id: I5102e93141eec95044df44884dcf6ecd1b9e8dd0 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Start adding compiler flagsAlbert Astals Cid2019-02-213-0/+10
| | | | | | | | | Only has warnings for now Next to come is the support for developer-build and enabling Werror Change-Id: I8070dc06eb439c2a03007cce975c8147ff7e1582 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* cmake: set a CMAKE_BUILD_TYPE if none was specifiedAlbert Astals Cid2019-02-211-0/+12
| | | | | | | Because the default "empty" CMAKE_BUILD_TYPE is a weird default Change-Id: I5768f67aa85dce4108e421d2f4eacdfb1cb5beb0 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Update FindEGL.cmake from upstreamSimon Hausmann2019-02-201-4/+2
| | | | | | | | Upstream commit 7c64db9568296e1caafcfd7163cea3ab1b1626ae fixed the suffix path checking and thus the build on FreeBSD. Change-Id: I0cceeac0639c2899c617ffd6359098d2154acf5b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for building conveniently with ccacheSimon Hausmann2019-02-191-0/+8
| | | | | | | | | Pass -DQT_USE_CCACHE=ON to enable the use of ccache. This avoids having to set up symlinks, which is useful when cross-compiling against different targets. Change-Id: I023fff105baaa538730997948aa122d2678887ce Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Fix use of uic when cross-compilingSimon Hausmann2019-02-191-0/+16
| | | | | | | | Don't try to build uic but instead import it. This is done centrally now in add_qt_tool. Change-Id: I241fbb924de68549e9c0320e157351bd7b1bf5c3 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Provide some basic instructions for cross-compiling and using CCacheSimon Hausmann2019-02-191-0/+24
| | | | | Change-Id: I8bb90746d0cef2ea61a5494ef358713d732dcfce Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* cmake: Make sure to finddeps of private targetKevin Funk2019-02-141-30/+33
| | | | | | | | | | | Public interface libraries of the private target need to be first looked up via `find_dependency(...)` in the CMake config files as well. This patch is just changing the foreach() loop and defer the package config file generation. Change-Id: Iecaf7f778379b526f12ac6a42e76d714d9349b2c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Make sure QT_SYNCQT is persistedKevin Funk2019-02-141-7/+9
| | | | | | | | Lifetime of the variable is bound to the function body. Use a CACHE variable to escape it (and to speed up future calls to the function). Change-Id: I2d164a1c94e64cc652e65c1eea0522f3d911ad82 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Make sure QtModuleConfig.cmake.in is foundKevin Funk2019-02-141-1/+2
| | | | | | | ... when QtBuild.cmake is being included from another Qt module Change-Id: Ia55e03422cc84a56dd9eac640621e5b2ee9681bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Install all necessary .cmake filesKevin Funk2019-02-141-0/+6
| | | | | | | ... for other modules Change-Id: Iea184036a46816e524de247e1d650ae417de294c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Minor fix in QtModuleConfig.cmake.inKevin Funk2019-02-141-1/+1
| | | | | Change-Id: Ia01e935582b5291fa8ed6bf46866fbb74d41f4b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Also use -Wl,--no-undefined for ClangKevin Funk2019-02-131-2/+2
| | | | | Change-Id: Ida6bf41e496a0e800f1146d15edf192d0635a3c9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace "our" FindEGL.cmake with the ECM versionSimon Hausmann2019-02-132-32/+166
| | | | | | | | The ECM version now also does a compile test, which was the only real "functional" difference. Change-Id: I1d5cd590359feba7c7a38ff374992349d5943070 Reviewed-by: Volker Krause <volker.krause@kdab.com>
* Use rpath by default not only for building but also installed binariesSimon Hausmann2019-02-131-0/+14
| | | | | | | | | This makes it possible to use the binaries out of the box. This is particularly relevant for program binaries that link against QtCore dynamically, when trying to use these binaries during cross-compilation. Change-Id: I7dee93194be3fff5c6e3bbb9e202e4cf5e19b6d0 Reviewed-by: Volker Krause <volker.krause@kdab.com>
* cmake: set WrapOpenGL_FOUND to ONAlbert Astals Cid2019-02-121-0/+2
| | | | | | | | | | | | Otherwise the cmake summary at the end says -- The following packages have not been found: * WrapOpenGL It's OpenGL or GLESv2 that will show there as missing if needed Change-Id: I182f1299b86e1a4e24762d0bad6533c6136cbbcc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use CMakePushCheckStateVolker Krause2019-02-121-3/+3
| | | | | Change-Id: I58d779674363a7f7db4a7ea4ca4a9f4a9e271798 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix build without VulkanSimon Hausmann2019-02-121-2/+2
| | | | | | | | | The syncqt generated headers are optional, i.e. their source may not exist -- so for now make their installation optional (as it seems to have been the case with qmake). Change-Id: Ieaeb3d13a1d8ff1f158b5b1c918750fec48d3bef Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Fix Desktop GL/EGL/GLESv2 linkageSimon Hausmann2019-02-123-0/+88
| | | | | | | | | | | | | | | | This change fixes a few things in one go: * cmake's FindOpenGL cannot be used reliably to detect EGL. So use a custom module for that. * Added a custom module for GLESv2 detection, as cmake's FindOpenGL does not support that. * Map CONFIG += opengl to a WrapOpenGL target, which links against either GLESv2 or libGL - just like mkspecs/features/*/opengl.prf * cmake's FindOpenGL remains in use solely to detect the availability of desktop gl. Change-Id: I9315e5ad1fd88e1b7dc7e920053e98fb51fea7fc Reviewed-by: Volker Krause <volker.krause@kdab.com>
* cmake: update README.mdLiang Qi2019-02-121-0/+10
| | | | | | | Added info for using homebrew on macOS. Change-Id: Ie425793d3de1e72a9342f6c2aaf67a4f85592f3a Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* cmake: Search and enable the sqlite[3] pluginAlbert Astals Cid2019-02-121-16/+18
| | | | | | | | Added to QtFeature.cmake a way to be able to run feature_module begin and end without having an actual module by passing NO_MODULE Change-Id: Ib708bd3878e2591da193d18563c8932cc4b75e7f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix finding syncqt when "cross compiling"Simon Hausmann2019-02-121-0/+2
| | | | | | | | This is not quite the correct design yet, but makes the existing mechanism work first. Change-Id: Idbc6f1380adc955a772eb6e5beb6b3a5f7f686bb Reviewed-by: Kevin Funk <kevin.funk@kdab.com>