[vtkusers] RE: How to get the Examples to compile in Linux

Leon Chen liming.leon at gmail.com
Mon Jul 11 23:02:02 EDT 2005


What you need to do is not write the makefile, just write CMakeLists.
Then you can use Cmake process the CMakeLists.txt, and type 'make',
then the executeable file will be generated. Type the file name to run
the programm.

In linux, you can use 'cmake' to run a command line version cmake.
or 'ccmake' to run a interactive version of it. Acturally it is quite
similar as it in windows.

Here is a 'mini' CMakeLists example

INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)



*Step1 is the name of the project, for some IDE, such as msvc
*ADD executable will generate the bin file to run
*TARGET LINK is very important to link the necessary library to the
program. Here is vtkRendering

notice that the cmakelist file should be same both in the windows and
linux.  However, of course... the format of the file path is
different... and so on. I think you can figure it out.

good luck

More information about the vtkusers mailing list