On Feb 15, 2008 11:43 PM, Alexander Neundorf &lt;<a href="mailto:neundorf@kde.org">neundorf@kde.org</a>&gt; 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>&gt; On Wed, Feb 13, 2008 at 8:06 PM, Alexander Neundorf &lt;<a href="mailto:neundorf@kde.org">neundorf@kde.org</a>&gt;<br>&gt;<br>&gt; wrote:<br>
&gt; &gt; On Wednesday 13 February 2008, you wrote:<br>&gt; &gt; &gt; On Feb 12, 2008 6:28 PM, Alexander Neundorf &lt;<a href="mailto:neundorf@kde.org">neundorf@kde.org</a>&gt; wrote:<br>&gt; &gt; &gt; &gt; On Tuesday 12 February 2008, Sven Langkamp wrote:<br>
&gt; &gt; &gt; &gt; &gt; Hi,<br>&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; I want to add a dependency for the create-resources package to<br>&gt; &gt;<br>&gt; &gt; KOffice,<br>&gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; which contains shared resources from the CREATE project.<br>
&gt; &gt; &gt; &gt; &gt; How can I check if the package is installed? Note that the package<br>&gt; &gt;<br>&gt; &gt; only<br>&gt; &gt;<br>&gt; &gt; &gt; &gt; &gt; contains data and no code.<br>&gt; &gt; &gt; &gt;<br>&gt; &gt; &gt; &gt; What does this package consist of and where is it typically installed<br>
&gt; &gt;<br>&gt; &gt; ?<br>&gt; &gt;<br>&gt; &gt; &gt; &gt; You probably need to do something with find_path().<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; On my system it&#39;s in /usr/share/create/ and it contains brush, pattern<br>
&gt; &gt;<br>&gt; &gt; and<br>&gt; &gt;<br>&gt; &gt; &gt; gradient files.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I tried to put a FindCreateResources.cmake in koffice/cmake/modules,<br>&gt; &gt; &gt; but that doesn&#39;t work and is probably not even valid cmake code:<br>
&gt; &gt; &gt;<br>&gt; &gt; &gt; if(CREATERESOURCES_INCLUDE_DIR)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; &nbsp; set(CREATERESOURCES_FOUND TRUE)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; else(CREATERESOURCES_INCLUDE_DIR)<br>&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; find_path( CREATERESOURCES_INCLUDE_DIR simple.kgr /usr/share/create/<br>&gt; &gt; &gt; ) if( CREATERESOURCES_INCLUDE_DIR )<br>&gt; &gt; &gt; &nbsp; &nbsp; set( CREATERESOURCES_FOUND TRUE )<br>&gt; &gt; &gt; &nbsp; endif( CREATERESOURCES_INCLUDE_DIR )<br>
&gt; &gt; &gt; endif(CREATERESOURCES_INCLUDE_DIR)<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; find_package(createresources REQUIRED) gives CMake Error:<br>&gt; &gt; &gt; createresources_DIR is not set. &nbsp;It must be set to the directory<br>
&gt; &gt;<br>&gt; &gt; containing<br>&gt; &gt;<br>&gt; &gt; &gt; createresourcesConfig.cmake in order to use createresources.<br>&gt; &gt;<br>&gt; &gt; The filename is FindCreateResources.cmake, so must use exact that case:<br>
&gt; &gt; find_package(CreateResources)<br>&gt;<br>&gt; Thanks, this worked.<br>&gt;<br>&gt; &gt; I&#39;d suggest to start simple:<br>&gt; &gt;<br>&gt; &gt; find_path( CREATERESOURCES_INCLUDE_DIR simple.kgr<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PATHS<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ${CMAKE_INSTALL_PREFIX}<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /usr /usr/local /usr/pkg<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /opt /opt/local /opt/csw<br>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PATH_SUFFIXES share/create )<br>&gt; &gt;<br>&gt; &gt; if( CREATERESOURCES_INCLUDE_DIR )<br>
&gt; &gt; &nbsp;set( CREATERESOURCES_FOUND TRUE )<br>&gt; &gt; endif( CREATERESOURCES_INCLUDE_DIR )<br>&gt; &gt;<br>&gt; &gt; (with cmake cvs it wouldn&#39;t be necessary to list all these paths, there<br>&gt; &gt; it has<br>&gt; &gt; CMAKE_SYSTEM_PREFIX_PATH which has all these search prefixes)<br>
&gt; &gt;<br>&gt; &gt; Does that project have a homepage ?<br>&gt;<br>&gt; Is there a way to see if the package was found? At the moment cmake runs,<br>&gt; but I don&#39;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> &nbsp;message(STATUS &quot;Create Resources found&quot;)<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 &quot;make edit_cache&quot; 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>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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>