<div class="gmail_quote">On Thu, Aug 13, 2009 at 4:32 PM, Robert Dailey <span dir="ltr">&lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In case no one knows this, the Subversion API requires over 10 separate dependencies in order to build it into a fully-functional API. In other words, there are certain dependencies that are optional, but I&#39;m assuming a case where they are all required as far as the Find module is concerned (i.e. it can&#39;t assume the user won&#39;t use certain features and thus is not allowed to omit those dependencies from its search). A list of a few that it requires:<div>

<br></div><div>apr</div><div>apr-util</div><div>apr-iconv</div><div>neon</div><div>berkeleydb</div><div>openssl</div><div><br></div><div>There are many others it depends on. I had considered writing find modules for all of these, but there is one major thing stopping me. I do not have the knowledge or resources to write find modules for all of these myself. I would love more than anything to be able to write find modules for these and contribute them to the community. I have no experience with the MAC and no development experience with Linux. Only on Windows. Additionally, some of these libraries are so tricky to build on Windows that it would be difficult to setup a reliable way for the Find module to find these libraries.</div>

<div><br></div><div>What I&#39;ve been doing is maintaining a fixed list of libraries in my CMake scripts and just moving those dependencies in a predictable location so that I can &quot;hard-code&quot; the paths to those libraries and includes into my CMake projects. What would you guys do in this situation? I obviously could not reliably create find modules for these, given the reasons above. But also because there is no bold &quot;standard&quot; for find modules. Even when you do know what needs to be done to find these libraries, you have to know a standard way of setting it up that is acceptable to the CMake project.</div>
</blockquote><div><br>Nothing is ever easy. :)<br><br>Generally what I do is write my find modules to work out of the box on Linux.  Since nobody wants to find every library/include directory on Windows manually, generally what we do is to keep dependencies per compiler in a folder checked into CM.  Then we manipulate CMAKE_PREFIX_PATH to assist in finding all of the stuff (preserving it&#39;s original value so it can still be used via -D or cache).<br>
<br>Depending on the dependency, we also find some of our Linux dependencies in the same way.<br><br>===<br>set(DEPS_PATH &quot;&quot; CACHE PATH &quot;Path to the dependencies directory&quot;)<br>set(orig_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})<br>
<br># Wrap calls to each find_package() with the path hint<br>if(DEPS_PATH AND WIN32)<br>   list(APPEND CMAKE_PREFIX_PATH ${DEPS_PATH}/foo-1.2.3)<br>endif()<br>find_package(Foo)<br>set(CMAKE_PREFIX_PATH ${orig_CMAKE_PREFIX_PATH})<br>
===<br></div></div><br clear="all"><br>-- <br>Philip Lowman<br>