[vtk-developers] Missing Includes with new module system

Bill Lorensen bill.lorensen at gmail.com
Thu Jan 10 17:08:28 EST 2019


I have a simple program that fails to find the vtk include files:
Here is the CMakeLists.txt fiile:
cmake_minimum_required(VERSION 3.8)

PROJECT(ReadOBJ)
Find_package(VTK)
if (VTK_VERSION VERSION_LESS "8.90")
  # old system
  include(${VTK_USE_FILE})
  # modules are linked via `vtkCommonCore`
  # VTK_DEFINITIONS has autoinit information
else ()
  # modules are linked via `VTK::CommonCore`
  # vtk_module_autoinit is needed
endif ()

add_executable(ReadOBJ MACOSX_BUNDLE ReadOBJ.cxx )
target_link_libraries(ReadOBJ ${VTK_LIBRARIES})

The source file is here:
https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/Cxx/IO/ReadOBJ.cxx

I get the error:
[build] cmake -DVTK_DIR:PATH=/Users/lorensen/ProjectsGIT/VTKNewModules-clang/lib/cmake/vtk-8.90/
..
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/ReadOBJ/build
[build] make
[ 50%] Building CXX object CMakeFiles/ReadOBJ.dir/ReadOBJ.cxx.o
/tmp/ReadOBJ/ReadOBJ.cxx:1:10: fatal error: 'vtkOBJReader.h' file not found
#include <vtkOBJReader.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/ReadOBJ.dir/ReadOBJ.cxx.o] Error 1
make[1]: *** [CMakeFiles/ReadOBJ.dir/all] Error 2
make: *** [all] Error 2
[build] cmake --version
cmake version 3.10.3


-- 
Unpaid intern in BillsParadise at noware dot com


More information about the vtk-developers mailing list