summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Disconnect docs installation targets from generation targetsJoerg Bornemann2020-11-062-7/+0
| | | | | | | | | | | | | | | | | "ninja install_docs" should not run the "docs" target, because with the usual workflow ninja docs ninja install_docs the documentation would be built twice. That of course means that "ninja install_docs" will fail if "ninja docs" wasn't run before. Analogous for html_docs, qch_docs, the repository-level and module-level documentation targets. Change-Id: I8ad83602dd393b5afc79a19ab3d395987c889d0d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix top-level documentation install targetsJoerg Bornemann2020-11-062-0/+6
| | | | | | | | | | | | | | | | | | | | | The following targets did not do any actual installation: install_docs, install_html_docs, install_qch_docs, plus their repository-level counterparts. Add the following dependencies: install_html_docs --> install_html_docs_<repo> --> install_html_docs_<module> Analogous for qch. The install_docs target already triggers install_html_docs and install_qch_docs. Analogous for install_docs_<repo>. Fixes: QTBUG-86738 Change-Id: I3468e000e050e2787a859e61d40161f5459cb351 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add version information to Qt plugin DLLsJoerg Bornemann2020-11-061-0/+4
| | | | | | | | | | Tools and library DLLs already have version information embedded. Add the missing _qt_internal_generate_win32_rc_file call for plugins. Fixes: QTBUG-87747 Change-Id: I619948f4066ce229d41e8b93f125751e1d28e26c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Rework INPUT_ variables handlingAlexey Edelev2020-11-061-10/+9
| | | | | | | | | | | | INPUT_ variables enable FEATURE_ variable only in case if valid "true"-like value is assigned from command line. Amends dc43061e9abb15bc07eb236f5344c79d27590812 Fixes: QTBUG-87755 Task-number: QTBUG-88142 Change-Id: I65e85c7548981fdec94366b531f6df6396be71b7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix usage of cache variables in qt.toolchain.cmakeJoerg Bornemann2020-11-052-0/+39
| | | | | | | | | | | | | | | | | | We have some cache variables that are used in our qt.toolchain.cmake toolchain file, for example QT_CHAINLOAD_TOOLCHAIN_FILE. When CMake runs a configure test with try_compile, our toolchain file is included again, but only a restricted set of variables is available. Add the variables that are used in our internal toolchain file to CMAKE_TRY_COMPILE_PLATFORM_VARIABLES. This makes them visible for try_compile calls operating on source files. Also pass the variables via the environment to support try_compile calls that operate on whole projects. Fixes: QTBUG-87873 Change-Id: Iebca9e23686bec5072194b15482e1782b9367a0e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: don't add the same parameter twiceYuhang Zhao2020-11-041-9/+1
| | | | | Change-Id: Ic5001f296b56f1181f5e37718e090f931eca8b50 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add quotes to cmake_args in guess_compiler_from_mkspec functionDavid Skoland2020-11-041-1/+1
| | | | | | | | These were omitted in the original change, which cause cmake builds to fail configuring Change-Id: I37996099aaa0d912ce06b1f06c175cc5cf159e33 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* cmake: Always add -Wno-ignored-attributes for clang targeting windowsMartin Storsjö2020-11-041-6/+7
| | | | | | | | | | | This matches how it is in the qmake mkspec, silencing a lot of warnings - but contrary to when building with qmake, it's only applied when building Qt itself. For external projects built with cmake, the Qt headers are included with -isystem, which silences any warnings from those headers. Change-Id: I1a498d3c2715cb73e647668cb7226ceeffb7ff0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake Build: Enable separate debug info for all target typesCristian Adam2020-11-045-7/+32
| | | | | | | | | | | | | Now all shared libraries and executables will get .debug files on the platforms that support FEATURE_separate_debug_info With the directory property _qt_skip_separate_debug_info certain targets can retain the debug symbols in the binary e.g. lupdate with MinGW 8.1.0 will cause objcopy / strip to fail. Fixes: QTBUG-87015 Change-Id: I03b106e68ef0a42011d1ba641e6f686b2e7b7fb4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Set a warning flag based on the target arch, not build hostMartin Storsjö2020-11-031-1/+1
| | | | | Change-Id: I0b524d52286210b7782dd710467fbc3a742d0c08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add handling of user-defined INPUT_foo cache variablesAlexey Edelev2020-11-032-3/+11
| | | | | | | | | | | | "configure" script translates feature-related parameters to INPUT_ variables instead of FEATURE_. Both INPUT_ and FEATURE_ variables passed to cmake script are equivalent. FEATURE_ has higher priority in case if both are defined. Fixes: QTBUG-87755 Change-Id: If697a0d62ab839877a3196ea74e631582a570dda Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix Windows top-level configure.batJoerg Bornemann2020-11-031-1/+7
| | | | | | | | | We must write config.opt in the same directory we're reading it from. We must not write the -top-level argument to config.opt. This amends commit 2a29426e39. Change-Id: I96da9094579fec29c290411677d6b538878399f4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Bump the minimum required CMake version to build Qt to 3.18Alexandru Croitor2020-11-035-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new function that returns the minimum CMake version required to build Qt. Pass that value to cmake_minimum_required() when building qtbase and its standalone tests. The minimum supported CMake version is read from qtbase/.cmake.conf and its value should be updated when the need arises. It's the main source of truth for all repos. Provide a way to lower the minimum CMake version at configure time by passing a value via QT_FORCE_MIN_CMAKE_VERSION. This is not an officially supported way of building Qt. If the specified version is lower than Qt's supported minimum, show a warning. Nevertheless the option is useful for testing how Qt builds with a different minimum CMake version due to different policies being enabled by default. Issue warnings for CMake versions that are higher than the minimum version but are known to cause issues when building Qt. A counterpart change is needed in qt5 to ensure the minimum CMake version is set at the proper time for top-level builds. Ideally we would use the same 'check the CMake minimum version` code in all our repositories, but that will cause lots of duplication because we can't really find_package() the code and doing something like include(../qtbase/foo.cmake) hardcodes assumptions about repo locations. So for now we don't bump the minimum version in child repo cmake_minimum_required calls (qtsvg, qtdeclarative, etc). Instead we record both the minimum supported version and the computed minimum version (in case a different version was forced) in QtBuildInternalsExtra.cmake. Then we require qtbase's computed min version in qt_build_repo_begin(). This won't set policies as cmake_minimum_required would, but at least it propagates what minimum CMake version should be used for child repos. We might still have to bump the versions in child repos at some point. Task-number: QTBUG-88086 Change-Id: Ida1c0d5d3e0fbb15d2aee9b68abab7a1648774b9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Allow adding linker flags to qmake module prisTor Arne Vestbø2020-11-031-1/+4
| | | | | | | | | | | | | The flags go before the library in the final linker line, as opposed to the dependencies declared in LIBS. This allows us to declare the flags for the entrypoint in the project file of the entrypoint, instead of in a standalone prf. Change-Id: I35c054fe9fdaa6add7cd0e8ba3f7304f975ff80f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow adding extra content to module priTor Arne Vestbø2020-11-021-1/+4
| | | | | | | On the qmake-side we had exports, but they were quoted. Change-Id: I95af4b927079691cab6403fec850f345ba181a00 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Let configure guess the compiler from mkspec argumentJoerg Bornemann2020-11-021-0/+20
| | | | | | | | | | | | The arguments -platform, -xplatform and -device determine the mkspec that's used for the qmake companion files. If the user specifies a mkspec that indicates usage of clang or icc, set the respective CMake variables to use one of those compilers. Fixes: QTBUG-87836 Change-Id: I2b10d819b0eb92a97d7f79672547b1e2d821cf33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Bump the minimum required CMake version to use Qt to 3.14Alexandru Croitor2020-11-021-2/+2
| | | | | | | | | | | | | | | | | At the moment our examples require a minimum of 3.14 due to changes in upstream CMake's Autogen functionatlity to support Qt 6. Anything lower would simply not work with Qt 6. It's not clear yet if we actually want to require 3.14, or something higher. At the very least there were many significant changes to support iOS in CMake 3.15. But for now just bump the version checked by Qt6Config.cmake to be consistent with what's in our examples. Task-number: QTBUG-88086 Change-Id: I119c2ad05a18c357fe7c659b30685af87475fc84 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Improve clang-cl support for Qt6Yuhang Zhao2020-11-023-10/+26
| | | | | | | | | | 1. clang-cl doesn't support "-fno-exceptions", it uses msvc's parameter. 2. some parameters supported by msvc are not supported by clang-cl and they are causing huge warning message flood, don't add them. 3. use correct optimize parameter for clang-cl. Change-Id: Idbadf139127143c5fa6c49068588cb26f47da7a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix compilation error on WindowsYuhang Zhao2020-11-011-1/+1
| | | | | | | | | | | | | | | | When linking static libraries, MSVC's link.exe complains about the unknown parameter "/INCREMENTAL:NO" and output a lot of warning messages about this. This doesn't happen when it's linking exes or dlls. The situation is a lot more worse when we are using clang-cl. clang-cl will print some error message like it can't find a file named "/INCREMENTAL:NO" and just stop compiling. It seems clang-cl treat unknown parameters as input files. Fixes: QTBUG-87875 Change-Id: I37ed29de082b0258e81494db54f275417ab42708 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Cleanup module and plugin define situationAlexandru Croitor2020-10-302-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QT.<module>.DEFINES assignment in pri files needs to take into account the module name when computing the define name. This is the MODULE value that qmake specifies. In CMake that would be the value of CONFIG_MODULE_NAME. Previously the value of the define was computed in qt_internal_module_info() without taking into account the module name. While qt_internal_module_info() ended being used also for plugins and other target types, the defines computed by it were meant to be used only for Qt modules. Thus remove the <result>_define assignment from qt_internal_module_info and move its computation directly into qt_internal_add_module, taking into account the value of CONFIG_MODULE_NAME. The only other use of module_define was in qt_internal_add_plugin but that was merely a long overdue copy-paste error, qmake doesn't propagate QT_FOO_LIB defines for plugins. As result, a define special case in testlib is not needed anymore, because the define is now computed properly. Finally, QT_FOO_LIB should not be used while building the Qt module itself, so instead of using PUBLIC_DEFINES option of qt_internal_extend_target, use target_compile_definitions(INTERFACE) directly. Change-Id: I4d44f7461bac2f0c09aec3e995d02dfe36e00883 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Clean up order of assignments in generated module pri filesAlexandru Croitor2020-10-301-6/+11
| | | | | | | | Makes the diff between Qt 5.15 and 6.0 easier to read, to see what's missing. Change-Id: Idf8aa17b3ab8494f6855c172665423a53ca8a024 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Remove outdated TODO commentsJoerg Bornemann2020-10-301-2/+2
| | | | | | | | We do not have host-specific INSTALL_*DIR variables in the CMake build. It is equivalent to a qmake build with host prefix = prefix. Change-Id: I65731e6038508b6c28e3f2819b624ba19abfc82a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Yield fatal error on malformed INSTALL_MKSPECSJoerg Bornemann2020-10-301-0/+4
| | | | | | | | The value of this variable must be exactly "mkspecs" or end with "/mkspecs". Change-Id: I39f83e9660794dfe23f5fd39fb1084b87ba1f140 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Write INSTALL_MKSPECSDIR to qconfig.cppJoerg Bornemann2020-10-301-1/+7
| | | | | | | | | The value of this variable - whithout the mkspecs part - is what's called the host data dir in Qt5. Fixes: QTBUG-87681 Change-Id: I3dfeed17e8a614476aef4d9c651a141ce62e6551 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix [qt-]configure[-module].bat arguments with backslashesJoerg Bornemann2020-10-301-0/+2
| | | | | | | | We must escape backslashes in CMake code that's to be evaluated and in the arguments we read from config.opt. Change-Id: I65d033c77f71888974983aa3d834acb2fe89f3fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix argument passing for configure.bat / qt-configure-module.batJoerg Bornemann2020-10-302-0/+32
| | | | | | | | | | | | | | | | | Passing arguments with equal signs was broken for configure.bat and qt-configure-module.bat. An argument FOO=BAR was split at = and written as FOO BAR to config.opt, breaking every attempt of assigning CMake variables. We must not iterate over %* in batch files to avoid splitting arguments at equal signs. Instead, pass %* unmodified to a CMake script that writes config.opt. Fixes: QTBUG-88019 Change-Id: I7c743a206961d1ed168f2313f864905f6b345b49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Prepare configure/qt-configure-module for calling more scriptsJoerg Bornemann2020-10-301-6/+5
| | | | | | | | | In a subsequent change we will call another CMake script from qt-configure-module.bat. Write the location of qtbase/cmake into the generated scripts instead of the path to QtProcessConfigureArgs.cmake. Change-Id: Ie333b16d310b215c6e49efa27740c7525453d28f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow lower-case values in feature valuesJoerg Bornemann2020-10-291-4/+6
| | | | | | | | | | | | CMake considers ON/OFF as booly string values regardless of the case. Make the value comparison in QtFeature.cmake case-independent. It's now possible to build Qt with '-DFEATURE_gui=off'. Fixes: QTBUG-87948 Change-Id: I3d948e8219ad9728414803c8c4cd756034073b46 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
* CMake: Fix generation of prl files for non-qtbase modulesAlexandru Croitor2020-10-293-6/+47
| | | | | | | | | | | | | | | | | | | Previously we determined if a library represented by an absolute path is a Qt module by checking if it's located in the build dir of the current repo. That is not sufficient for non-qtbase prefix builds, where a Qt module might link against both a module in the current build dir and in the prefix dir. Detect such cases, and rewrite the absolute paths to relocatable paths (either framework flags or paths starting with $$[QT_INSTALL_LIBS]. This should fix building examples with qmake that use QtQuick. Fixes: QTBUG-87840 Change-Id: Icaf8f1a7c66292c80662fd0d5771a5a1628a9899 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Support installing extra cmake files for toolsKai Koehne2020-10-292-1/+36
| | | | | | | | | | | Add an EXTRA_CMAKE_FILES argument to qt_internal_add_tool() that allows tools to install an additional Macro.cmake file. This is modelled after similar functionality in qt_internal_add_module. Task-number: QTBUG-87870 Change-Id: I80838b8966f1018fdd379b1da877b6bc418de075 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix qdoc builds for non-top-level developer buildsKai Koehne2020-10-281-3/+1
| | | | | | | | Fixes a regression introduced in commit 748b3b9c8971e35 for builds that are both not a QT_SUPERBUILD and not QT_WILL_INSTALL. Change-Id: I52b920176a2696fa6206b89b2b69ae1a7f3fbc25 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* cmake: Allow specifying module 'uses' entriesTor Arne Vestbø2020-10-281-2/+5
| | | | | Change-Id: Iee02654e0f52e36e026b8074e0eacb0ea1804685 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Re-work documentation targetsJoerg Bornemann2020-10-282-30/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The top-level prepare_docs target is supposed to run before the generate_docs target. The repository-level targets like prepare_docs_qtbase now also run before their respective generate targets. To achieve that, several intermediate targets had to be introduced. The dependencies for top-level generate_docs look like this: /--> generate_top_level_docs_Core --\ generate_docs ---> generate_top_level_docs_Gui -----> prepare_docs \--> ... --/ The dependencies for repo-level generate_docs_<repo> look like this: /--> generate_repo_docs_Core generate_docs_qtbase ---> generate_repo_docs_Gui \--> ... generate_repo_docs_Core --\ generate_repo_docs_Gui -----> prepare_docs_qtbase ... --/ Analoguous for qch_docs. And last but not least, the module-level generate_docs_<module> depends on prepare_docs_<module>, just like before. The strangely named top-level install targets have been renamed to install_html_docs, install_qch_docs and install_docs. The html_docs target is now merely an alias for generate_docs. Apart from prepare_docs, the top-level targets do not depend on the repository-level targets anymore. Targets that are just an alias (docs, install_docs, ...) have been re-defined to depend just on the respective top-level targets. Fixes: QTBUG-87758 Change-Id: I24466d3a252d518a30a2064bf876be881c46231f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Avoid -NOTFOUND suffix in module pri configTor Arne Vestbø2020-10-281-2/+4
| | | | | Change-Id: I1407a661c482d918dd143f291ee648bc7b18feef Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Don't limit qt_internal_add_cmake_library to testsTor Arne Vestbø2020-10-281-1/+1
| | | | | Change-Id: I2dbe8075de6704a7a6557b877dc279a4b4cddd54 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Don't add module header for interface libs without headersTor Arne Vestbø2020-10-281-0/+5
| | | | | Change-Id: Ifba869586a65f28d5ff47bb2c01ce638110f493f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Export QT_QPA_DEFAULT_PLATFORM in QtBuildInternalsExtraAlexandru Croitor2020-10-272-0/+13
| | | | | | | | | | | | The value is useful for QPA plugins built in repos other than qtbase, to decide if it should be a default plugin or not. Currently useful for qtwayland. Also export a qmake value assignment when doing static builds, just like src/gui/configure.pri does. Change-Id: I1253f1a7e178b24b16e2615ba20d1e92b0b87b1a Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Do not overrun the list end in qt_remove_argsUlf Hermann2020-10-271-2/+4
| | | | | | | | Otherwise we get error messages from CMake. Change-Id: I374b87e38550062b841b7eacf5fbb6bb5ccbdbde Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: allow using ANDORID_NDK_ROOT for user projectsAssam Boudjelthia2020-10-272-2/+18
| | | | | | | | Allow CMake for Android to use ANDROID_NDK_ROOT to deduce the path for QT_CHAINLOAD_TOOLCHAIN_FILE instead of the user providing it manually. Change-Id: Ida728011d5ca8d5a723d341ea77b173e8f105f8c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Allow target to specify initial module internal configTor Arne Vestbø2020-10-261-1/+3
| | | | | Change-Id: I7312fa19aad84b020015b304b1cd2cd5acc83b81 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Provide a qt-internal-configure-tests scriptAlexandru Croitor2020-10-261-0/+32
| | | | | | | | | | | | | | | | | | This is meant to be called by our CI instructions to build standalone tests of a Qt repository. Currently it just calls qt-cmake with -DQT_BUILD_STANDALONE_TESTS=ON, but it might contain more things in the future. The script also simplifies configuring standalone tests locally, due to not having to remember the name of the magical variable. Change our CI instructions to use the new script. Change-Id: I6bc02b4e94adc9d0d05fecb0fe70a561043271f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix target dependency cycle regarding qpa plugins in qtwaylandAlexandru Croitor2020-10-261-4/+16
| | | | | | | | | | | | | | | | | | | | | | | With the introduction of the new 'default_qpa_plugins' custom target, a target dependency cycle occurred in qtwayland: qtwaylandscanner -> default_qpa_plugins -> a wayland qpa plugin -> WaylandClient -> qtwaylandscanner The issue is twofold: - default_qpa_plugins accidentally depended on non-qpa plugins. - All qpa plugins were enabled by default, including the wayland ones. Fix the default_qpa_plugins target not to depend on regular non-qpa plugins. Also fix qpa plugins not to be enabled by default, but instead only choose one qpa plugin to be the default (via evaluating the DEFAULT_IF) condition. Amends df9c7456d11dfcf74c7399ba0981a3ba3d3f5117 Change-Id: I22cd2c72f6b75be54263fd21097258bd179e3616 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Fix handling of rpaths for tests with CMAKE_STAGING_PREFIXAlexandru Croitor2020-10-261-0/+12
| | | | | | Task-number: QTBUG-86053 Change-Id: I2f368d9dc2d871b67bd6261aadd8ef4c1dd1ae54 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix automatic sysrootification detection for qmakeAlexandru Croitor2020-10-261-10/+16
| | | | | | | | | | | | | | | | | | | | | The way we detected whether SysrootifyPrefix needs to be set was incorrect. We checked if extprefix == prefix => SysrootifyPrefix should be true. But that was previously always the case for a non-prefix build, which means it was not possible to build apps (due to qmake expecting to find include dirs in the sysroot, despite the non-prefix Qt not being installed anywhere into the sysroot). Instead we should do what qmake does. Only set SysrootifyPrefix to true if extprefix was not provided and a sysroot is available. To make it work for iOS and Android, the sysroot detection code had to be moved earlier than the SysrootifyPrefix detection. Task-number: QTBUG-86053 Change-Id: Idcc1260a675fb2ef9ae27fc9dc42a68b30f763b8 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Don't invoke QDoc excessivelyTopi Reinio2020-10-241-16/+2
| | | | | | | | | | | | | | | The html_docs target does not need to call QDoc a third time as both its dependencies already do that. With qmake, html_docs did invoke QDoc if CONFIG did not include 'prepare_docs', but none of the Qt modules used that configuration. We can manage without it for now. Fixes: QTBUG-87751 Change-Id: I45d2d06006c566c431ae41d7f3a06d6b809987f2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Let doc targets depend on doc tools in top-level buildJoerg Bornemann2020-10-234-0/+51
| | | | | | | | | | | | | | | For top-level builds it's desirable to have "ninja generate_docs" build all tools needed to generate the documentation. This is problematic since the doc-generating targets are created before the doc tool targets. Thus, we must defer the dependency connection if the doc tool target is not yet available. This patch adds the functions qt_internal_defer_dependency and qt_internal_add_deferred_dependencies. Change-Id: Ica940b80882e67cb0e0943e95541f7f4d1885948 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix typo in variable nameJoerg Bornemann2020-10-231-3/+2
| | | | | Change-Id: I310ff17c75970482803294bb5f4473bcaebdc151 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix deprecation defines not being set properlyAlexandru Croitor2020-10-233-3/+3
| | | | | | | | | Instead of propagating the deprecation wranings, we compiled all code with -Ddeprecations. Change-Id: I0233ddc85bdbdcb93d366073b2cea5d47bdbe52a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* cmake: Produce internal module pris like qmake doesTor Arne Vestbø2020-10-231-33/+37
| | | | | | | | | | qmake treats internal modules as just the regular module file, but with a _private suffix, as opposed to the current cmake logic, that treats it as the private module file, resulting in missing e.g. the Qt.foo.module entry. Change-Id: Id55ca4c23921656d5abfd1d0fdf6430d4fe120bf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow docs generation without installing in top-level buildsJoerg Bornemann2020-10-231-2/+6
| | | | | | | | | | | | | | This patch allows in top-level prefix builds to build Qt and to generate the documentation without running cmake --install first. For top-level builds we now always use the qdoc binary from the build directory, not the installation directory. We also have to copy the global doc files to the build directory to make them accessible to the generate_docs target. Change-Id: I2251603418fc3df9a21c7f2892789e9ff6c8cc21 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>