[vtkusers] VTK 5.6.0 Cmake Errors

Scott Johnson Scott.Johnson at neuwave.com
Thu Jun 17 11:23:11 EDT 2010

Thanks John.

I changed the binaries path to be outside i:/VTK5.6.0 to i:/VTK-Build, with the same result.  The error message still calls out that it is trying to add the Utilities directory within VTK5.6.0.  That puzzles me.  Full error text is:

CMake Error at CMakeLists.txt:1251 (ADD_SUBDIRECTORY):
  add_subdirectory not given a binary directory but the given source
  directory "I:/VTK5.6.0/Utilities" is not a subdirectory of "i:/VTK5.6.0".
  When specifying an out-of-tree source a binary directory must be explicitly

I also tried deleting the cmake cache.  With the same result.

I'm not a cmake expert by any means, but the offending line in CmakeLists.txt is:

It seems that it should be adding it under i:/VTK-Build rather than i:/VTK5.6.0.  How is the root directory specified to ADD_SUBDIRECTORY?  There do seem to be a number of other directories already created in VTK-Build.  Just not Utilities.


		-- Scott

-----Original Message-----
From: John Drescher [mailto:drescherjm at gmail.com] 
Sent: Thursday, June 17, 2010 10:01 AM
To: Scott Johnson
Subject: Re: [vtkusers] VTK 5.6.0 Cmake Errors

On Thu, Jun 17, 2010 at 10:22 AM, Scott Johnson
<Scott.Johnson at neuwave.com> wrote:
> I just cracked open the vtk-5.6.0.zip file into a directory, pointed CMake at it, and tried to configure it.  I turned on BUILD_SHARED_LIBS, VTK_USE_GUISUPPORT, VTK_USE_RENDERING, VTK_WRAP_PYTHON, and VTK_WRAP_TCL.
> I'm trying to build the vtk libraries, both release and debug, to use for my development.  I haven't been able to find a source for pre-made versions of these.
> What I've done in the past is build in one directory then use the INSTALL target to move the libraries to the C:\Program Files\VTK.  I have specified to build the binaries in i:/VTK5.6.0/Binaries.  I think that qualifies as not building 'insource'.

You should set the build tree to a place outside the source in
CMake-gui. With CMake it is standard practice to do this for all
projects so this is the most tested configuration. For me it allows me
to build VTK/ITK and my applications ... for multiple compilers
(vs2005, vs2008 32 and 64 bit) with a single source folder and
separate build folders for each compiler.


More information about the vtkusers mailing list