Skip to content

[gentoo downstream-pick] Qt5BasicConfig.cmake.in: Fix cmake macro compat. for upgrade from <Qt-5.14

I realise this may be rather specific to [source-based] Gentoo but it could still affect anyone else manually upgrading from older Qt versions like e.g. 5.12 LTS. We have been carrying this patch since 5.14.1 to avoid users running into cryptic cmake errors and I would be happy if able to drop it.

In commit:

https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=63d9cd17

_populate_$${CMAKE_MODULE_NAME}_plugin_properties in 5.14.0 gained an additional argument IsDebugAndRelease without providing backward compatibility. This macro is used (at least) for QtGui and QtDesigner plugins added by qtimageformats, qtsvg, qtvirtualkeyboard and qtwayland. During upgrade from =Qt-5.14, as a consequence of slot upgrade rebuilds, some reverse dependencies are slated for rebuild before these Qt consumers have been rebuilt and their cmake files regenerated, leading to cmake errors like

_populate_Gui_plugin_properties Macro invoked with incorrect arguments for macro named: _populate_Gui_plugin_properties

See also:

From mkspecs/features/create_cmake.prf:

CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties functions whether a Configuration specific generator expression needs to be added to the values of INTERFACE_LINK_LIBRARIES and INTERFACE_LINK_OPTIONS. For debug_and_release builds, we do need > configuration specific values. For singular builds (only release or only debug), we want the values to be applied regardless of the configuration. This would allow on Linux and macOS (and with a recent enough version of CMake on Windows) to build a Debug configuration of an application, even if Qt was built in a Release configuration.

We fix this by making IsDebugAndRelease optional and default to FALSE.

Edited by Andreas Sturmlechner

Merge request reports