Providing FindFoo.cmake for a kde module "foo"

Ralf Habacker ralf.habacker at freenet.de
Sun Jul 8 21:55:17 CEST 2007


Andreas Pakulat schrieb:
> On 08.07.07 21:26:42, Ralf Habacker wrote:
>   
>> Andreas Pakulat schrieb:
>>     
>>> On 08.07.07 20:49:23, Ralf Habacker wrote:
>>>       
>>>> I have added the following stuff to a new file in 
>>>> <kdelibs-install-dir>/lib/kdevplatform/KDevPlatformConfig.cmake
>>>>
>>>> if(WIN32)
>>>>    file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles)
>>>>    SET(CMAKE_MODULE_PATH  ${CMAKE_MODULE_PATH} 
>>>> ${ProgramFiles}/kdevplatform/share/apps/cmake/modules)
>>>>    find_package(KDevPlatform REQUIRED)
>>>> endif(WIN32)
>>>>
>>>> which let me configure kdevelop on win32 without any error.
>>>>    
>>>>         
>>> Hmm.... So we could generate that file and install it along with
>>> kdevplatform..
>>>
>>> Did you need to add the
>>> -DKDevPlatform_DIR=<kdelibs-install-dir>/lib/kdevplatform/ ?
>>>
>>>  
>>>       
>> no.
>>     
>
> Cool.
>
>   
>> In the meantime I found a simpler way by appending all pathes from KDEDIRS (+ 
>> 'share/apps/cmake/module') added to the CMAKE_MODULE_PATH  in 
>> FindKDE4Internal.cmake. As an alternative the path list generated by 
>> 'kde4-config --path data'  could be added.  This makes it able to use cmake 
>> modules without any additional effort from *all* KDE install locations.
>>     
>
> That sounds like a really good solution, except that currently KDEDIRS
> is not needed to be set during compilation, only during runtime. 
>   
Then the usage of the 'kde4-config --path data' alternative will be 
better. kde4-config is available when compiling kde package based on 
kdelibs. FindKDE4.cmake uses kde4-config also so set the 
CMAKE_MODULE_DIR to be able to find KDE4Internals.cmake

> So if nobody objects I'd like to see the second solution, with proper
> documentation of course, 
> else its no problem to provide
> KdevPlatformConfig.cmake and install it into kdelibs/lib/kdevplatform/
>
>   
Ralf



More information about the Kde-buildsystem mailing list