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