Re: [CMake] Relative include() calls

2009-05-28 Thread David Cole
There is also one more technique to consider here. There is a self-referential variable available in every CMakeLists.txt or every included file called CMAKE_CURRENT_LIST_FILE. You could do this inside your "common.cmake" file: get_filename_component( dir "${CMAKE_CURRENT_LIST_FILE}" PATH ) i

Re: [CMake] Relative include() calls

2009-05-28 Thread Michael Jackson
There is a pattern that I use that is similar to what you are wanting so I'll just throw it out there for your consideration: project (Foo) #CMake will now Define Foo_SOURCE_DIR which # is the same as the current directory. It is # also put into the cache. include (${Foo_SOURCE_DIR}/cmake/com

Re: [CMake] Relative include() calls

2009-05-28 Thread Robert Dailey
On Thu, May 28, 2009 at 11:06 AM, Tyler Roscoe wrote: > On Thu, May 28, 2009 at 10:42:03AM -0500, Robert Dailey wrote: > > The most annoying thing about this solution, though, is that every single > > CMakeLists.txt that includes this module needs to make sure it has > > CMAKE_MODULE_PATH setup p

Re: [CMake] Relative include() calls

2009-05-28 Thread Tyler Roscoe
On Thu, May 28, 2009 at 10:42:03AM -0500, Robert Dailey wrote: > The most annoying thing about this solution, though, is that every single > CMakeLists.txt that includes this module needs to make sure it has > CMAKE_MODULE_PATH setup properly. It's just a bit redundant and > tedious. You're kind o

Re: [CMake] Relative include() calls

2009-05-28 Thread Robert Dailey
figured from the file names). Have you tried to set > CMAKE_MODULE_PATH. Then you don't need any relative paths anymore. > > Best regards, > Marcel Loose. > > -Original Message- > From: Adolfo Rodríguez > To: Tyler Roscoe > Cc: cmake > Subject: Re: [CM

Re: [CMake] Relative include() calls

2009-05-28 Thread Marcel Loose
To: Tyler Roscoe Cc: cmake Subject: Re: [CMake] Relative include() calls Date: Thu, 28 May 2009 09:36:33 +0200 On Thu, May 28, 2009 at 7:16 AM, Tyler Roscoe wrote: On Wed, May 27, 2009 at 11:27:28PM -0500, Robert Dailey wrote: > From a CMakeLists.txt in my root source dir,

Re: [CMake] Relative include() calls

2009-05-28 Thread Adolfo Rodríguez
On Thu, May 28, 2009 at 7:16 AM, Tyler Roscoe wrote: > On Wed, May 27, 2009 at 11:27:28PM -0500, Robert Dailey wrote: > > From a CMakeLists.txt in my root source dir, I am calling: > > include( ../cmake/common.cmake ) > > > > From common.cmake, I am calling: > > > > include( BoostUtils.cmake ) >

Re: [CMake] Relative include() calls

2009-05-27 Thread Tyler Roscoe
On Wed, May 27, 2009 at 11:27:28PM -0500, Robert Dailey wrote: > From a CMakeLists.txt in my root source dir, I am calling: > include( ../cmake/common.cmake ) > > From common.cmake, I am calling: > > include( BoostUtils.cmake ) > > BoostUtils.cmake and common.cmake are side-by-side in the same d

[CMake] Relative include() calls

2009-05-27 Thread Robert Dailey
>From a CMakeLists.txt in my root source dir, I am calling: include( ../cmake/common.cmake ) >From common.cmake, I am calling: include( BoostUtils.cmake ) BoostUtils.cmake and common.cmake are side-by-side in the same directory on Windows. The second call to include() fails, because the working