<div class="gmail_quote">On Wed, Feb 18, 2009 at 4:57 PM, Nicholas Yue <span dir="ltr">&lt;<a href="mailto:yue.nicholas@gmail.com">yue.nicholas@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;">
<div class="Ih2E3d">Robert Haines wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;I am testing different version of CMake on multiple platform to<br>
ensure my custom modules works fine on all combination.<br>
<br>
&nbsp;I find it troublesome to copy my custom module to all the different<br>
../share/cmake-X.Y/Modules directory<br>
<br>
&nbsp;Is there an alternative to telling CMake that there are additional<br>
Module search path over and above those it normally searches?<br>
</blockquote>
<br>
Sure, you can use: set(CMAKE_MODULE_PATH &quot;/path/to/modules&quot;). That path will be checked first so you can use it to override things in the CMake distribution too.<br>
<br>
In my projects I put the CMake stuff that I want to distribute with my code into a top-level directory called CMake and use it like so: set(CMAKE_MODULE_PATH &quot;${PROJECT_SOURCE_DIR}/CMake&quot;).<br>
<br>
Cheers,<br>
Rob<br>
<br>
</blockquote></div>
Is there a way to manage this without modifying the CMakeLists.txt file e.g. via some environment variable(s)?<br>
<br>
Using environment variable allow me to control the version to be use which may be different between production and development engineers. It also allows me to roll back-forth between versions as need be.</blockquote><div>
<br>Rather than forking your modules folder a better approach might be to simply test a configure with CMake 2.4.x before you commit modifications to your find modules.&nbsp; If you use CTest scripting you could test your build nightly with CMake 2.4.x.<br>
<br>Of course if you really want to fork your modules folder and maintain one version for CMake 2.4.x and the other for CMake 2.6.x you could probably accomplish your goals by using the CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, and/or CMAKE_PATCH_VERSION variables in a conditional.<br>
<br></div></div><br>-- <br>Philip Lowman<br>