Help with cmake needed.

Alexander Neundorf neundorf at kde.org
Sat Oct 30 18:01:48 CEST 2010


On Friday 29 October 2010, Yury G. Kudryashov wrote:
> Michael Jansen wrote:
> > On Friday 29 October 2010 15:03:44 Flavio Castelli wrote:
> >> Hello I'm qjson maintainer and I have a problem with cmake.
> >> Some times ago Michael Jansen reported qjson had some issues with cmake:
> >> http://goo.gl/gKw6
> >
> > We had that discussion with a result i personally found very unsatisfying
> > but i was the only one ... :(
> >
> >> He started working on his own fork of qjson on gitorious but he never
> >> requested me to push back his changes. I tried to contact him but he
> >> never answer to my messages.
> >
> > Sorry. For personal reasons i am on a off time currently and only lurk
> > (sometimes). Attached the current state i have. It's better and could be
> > used. But it's not completely up to standards. This would need
> >
> > 3. Making the remaining Find Script use the qjson-config script.
>
> I vote for this one.

Yes, option3 is the one to go for.

What needs to be done:
qjson needs to generate a qjson-config.cmake file and install that to 
PREFIX/lib/cmake/qjson/

What should it contain ?
Settings like the include dir, the version number, and variables for the 
installed libraries.
These should ideally be generated using the 
install(TARGETS mylib ... EXPORT MyExports)
feature of cmake, then the file contain the full information, like transitive 
dependencies etc.

You can find examples e.g. in kdelibs or in kdepimlibs.

See the cmake manpage, for find_package() in config-mode for details on how 
cmake searches for these files.
See the documentation of install(TARGETS ... EXPORT ...)
and install(EXPORTS ...) for details on exporting targets.

You can start playing around with this by creating just a small hello-world 
like project and see what happens (nneds to contain mainly an add_library() 
call and install this lib).

For any questions which arise, feel free to ask here :-)

Alex


More information about the Kde-buildsystem mailing list