[Insight-developers] compilation error with msvc 8.0

Brad King brad.king at kitware.com
Mon Jun 18 11:00:09 EDT 2012


On 06/18/2012 09:40 AM, Arnaud Gelas wrote:
>      http://www.itk.org/pipermail/insight-developers/2011-March/017812.html
> 
> These errors occurred with a recent version of cmake (2.8.8), so I am a 
> little confused here.

The underlying problem is that VS does this with a relative path:

  c:\path\to\directory\with\project\file\..\..\..\relative\path\on\top\of\that\to\source.cpp

and then fails when the total string is over 250 characters or so
even though the collapsed full path would be well under the limit.

This is only a problem when CMake stores relative paths in the
project files, but we normally prefer full paths.  AFAIK for
VS 8 CMake stores relative paths under only two circumstances:

(1) The unsupported option CMAKE_USE_RELATIVE_PATHS is on.

(2) The sequence of "..\" is not long enough to escape the
    top-level of the build tree (CMAKE_BINARY_DIR).

Is either of these the case for your build?

----------------------------------------------------------------------
FYI, the fix referenced in the thread you linked was for VS 10 only:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ed0075bd

There is a lot more to it as covered here:

 http://www.cmake.org/Bug/view.php?id=12570

but that should not affect VS 8.  There is extra trouble with VS 10
because it has one bug for relative paths and another bug for full
paths.

-Brad


More information about the Insight-developers mailing list