summaryrefslogtreecommitdiffstats
path: root/cmake/QtPriHelpers.cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Use private headers for internal module priJaeyoon Jung2021-01-201-0/+2
| | | | | | | | | | | | Just like config_module_name is appended by "_private" in the case of internal module pri, replace module_includes with the private one. It fixes the issue where a pro file that uses an internal module pri does not build due to missing paths to private headers. Fixes: QTBUG-89961 Change-Id: Ice16a1e9f709d29454f1ddf5b954673cc06a88bb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
* CMake: Fix QMAKE_LIB_<NAME> variable names in module .pri filesJoerg Bornemann2020-12-031-0/+1
| | | | | | | | | | | | | | | | | | | | QMake libraries that contain dashes are referenced by QMAKE_USE as is, but the corresponding QMAKE_LIB_<NAME> variable must be normalized to contain underscores. Example from the qmake build: ./mkspecs/modules/qt_lib_waylandclient.pri 11:QT.waylandclient.uses = wayland-client xkbcommon wayland-cursor ./mkspecs/modules/qt_lib_waylandclient_private.pri 12:QMAKE_DEPENDS_WAYLAND_CURSOR_CC = WAYLAND_CLIENT 13:QMAKE_DEPENDS_WAYLAND_CURSOR_LD = WAYLAND_CLIENT 15:QMAKE_LIBS_WAYLAND_CURSOR = -lwayland-cursor Pick-to: 6.0 Change-Id: If31bd45764d52f97d80d6388503008dc1ffb16ab Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fill QT.<module-name>.uses entries in module .pri filesJoerg Bornemann2020-11-301-5/+30
| | | | | | | | | | | | | | | | Those entries were always empty. The INTERFACE_QT_MODULE_USES property was never set. Map each public dependency to its qmake lib name and place this value into the module's QT.<module-name>.uses variable. Take into account the "_nolink" target modifier and translate it to qmake's "/nolink". Pick-to: 6.0 Fixes: QTBUG-88951 Change-Id: Ib6ef65b842a1fe1da3ade55867583343b4ee76ee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Rename internal variableJoerg Bornemann2020-11-301-1/+1
| | | | | | | | | | | Rename QT_QMAKE_LIB_TARGETS_foo to QT_TARGETS_OF_QMAKE_LIB_foo, because we want to introduce the counterpart QT_QMAKE_LIB_OF_TARGET_bar in a subsequent commit. Pick-to: 6.0 Task-number: QTBUG-88951 Change-Id: I33f00f4fe65c5977da6e74c632ebeab3b891c89a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Name QT_NO_MAKE_*/BUILD_* variables consistentlyJoerg Bornemann2020-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For consistency, apply the following renamings: QT_NO_MAKE_EXAMPLES -> QT_BUILD_EXAMPLES_BY_DEFAULT QT_NO_MAKE_TESTS -> QT_BUILD_TESTS_BY_DEFAULT QT_NO_MAKE_TOOLS -> QT_BUILD_TOOLS_BY_DEFAULT BUILD_EXAMPLES -> QT_BUILD_EXAMPLES BUILD_TESTING -> QT_BUILD_TESTS This should help to better convey the difference between "BUILD" and "NO_MAKE". To configure tests, but not to build them by default, pass the following to CMake: -DQT_BUILD_TESTS=ON -DQT_BUILD_TESTS_BY_DEFAULT=OFF Analoguous for examples: -DQT_BUILD_EXAMPLES=ON -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF Tools can be excluded from the default build with: -DBUILD_TOOLS_BY_DEFAULT=OFF The variable BUILD_TESTING is still available and initialized with the value of QT_BUILD_TESTS. Pick-to: 6.0 6.0.0 Change-Id: Ie5f29dfbdca8bfa8d687981dfe8c19c0397ca080 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate less pri files and mark header modules as no_linkCristian Adam2020-11-201-0/+3
| | | | | | | | | | | Plugins will no longer get .pri files generated in non-static builds. Header modules are now marked in the .pri files as CONFIG += no_link. Pick-to: 6.0 6.0.0 Fixes: QTBUG-88221 Change-Id: I06e31fa970ad021261c43ca3acd88055cc4c9555 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't add module pri library entry for header modulesTor Arne Vestbø2020-11-091-1/+7
| | | | | | | | The QT.foo.module entry is used for linkage, so we shouldn't add it for header only modules. Change-Id: Ibb6e7ab08083ccab11d7e060f35c54153e3751c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Allow module to specify initial dependsTor Arne Vestbø2020-11-091-1/+4
| | | | | Change-Id: I85f39f16f2103dcb42ff467bbc79a0baf6c020e1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Private module pri files should have internal_moduleAlexandru Croitor2020-11-071-0/+4
| | | | | | Change-Id: I35b4111e4044ae6283eb8175173453db9001c71b 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: 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: Allow specifying module 'uses' entriesTor Arne Vestbø2020-10-281-2/+5
| | | | | Change-Id: Iee02654e0f52e36e026b8074e0eacb0ea1804685 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: Export QT_QPA_DEFAULT_PLATFORM in QtBuildInternalsExtraAlexandru Croitor2020-10-271-0/+5
| | | | | | | | | | | | 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: 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: 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: Respect NO_PRIVATE_MODULE when generating module pri filesTor Arne Vestbø2020-10-231-49/+52
| | | | | Change-Id: Id5816d6598a0a484c20674f34f6f809e68671e6b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Don't add include paths to module pri if there are no headersTor Arne Vestbø2020-10-231-0/+6
| | | | | Change-Id: I8fa01f45410805399a511a87c6f04192ce42d374 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix logic for adding staticlib to module priTor Arne Vestbø2020-10-161-4/+3
| | | | | Change-Id: I2426e78bb509a37e7e3924506903cd84732f88d8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add missing Android values in qdevice.priAlexandru Croitor2020-10-071-0/+7
| | | | | | | | | | | These were introduced in 675805e9eb0dc68a6e96622353073fd54161bdaf and b9c85d6b0e274bf0a6287cd56d9e3d7376b0d004 They should be exported if they were set. Change-Id: Ieec565980ba148f675f84dcdd7c19894e349085f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Export the chosen iOS SDK used when configuring QtAlexandru Croitor2020-10-071-0/+4
| | | | | | | | | | | | | The value is used by mkspecs/features/mac/default_post.prf and ultimately by xcodebuild to decide which arch and SDK to build against. For a simulator_and_device build, no value needs to be set as far as I can see. Task-number: QTBUG-87218 Change-Id: I41992bec6b16aadfd87c3f7c10653a6094e76d3e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake Build: Add support for -qtlibinfix configure parameterCristian Adam2020-09-231-2/+5
| | | | | | | | | Rename all libQt6*.so to libQt6*<infix>.so Task-number: QTBUG-85438 Change-Id: I4b91ffaaec7bea61454b0d3c794c77f2d0868d54 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement configure -qreal <type>Joerg Bornemann2020-08-191-1/+1
| | | | | | | | | The configure argument -qreal <type> maps to the CMake argument -DQT_COORD_TYPE=<type>. Fixes: QTBUG-83325 Change-Id: I94970f31ccfb241b1dd4f1d9b6cef25d6684dc05 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle -D, -I, -F and -L configure argumentsJoerg Bornemann2020-08-171-0/+17
| | | | | | | | | | | | | | Introduce new CMake variables and map -D to QT_EXTRA_DEFINES, -I to QT_EXTRA_INCLUDEPATHS, -L to QT_EXTRA_LIBDIRS, and -F to QT_EXTRA_FRAMEWORKPATHS. Those variables only affect the Qt build, not user projects. Fixes: QTBUG-85878 Change-Id: I229df2eed1505a2619068d0d32975962b052569a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Split QtBuild.cmake into smaller filesAlexandru Croitor2020-08-141-0/+728
QtBuild.cmake is huge. Split it. Move module, plugin, tools, executables and test related functions out of QtBuild.cmake into separate files. Do the same for many other things too. An additional requirement is that all the new Helpers files only define functions and macros. No global variable definitions are allowed, nor execution of commands with side effects. Some notes: qt_install_qml_files is removed because it's dead code. Some functions still need to be figured out, because they are interspersed and depend on various global state assignments. Task-number: QTBUG-86035 Change-Id: I21d79ff02eef923c202eb1000422888727cb0e2c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>