[ITK Community] ITK build: ITK build directory path length is too long (56 > 50) - Seriously? - what I would not give to trim 6 chars from my path.

Luis Ibanez luis.ibanez at kitware.com
Mon Dec 16 17:06:11 EST 2013


Brian,

We understand that this is both annoying and inconvenient, but unfortunately
it is outside of ITK's control, since it is really the consequence of a
limitation
in Visual Studio.

As Matt pointed out, the warning is an accurate one, and saves you from some
pains later in the process.

As  Andras also pointed out, Visual Studio will silently truncate the
command
line without giving you any warning. The result would be that: Include
directories,
or Link directories will be silently excluded from the built lines, and
then you will
received compilation or link error messages that would be hard to interpret
and/or
resolve.

Note that the problem happens because source and build paths appear many
times in the Visual Studio project file.

To make more sense of the source of the problem, you may find useful to open
the Visual Studio projects into a text editor and see how many times the
paths
are composed into the build rules.



All that said, one intermediate, palliative option is to:

1) Build ITK in a very short path.

         E.g. C:\ITK-4.5

    could be a good option.

Then once it finishes building,

2) Install it in a destination directory,
    which can be a bit longer.

3) Build your application against this installed ITK.


The advantage of doing this installation, is that the header files will all
be put
in a single directory, and then the full set of directories that have to be
passed
to an application will be smaller.

Note that even in this case, the destination directory path shouldn't be
too long, since then you would have transferred the Visual Studio
limitation from the ITK build to the build of your project, where you
are using ITK.



  Regards,

       Luis


On Mon, Dec 16, 2013 at 10:34 AM, Brian Davis <bitminer at gmail.com> wrote:

> After trying to build latest version of ITK I ran into this build issue
>
> CMake Error at CMakeLists.txt:28 (message):
>   ITK build directory path length is too long (56 > 50).Please set the ITK
>   build directory to a directory with a shorter path.
>
> Where I have specified:
>
> Source code:
> C:\projects\dsa4d\ctutil_3rdParty\source\itk-4.4.2
> Build the binaries
> C:/projects/dsa4d/ctutil_3rdParty/source/itk-4.4.2/build
>
> Which I do not think is unreasonable for a path when I want a projects
> dir, project name dir, and branch name dir.  But whoa was I ever wrong.
>
> After reading the filed bug:
>
> http://www.cmake.org/Bug/view.php?id=14262
>
> which was posted in 2013... pretty recent considering that I have build
> ITK in paths much worse that above and it worked just fine.
>
> I am left in dumbfounded amazement that this bug was closed with reason:
>
> >> ======
> The error message comes from CMakeLists.txt code in ITK, not from CMake.
>
> Furthermore, the limit comes from path lengths used within ITK's source
> and build trees that exceed the Windows maximum path length limit (VS hits
> these internally during the build). You simply can't build ITK in a longer
> path.
>
> Either way, this is not a CMake issue so I'm resolving it as "no change
> required".
> >> ======
>
> Well we simply built it prior 2013 in longer paths so it simply can be
> built!  What changed?
>
> Wow that's great!  Should I change my path to C:\  ???  .... I am going to
> get on that right now.
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131216/1a50a634/attachment.html>


More information about the Community mailing list