Re: [CMake] Sharing Modules between different installation of CMake

2009-02-20 Thread Robert Haines


On 18 Feb 2009, at 21:57, Nicholas Yue wrote:


Robert Haines wrote:

Hi,


I am testing different version of CMake on multiple platform to
ensure my custom modules works fine on all combination.

I find it troublesome to copy my custom module to all the different
../share/cmake-X.Y/Modules directory

Is there an alternative to telling CMake that there are additional
Module search path over and above those it normally searches?


Sure, you can use: set(CMAKE_MODULE_PATH /path/to/modules). That  
path will be checked first so you can use it to override things in  
the CMake distribution too.


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 ${PROJECT_SOURCE_DIR}/CMake).


Cheers,
Rob

Is there a way to manage this without modifying the CMakeLists.txt  
file e.g. via some environment variable(s)?


Yes, you can set most things from the command line in CMake so try this:

$ ccmake -DCMAKE_MODULE_PATH=/path/to/modules /path/to/project

No changes to CMakeLists.txt required...

Cheers,
Rob

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Sharing Modules between different installation of CMake

2009-02-18 Thread Nicholas Yue
Hi,

  I am testing different version of CMake on multiple platform to
ensure my custom modules works fine on all combination.

  I find it troublesome to copy my custom module to all the different
../share/cmake-X.Y/Modules directory

  Is there an alternative to telling CMake that there are additional
Module search path over and above those it normally searches?

Regards
-- 
Nicholas Yue
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Sharing Modules between different installation of CMake

2009-02-18 Thread Robert Haines

Hi,


 I am testing different version of CMake on multiple platform to
ensure my custom modules works fine on all combination.

 I find it troublesome to copy my custom module to all the different
../share/cmake-X.Y/Modules directory

 Is there an alternative to telling CMake that there are additional
Module search path over and above those it normally searches?


Sure, you can use: set(CMAKE_MODULE_PATH /path/to/modules). That  
path will be checked first so you can use it to override things in the  
CMake distribution too.


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 ${PROJECT_SOURCE_DIR}/CMake).


Cheers,
Rob

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Sharing Modules between different installation of CMake

2009-02-18 Thread Nicholas Yue

Robert Haines wrote:

Hi,


 I am testing different version of CMake on multiple platform to
ensure my custom modules works fine on all combination.

 I find it troublesome to copy my custom module to all the different
../share/cmake-X.Y/Modules directory

 Is there an alternative to telling CMake that there are additional
Module search path over and above those it normally searches?


Sure, you can use: set(CMAKE_MODULE_PATH /path/to/modules). That 
path will be checked first so you can use it to override things in the 
CMake distribution too.


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 ${PROJECT_SOURCE_DIR}/CMake).


Cheers,
Rob

Is there a way to manage this without modifying the CMakeLists.txt file 
e.g. via some environment variable(s)?


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.


Regards

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Sharing Modules between different installation of CMake

2009-02-18 Thread Philip Lowman
On Wed, Feb 18, 2009 at 4:57 PM, Nicholas Yue yue.nicho...@gmail.comwrote:

 Robert Haines wrote:

 Hi,

   I am testing different version of CMake on multiple platform to
 ensure my custom modules works fine on all combination.

  I find it troublesome to copy my custom module to all the different
 ../share/cmake-X.Y/Modules directory

  Is there an alternative to telling CMake that there are additional
 Module search path over and above those it normally searches?


 Sure, you can use: set(CMAKE_MODULE_PATH /path/to/modules). That path
 will be checked first so you can use it to override things in the CMake
 distribution too.

 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 ${PROJECT_SOURCE_DIR}/CMake).

 Cheers,
 Rob

  Is there a way to manage this without modifying the CMakeLists.txt file
 e.g. via some environment variable(s)?

 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.


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.  If you use CTest scripting you could test your build nightly
with CMake 2.4.x.

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.


-- 
Philip Lowman
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake