[vtk-developers] How to write the CMakeLists.txt file without INCLUDE(${VTK_USE_FILE})

Marcus D. Hanwell marcus.hanwell at kitware.com
Tue Apr 30 09:41:23 EDT 2013

On Mon, Apr 29, 2013 at 11:38 PM, Mingcheng Chen <linyufly at gmail.com> wrote:
> Hi everyone,
> For some reason I do not want INCLUDE(${VTK_USE_FILE}) in my cmake
> CMakeLists.txt.
> I use INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS}) and target_link_libraries(xxx
> ${VTK_LIBRARIES}), but it seems not enough.
I documented this on the VTK 6 migration guide (build system) linked
from the main VTK wiki page,


The missing piece (that can be taken from option 3) is
${VTK_DEFINITIONS}) which will ensure that the object factories are
initialized. Unfortunately you were not very clear on "but it seems
not enough" so I am guessing this is the part that was not enough. You
must also depend on the relevant implementation modules at this time -
such as vtkRenderingOpenGL.

Hope that helps, including the use file makes things easier but you
really don't have to do that (we expose all the relevant variables and
you can inspect the CMake code in the use file if you wish to
replicate parts that are relevant in your project).


More information about the vtk-developers mailing list