[karchive] /: Show how qmake integration can be done.
Alexander Neundorf
neundorf at kde.org
Sun Jan 5 17:41:18 UTC 2014
On Saturday 04 January 2014, you wrote:
> On Saturday 04 January 2014 22:25:36 David Faure wrote:
> > On Saturday 04 January 2014 22:19:29 Alexander Neundorf wrote:
> > > > ecm_generate_pri_file(KF5KIOCore BASE_NAME KIOCore VARIABLE_PREFIX
> > > > KIO
> > > >
> > > > DEPS "KCoreAddons KService")
> > >
> > > I think so.
> > > I'd be even more explicit and add something like "FILE KF5KIOCore.pri",
> > > then it's clear to the reader what is generated ("FILE" is already
> > > used this way in install(EXPORT ... ) ).
> >
> > The first argument is the target name (so I didn't prefix it, which is
> > consistent with most other commands that take a target name first).
> >
> > It's not used for the filename (that's qt_KIOCore.pri, i.e. it comes from
> > BASE_NAME) but to write out the name of the library into the file.
Ah.
Is BASE_NAME also used for something else, or just that ?
I'd make it "FILENAME ${MaybeSomeDir}/qt_KIOCore.pri" then, and error out if
the given filename doesn't match "qt_.+\.pri/" or something like that.
This is done the same way for the FOUND_VAR argument in
find_package_handle_standard_args().
It's a bit more typing, but it's easy to read and with such a check hard to
get wrong.
> ... should I add LIBRARY in front of the first argument, or leave it like
> this?
In doubt, add the keyword. Sometimes it hurts later on when there is none
(...because it can make the function harder to modify/extend).
Alex
More information about the Kde-buildsystem
mailing list