Shipping a find script of a library with the library itself

Alexander Neundorf neundorf at kde.org
Mon Nov 9 18:28:19 CET 2009


On Monday 09 November 2009, Stefan Majewsky wrote:
> Hi,
>
> I want to move my jigsaw puzzle game Palapeli to kdereview very soon.
> Palapeli builds on libpala, which offers a plugin interface. The headers
> for libpala are therefore public, so I want to ship some FindLibPala.cmake
> with the libpala sources, but I think I heard from somebody somewhen that
> such a distribution method is not good, because CMake will completely fail
> to locate libpala if it is not installed already, resulting in undetailed
> fatal errors (IIRC).
>
> Is that right? 

Yes. It's like if you want to go somewhere, and you can get a very good map 
how to get there just directly at your target.

> What should I do then? 

You could install a LibPalaConfig.cmake file in the proper location (see 
documentation of find_package(), config-mode), this should be found more or 
less automatically by cmake when doing a find_package().
Or you could provide an example FindLibPala.cmake somewhere, which developers 
which want to use your library can copy into their project and use then.

Alex


More information about the Kde-buildsystem mailing list