[Development] Did we have to remove cmake's qt5_use_modules?

Kevin Funk kfunk at kde.org
Fri Jun 8 16:59:10 CEST 2018


On Thursday, 7 June 2018 08:03:40 CEST Thiago Macieira wrote:
> Commit 02ed1b36daebed5f3997bb676cf5e818c0db9d3c was
> 
>     Remove CMake code for CMake < 3.1
> 
>     This removes the following functions from Qt5CoreMacros:
>     - qt5_use_modules(...)
> 
> Which follows 2013's d9ea4bb1441534cfb9253303ac258951dfcc4d9e
> 
>     Mark qt5_use_modules as obsolete.
> 
>     Forward-port of cb7f32f5b861fe115fa71f64500a5cbb0b643f1b (Mark
>     qt4_use_modules and qt4_automoc as obsolete., 2013-07-04) from
>     cmake.git.
> 
> But it appears that in the 5 years since we deprecated it, people have not
> stopped using it. Did we have to remove it? Or should we have kept
> compatibility until Qt 6?

Heya Thiago,

thanks for bringing this up on the mailing list. I have authored the patch 
which (also) removed qt5_use_modules(). To my excuse, I haven't expected that 
so many projects still use said macro actively. I was maybe misguided by my 
perception from the KDE world; where most projects have used to using 
target_link_libraries(...).

I understand that the removal of qt5_use_modules() creates tons of unnecessary 
extra work for distro and project maintainers.

I would lean towards restoring qt5_use_modules() in Qt 5.11.1 (and keep it for 
the Qt5 lifetime). But I'd leave the other removals of 
02ed1b36daebed5f3997bb676cf5e818c0db9d3c (mainly removal of support of older 
CMake versions) intact.

Agreed? If so I'll file a patch soon-ish.


PS: Regarding the motivation for such changes:
  
Obviously I don't want to make other ppl's life more difficult -- but the 
CMake support in Qt5 has grown tons of fallback or compat code over the years 
which makes it very hard to improve it. We ideally should try to get rid off 
this in order to move forward. CMake has learned a lot throughout the years 
but in Qt's CMake support code there were and still are lots of places where 
we try to mimic what CMake supports out of the box since years.

Regards,
Kevin

> Just look at the failures in
> https://build.opensuse.org/project/monitor/openSUSE:Factory?
> arch_x86_64=1&defaults=0&failed=1&repo_standard=1
> 
> The majority of them are caused by the Qt 5.11 update, a great number of
> which are the cmake update (the rest are indirect header dependency and are
> easy to fix).


-- 
Kevin Funk | kfunk at kde.org | http://kfunk.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20180608/158a843c/attachment.sig>


More information about the Development mailing list