Fix cmake warning (with cmake >= 3.9.0)
AbandonedPublic

Authored by mlaurent on Dec 14 2017, 2:22 PM.

Details

Reviewers
dfaure
Test Plan

build

Diff Detail

Repository
R241 KIO
Branch
fix_cmake_warning
Lint
No Linters Available
Unit
No Unit Test Coverage
mlaurent created this revision.Dec 14 2017, 2:22 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 14 2017, 2:22 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
mlaurent requested review of this revision.Dec 14 2017, 2:22 PM
dfaure requested changes to this revision.Dec 14 2017, 2:34 PM

Why not do this in ECM?

This comment seems to come from KDE apps or something, which depend on old ECM. But KF5.42 depends on ECM5.42, so I don't see the usefulness.

This revision now requires changes to proceed.Dec 14 2017, 2:34 PM

Ok I can move it to ecm (mais in which file ?) "kde-modules/KDECMakeSettings.cmake" ?

and it depends if apps have some specific macro for example in kmail we have "EXPORT_KONTACT_PLUGIN" too

@flherne has been working on a patch to add

list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "K_PLUGIN_FACTORY_WITH_JSON")

to KF5CoreAddonsConfig.cmake and similar for other modules., so the needed settings are automatically injected into the builds that use components which provide such Q_OBJECT embedding macros. Seems life kept him busy so he did not yet upload that for review?

kossebau added a comment.EditedDec 14 2017, 3:24 PM

Why not do this in ECM?

Doing this in ECM would mean maintaining a list of macros in a repo/product separate from the repo/products where the respective macros are defined. More, what libraries should ECM cover? Just KF5 ones? What about macros from libs from kde apps, extragear etc.

It scales better, is better to maintain and feels also more logic to have each module's cmake config inject any needed extension of CMAKE_AUTOMOC_MACRO_NAMES into the build of products linking and picking up any such cpp macros. That's what cmake config is for, configuring and providing things as needed with a dep, no? :)

Edit: of course if the macro is used in the repo itself as well, there is setting CMAKE_AUTOMOC_MACRO_NAMES needed both in the CMakeLists.txt and in the installed cmake config file. Not perfect, but still better IMHO over a separate to maintain list in ECM.

You're right, this belongs to KF5CoreAddonsConfig.cmake

mlaurent abandoned this revision.Dec 15 2017, 5:43 AM

commited in kcoreaddons