Re: [CMake] relative CMAKE_MODULE_PATH

2009-02-16 Thread Pau Garcia i Quiles
Hello,

This works for me with CMake CVS:

SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

On Mon, Feb 16, 2009 at 11:26 AM, Johannes Stallkamp
johannes.stallk...@rub.de wrote:
 Hello list,

 is it possible to set a relative path as CMAKE_MODULE_PATH ? I
 actually had problems with that (CMake 2.6.3-RC 8)
 Is it because the relative path would be resolved w.r.t current build
 dir and not w.r.t. to the directory with CMakeLists.txt ?

 Reason:
 I want to point CMAKE_MODULE_PATH to a directory in the source tree
 which contains a file with a couple of cmake macros and some
 customized modules.

 These should be available in all projects. These projects may be
 located at varying depth within the tree.
 e.g. (simplified view)

 ROOT
 |-common components
|-libraryA
|-libraryB
|-CMakeMacros
 |-applicationA
|-subcomponentA
|-plugins
|-pluginA
|-pluginB
|-pluginC
 |-applicationB


 Initially, I just used

 INCLUDE( ../../CMakeMacros/localmacros.cmake)
 ( ../ varying according to project location, of course )

 which is fine, as long as I only want to use that single file but
 creates problems if I want to add custom/customized modules.

 However,
SET( CMAKE_MODULE_PATH ../../CMakeModules)
INCLUDE( localmacros )
 does not work. CMake complains that it cannot find that file.

 My current workaround is
SET( CMAKE_MODULE_PATH
 ${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeModules)
INCLUDE( localmacros )


 Is that necessary or is there a more elegant way I'm not aware of?

 Kind Regards
 Johannes

 ___
 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




-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)
___
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] relative CMAKE_MODULE_PATH

2009-02-16 Thread Eric Noulard
2009/2/16 Pau Garcia i Quiles pgqui...@elpauer.org:
 Hello,

 This works for me with CMake CVS:

 SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

Yes I do that too but...
this is not a relative path :-)

as asked in the first place:

 is it possible to set a relative path as CMAKE_MODULE_PATH ?

I don't really know if relative path is meant to work.

See the CMake use full paths FAQ entry:

http://www.cmake.org/Wiki/CMake_FAQ#Why_does_CMake_use_full_paths.2C_or_can_I_copy_my_build_tree.3F

-- 
Erk
___
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] relative CMAKE_MODULE_PATH

2009-02-16 Thread Philip Lowman



.. Original Message ...
On Mon, 16 Feb 2009 12:45:06 +0100 Eric Noulard eric.noul...@gmail.com 
wrote:
2009/2/16 Pau Garcia i Quiles pgqui...@elpauer.org:
 This works for me with CMake CVS:

 SET( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

Yes I do that too but...
this is not a relative path :-)

Try using CMAKE_CURRENT_SOURCE_DIR

-- 
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