Re: [CMake] Specifying an alternate location for cmake Modules directory

2013-11-14 Thread Micha Hergarden
On 11/13/2013 11:50 PM, Paul Smith wrote:
 I need to maintain my own copy of the latest cmake, and for multiple
 different target systems (GNU/Linux, MacOS, Windows, Solaris...)

 I have a shared location where all tools like this go, so that
 regardless of the system architecture you can access this one location.
 Obviously inside that location are architecture-specific areas for
 binaries, etc.

 There is also a common area for files that can be shared, to reduce disk
 usage, copying time, etc.

 Since all of the cmake installation with the exception of the binaries
 is identical between the different architectures, I want to share all of
 the installation (for example the Modules directory, etc.)  I can't use
 symlinks.

 So what I'd like is a structure something like this:

   .../common/cmake/Modules/...

   .../linux/bin/cmake
   .../darwin/bin/cmake
   .../windows/bin/cmake.exe
   .../sunos/bin/cmake

 I can use a wrapper around cmake to set environment variables or pass in
 command line flags to the REAL cmake, if necessary.

 Is there any way to convince cmake to look in a different place for
 Modules etc.?

 --

 Powered by www.kitware.com

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

 Kitware offers various services to support the CMake community. For more 
 information on each offering, please visit:

 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Hello Paul,

For the modules you can use cmake_module_path from within your scripts.

|Regards,
Micha
|


signature.asc
Description: OpenPGP digital signature
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Specifying an alternate location for cmake Modules directory

2013-11-14 Thread Paul Smith
On Thu, 2013-11-14 at 12:41 +0100, Micha Hergarden wrote:
 For the modules you can use cmake_module_path from within your
 scripts.

Unfortunately this doesn't work.  I should have mentioned that I'd
already tried this.  CMake looks for its installation directory as the
very first thing and errors out if it can't be found, long before it
gets around to parsing CMAKE_MODULE_PATH.

Aha.  I've looked at the code and it appears I can do what I want by
setting the environment variable CMAKE_ROOT (not the cmake variable)
before I start cmake.

However, this doesn't really work for me either: the wrappers that set
this variable are not used when cmake is invoked from the makefile, or
whatever, and Failure Ensues.  Attempts to forcibly override
CMAKE_COMMAND, CMAKE_CPACK_COMMAND, and CMAKE_CTEST_COMMAND worked, but
had their own problems.

I did find a way to do what I want though, by rearranging my directories
somewhat:

  tools/linux/bin/cmake   (a wrapper that invokes the real program)
  tools/macosx/bin/cmake  (wrapper)
  tools/windows/bin/cmake.bat (wrapper)

  tools/common/cmake/linux/cmake   (real program)
  tools/common/cmake/macosx/cmake  (real program)
  tools/common/cmake/windows/cmake.exe (real program)
  tools/common/cmake/Modules/...

Ditto for ctest, cpack, etc.

The reason for the wrappers is that I have lots of tools and I want to
add just one directory to $PATH (tools/linux/bin for example) and get
access to all the tools: I don't want to add a different directory for
each tool.  But I need each tool to be installed completely contained in
its own subdirectory.

Done this way I don't need to use CMAKE_ROOT or do anything differently;
it all just works.  Yay!

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] Specifying an alternate location for cmake Modules directory

2013-11-13 Thread Paul Smith
I need to maintain my own copy of the latest cmake, and for multiple
different target systems (GNU/Linux, MacOS, Windows, Solaris...)

I have a shared location where all tools like this go, so that
regardless of the system architecture you can access this one location.
Obviously inside that location are architecture-specific areas for
binaries, etc.

There is also a common area for files that can be shared, to reduce disk
usage, copying time, etc.

Since all of the cmake installation with the exception of the binaries
is identical between the different architectures, I want to share all of
the installation (for example the Modules directory, etc.)  I can't use
symlinks.

So what I'd like is a structure something like this:

  .../common/cmake/Modules/...

  .../linux/bin/cmake
  .../darwin/bin/cmake
  .../windows/bin/cmake.exe
  .../sunos/bin/cmake

I can use a wrapper around cmake to set environment variables or pass in
command line flags to the REAL cmake, if necessary.

Is there any way to convince cmake to look in a different place for
Modules etc.?

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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