On Feb 15, 2008 11:43 PM, Alexander Neundorf <<a href="mailto:neundorf@kde.org">neundorf@kde.org</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Friday 15 February 2008, Sven Langkamp wrote:<br>> On Wed, Feb 13, 2008 at 8:06 PM, Alexander Neundorf <<a href="mailto:neundorf@kde.org">neundorf@kde.org</a>><br>><br>> wrote:<br>
> > On Wednesday 13 February 2008, you wrote:<br>> > > On Feb 12, 2008 6:28 PM, Alexander Neundorf <<a href="mailto:neundorf@kde.org">neundorf@kde.org</a>> wrote:<br>> > > > On Tuesday 12 February 2008, Sven Langkamp wrote:<br>
> > > > > Hi,<br>> > > > ><br>> > > > > I want to add a dependency for the create-resources package to<br>> ><br>> > KOffice,<br>> ><br>> > > > > which contains shared resources from the CREATE project.<br>
> > > > > How can I check if the package is installed? Note that the package<br>> ><br>> > only<br>> ><br>> > > > > contains data and no code.<br>> > > ><br>> > > > What does this package consist of and where is it typically installed<br>
> ><br>> > ?<br>> ><br>> > > > You probably need to do something with find_path().<br>> > ><br>> > > On my system it's in /usr/share/create/ and it contains brush, pattern<br>
> ><br>> > and<br>> ><br>> > > gradient files.<br>> > ><br>> > > I tried to put a FindCreateResources.cmake in koffice/cmake/modules,<br>> > > but that doesn't work and is probably not even valid cmake code:<br>
> > ><br>> > > if(CREATERESOURCES_INCLUDE_DIR)<br>> > ><br>> > > set(CREATERESOURCES_FOUND TRUE)<br>> > ><br>> > > else(CREATERESOURCES_INCLUDE_DIR)<br>> > ><br>
> > > find_path( CREATERESOURCES_INCLUDE_DIR simple.kgr /usr/share/create/<br>> > > ) if( CREATERESOURCES_INCLUDE_DIR )<br>> > > set( CREATERESOURCES_FOUND TRUE )<br>> > > endif( CREATERESOURCES_INCLUDE_DIR )<br>
> > > endif(CREATERESOURCES_INCLUDE_DIR)<br>> > ><br>> > > find_package(createresources REQUIRED) gives CMake Error:<br>> > > createresources_DIR is not set. It must be set to the directory<br>
> ><br>> > containing<br>> ><br>> > > createresourcesConfig.cmake in order to use createresources.<br>> ><br>> > The filename is FindCreateResources.cmake, so must use exact that case:<br>
> > find_package(CreateResources)<br>><br>> Thanks, this worked.<br>><br>> > I'd suggest to start simple:<br>> ><br>> > find_path( CREATERESOURCES_INCLUDE_DIR simple.kgr<br>> > PATHS<br>
> > ${CMAKE_INSTALL_PREFIX}<br>> > /usr /usr/local /usr/pkg<br>> > /opt /opt/local /opt/csw<br>> > PATH_SUFFIXES share/create )<br>> ><br>> > if( CREATERESOURCES_INCLUDE_DIR )<br>
> > set( CREATERESOURCES_FOUND TRUE )<br>> > endif( CREATERESOURCES_INCLUDE_DIR )<br>> ><br>> > (with cmake cvs it wouldn't be necessary to list all these paths, there<br>> > it has<br>> > CMAKE_SYSTEM_PREFIX_PATH which has all these search prefixes)<br>
> ><br>> > Does that project have a homepage ?<br>><br>> Is there a way to see if the package was found? At the moment cmake runs,<br>> but I don't get feedback from it.<br><br></div></div>Yes.<br>
You can do the following:<br><br>find_package(CreateResources)<br><br>if(CREATERESOURCES_FOUND)<br> message(STATUS "Create Resources found")<br>endif(CREATERESOURCES_FOUND)<br><br>or you can grep for CREATERES in CMakeCache.txt and see what it contains.<br>
<br>Or you can do "make edit_cache" and check that way for<br>CREATERESOURCES_INCLUDE_DIR<br><br>or (even better) you can do the following in FindCreateResources.cmake:<br><br>find_path(...)<br><br>find_package_handle_standard_args(CreateResources DEFAULT_MSG<br>
CREATERESOURCES_INCLUDE_DIR)<br><br><br>If you need to find more than one file, use find_path() for all of them and<br>list the result variables in the find_package_handle_standard_args() macro.<br>
( you can remove the if(CREATERESOURCES_INCLUDE_DIR)<br>set(CREATE_RESOURCES_FOUND TRUE) then, this is handled by the macro above.<a href="https://mail.kde.org/mailman/listinfo/kde-buildsystem" target="_blank"></a><br></blockquote>
</div><br>Works great. Thanks a lot for your help.<br>