Config files for frameworks (Was: KArchive for Qt4)

Stephen Kelly steveire at gmail.com
Tue Dec 18 09:25:00 UTC 2012


Alexander Neundorf wrote:

> On Thursday 29 November 2012, Stephen Kelly wrote:
>> Alexander Neundorf wrote:
>> > The code for creating a Config.cmake file is not trivial, but IMO also
>> > not boilerplate, and Stephen agreed in Berlin that this will have to be
>> > done individually be every project. This is the added
>> > threadweaverConfig.cmake.in and the call to
>> > configure_package_config_file() in the CMakeLists.txt.
> 
> ...
>> 2) You are setting things that do not need to be set:
>> 
>>  * Eg: kwidgetsaddons_INCLUDE_DIR, kwidgetsaddons_LIBRARY_DIR.
>> 
>> The kwidgetsaddons_LIBRARY_DIR is not needed at all. That's the kind of
>> thing that you only need (and put in the cache) if you're writing a Find
> 
> I was about to remove the LIBRARY_DIR variable, but...
> the user may want to use the Foo_LIBRARY_DIR variable for setting the
> RPATH of his own executables.

Doesn't cmake have facilities for that? Why not use them? Not using them is 
rare enough that it would be ok to read the LOCATION property from the 
imported target instead of setting the variable.

> If this variable is not provided, he would have to get the location
> property of one of the imported library targets and use
> get_filename_component() on it. RPATH is only set automatically if the
> property INSTALL_RPATH_USE_LINK_PATH is enabled on a target, which is not
> the case by default.

Thanks,

Steve.



More information about the Kde-frameworks-devel mailing list