[CMake] Ability to tell if it is a relative path

James Bigler jamesbigler at gmail.com
Tue Mar 10 18:57:52 EDT 2009


On Tue, Mar 10, 2009 at 3:54 PM, Tristan Carel <tristan.carel at gmail.com>wrote:

> On Tue, Mar 10, 2009 at 23:42, James Bigler <jamesbigler at gmail.com> wrote:
> > Is there a way to discover if a path is a relative path or not?
> >
> > I need to make sure that all paths are absolute for a given application,
> and
> > I can be given either relative or absolute paths to files.  If I'm given
> a
> > relative path I want to prepend ${CMAKE_CURRENT_SOURCE_DIR} to make it
> > absolute, but if it's already absolute, I don't want to add anything.
>
> Hi James,
>
> by grep"ping" `absolute' is the CMake documentation, you find:
>
> if(IS_ABSOLUTE path)
> True if the given path is an absolute path.
>
> Cheers
> --
> Tristan Carel


That's rather embarrassing that I missed that.  I thought I search the docs
for something like that.  Oh, well.  Thanks for the quick reply.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090310/e794103c/attachment.htm>


More information about the CMake mailing list