<br><br><div class="gmail_quote">2010/2/21 Mateusz Loskot <span dir="ltr">&lt;<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Gavin Heavyside wrote:<br>
&gt; This means that GEOS will be built whenever a binary from my main project<br>
&gt; specifies GEOS as a dependency.  I use this technique successfully with<br>
&gt; boost, googlemock and others.<br>
<br>
</div>Gavin, interesting idea.<br>
<div class="im"><br></div></blockquote><div>It works well for me, as I build projects on multiple machines with different architectures, and building dependencies as part of the project means I can upgrade dependencies or change their configuration in a single place.  The strategy is the one described in the boost CMake docs:</div>
<div><br></div><div><a href="http://sodium.resophonic.com/boost-cmake/current-docs/exported_targets.html#with-boost-source-in-a-subdirectory-of-your-source">http://sodium.resophonic.com/boost-cmake/current-docs/exported_targets.html#with-boost-source-in-a-subdirectory-of-your-source</a></div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
</div>Applied to trunk, thanks!<br></blockquote><div><br></div><div>As I&#39;ve investigated further, there are a couple more places that need changing:</div><div><br></div><div>diff --git a/CMakeLists.txt b/CMakeLists.txt</div>
<div>index 21a6c50..020dc3b 100644</div><div>--- a/CMakeLists.txt</div><div>+++ b/CMakeLists.txt</div><div>@@ -206,13 +206,13 @@ endif()</div><div> #################################################################################</div>
<div> </div><div> # for including GEOS C++ API headers</div><div>-include_directories(${CMAKE_SOURCE_DIR}/include)</div><div>+include_directories(${geos_SOURCE_DIR}/include)</div><div> </div><div> # for including build-specific GEOS C API headers</div>
<div>-include_directories(${CMAKE_BINARY_DIR}/capi)</div><div>+include_directories(${geos_BINARY_DIR}/capi)</div><div> </div><div> # for including build-specific version.h, platform.h and geos_c.h</div><div>-include_directories(${CMAKE_BINARY_DIR}/include)</div>
<div>+include_directories(${geos_BINARY_DIR}/include)</div><div> </div><div> #################################################################################</div><div> # Setup checks and generate config headers</div><div>
<br></div><div><br></div><div><br></div><div>With the above patch, and after adding relevant include dirs to my main CMakeFiles.txt, I can successfully build and link against GEOS from my main project, with GEOS being built correctly as a dependency.</div>
<div><br></div><div>Thanks,</div><div><br></div><div>Gavin</div></div>