[CMake] Can't find INCLUDE file...
rnelias
rnelias at nacad.ufrj.br
Mon Sep 24 08:42:30 EDT 2007
Hi folks, I'm having a problem that seems to be very simple...
I'm trying to compile a program which INCLUDES the following headers
//--------------------------------------------------
#include "vtkGenericEnsightReader.h"
#include "vtkXMLDataSetWriter.h"
#include "vtkDataArrayCollection.h"
#include "vtkDataArray.h"
#include "getpot.h"
...
//--------------------------------------------------
Note that only getpot is not a VTK include.
In order to compile this program I'm using the following CMakeLists.txt
//--------------------------------------------------
PROJECT (ens2vtk)
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
ADD_EXECUTABLE(ens2vtk ens2vtk.cxx getpot.h) TARGET_LINK_LIBRARIES(ens2vtk
vtkIO)
//--------------------------------------------------
This CMakeLists.txt was copied from that Tutorial directory since the
program that I'm trying to compile is very very simple (just convert an
Ensight file in a VTK XML based one). On Windows systems the CMakeLists file
above works perfectly but on Unix systems I get the error message:
venus ens2vtk/build> make
Scanning dependencies of target ens2vtk
[100%] Building CXX object CMakeFiles/ens2vtk.dir/ens2vtk.o
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:14:37: error:
vtkGenericEnsightReader.h: No such file or directory
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:26: error: variable or
field 'GetTimes' declared void
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:26: error:
'vtkGenericEnSightReader' was not declared in this scope
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:26: error: 'reader' was
not declared in this scope
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:26: error: expected
primary-expression before '&' token
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:26: error: 'times' was
not declared in this scope
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:26: error: initializer
expression list treated as compound expression
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:27: error: expected ','
or ';' before '{' token
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx: In function 'int
main(int, char**)':
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:98: error:
'vtkGenericEnSightReader' was not declared in this scope
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:98: error: 'reader' was
not declared in this scope
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:98: error:
'vtkGenericEnSightReader' is not a class or namespace
/home/nacad/rnelias/kitware/ens2vtk/src/ens2vtk.cxx:127: error: 'GetTimes'
cannot be used as a function
make[2]: *** [CMakeFiles/ens2vtk.dir/ens2vtk.o] Error 1
make[1]: *** [CMakeFiles/ens2vtk.dir/all] Error 2
make: *** [all] Error 2
OK, VTK_DIR is pointing to the correct place, so I thought CMake would be
able to realize that vtkGenericEnsightReader.h IS a VTK include and set the
paths correctly.
I already tried to put a INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIR}) but It
won't work either. What could be happening?
Thanks in advance
Renato.
More information about the CMake
mailing list