The one you are searching for is -prefix=dir. exclude-subdir exclude the cmake-3.11.3-Linux-x86_64 subdirectory include-subdir include the cmake-3.11.3-Linux-x86_64 subdirectory prefix=dir directory in which to install The script has the following options: # cmake-3.11.3-Linux-x86_64.sh -help Note: You need to uninstall any package manager installed CMake packages first # sudo apt remove cmake In short, call (installation path for CMake here is /usr/local): # sudo cmake-3.11.3-Linux-x86_64.sh -skip-license -exclude-subdir -prefix=/usr/local The documentation how to use it is admittedly a little sparse. Note that this documentation contains many, many files.I assume you downloaded the script from CMake's Download Page. The first command invokes cmake to create the makefile which make uses to compile the program.įor more information about cmake, refer to Kitware's online page.įor online documentation, browse VTK online documentation.įor offline documentation, download the html documentation from VTK website. In this example, the name of the source file is test1.cpp and the names of the project and the executable are test1.Īfter creating CMakeLists.txt, compile the program as follows: TARGET_LINK_LIBRARIES(test1 vtkRendering) This file contains information that tells cmake how to generate the required make file. Go to the directory that contains the program, create the file CMakeLists.txt. This method can also be used to compile VTK programs without Qt.Īnother way to compile VTK program by itself is as follows. To compile VTK with Qt, refer to Compiling Qt and VTK. To identify the library file that contains a class function, e.g., vtkColorTransferFunction, download this script file, save it, e.g., as findlib and change its mode to executable:įor more information, refer to VTK 6 Migration Guide. Rendering/Core, which corresponds to libvtkRenderingCore.so. The name of the folder that contains vtkActor.h is the name of the library, in this case. To identify the library file that contains a class, e.g., vtkActor, search vtkActor.h in the VTK source folders. VTK 6 also requires explicit linking of additional libraries that are not necessary in VTK 5 such as libvtkCommonColor.so, libvtkCommonSystem.so, etc. #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL) If you are using VTK 6.0 or 6.1, then inlcude the following before including any VTK header files:Ĥ(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL) This will initialise vtkRenderingOpenGL object factories. To resolve this problem, add the following at the top of main.cpp, the file that contains main(): This is because the factory methods of VTK 6 require explicit initialisation. " and a NULL pointer when it calls New() function of a module. If your VTK 6.2 code is not compiled with cmake, it may get the error "no override found for. To generate symbolic links of the convenient names to the library files, download this script and run it in the folder that contains the library files. A more convenient naming convetion is simply libvtk*.so. This naming convention is inconvenient to use. The libraries are named as libvtk*-6.2.so.1. To be consistent, you can create a directory /usr/local/lib/vtk-6.2 and move the library files into this directory. h files are installed in /usr/local/include/vtk-6.2 and the library files are installed in /usr/local/lib. Then, create a release directory, e.g., /opt/VTK-6.2, and, generate the Makefile:Ĭmake -DCMAKE_BUILD_TYPE:STRING=Release /home/me/Downloads/VTK-6.2.0 Type "c" one or more times until no errors occur. You can also change the install prefix, which defaults to /usr/local. Then, select the options you like, e.g., turning on Suppose the unzipped source directory is /home/me/Downloads/VTK-6.2.0.Ĭreate a separate build directory, eg., /opt/VTK-build.: Download VTK 6 source from download site into a local directory and unzip it.
0 Comments
Leave a Reply. |