[CMake] Let CMake convert CMAKE_MODULE_PATH to absolute path

Marcel Loose loose at astron.nl
Mon Sep 7 04:12:03 EDT 2009


On Fri, 2009-09-04 at 21:48 +0200, Alexander Neundorf wrote:
> On Tuesday 25 August 2009, Marcel Loose wrote:
> > Hi all,
> >
> > I've been bitten by this more than once. When specifying a module path
> > on the command line, you must not forget to make this an absolute path,
> > otherwise calling a macro from a (CMakeLists.txt file in a) subdirectory
> > will fail.
> >
> > Would it be an idea to let CMake always convert a relative module path
> > to an absolute path, before putting it in the cache?
> 
> Hmm, that would be special handling for that one variable.
> I guess it should be interpreted as relative to CMAKE_BINARY_DIR ? Wouldn't it 
> be confusing if this one variable would be handled differently than all 
> others ?
> 
> Alex

Well, I don't know how many variables might be affected by this. Maybe
it's breaking more things that it's supposed to fix. I was just
wondering, because I ran into this problem more than once. Besides, you
do not have to specify the absolute path to the CMakeLists.txt file
you're feeding to cmake (I agree, though, that that's not exactly the
same thing.)

Best regards,
Marcel Loose.






More information about the CMake mailing list