VTK/Configure and Build: Difference between revisions
No edit summary |
No edit summary |
||
Line 117: | Line 117: | ||
====On Windows==== | ====On Windows==== | ||
We recommend [http://code.google.com/p/msysgit msysgit]. msysgit provides an msys shell that has the appropriate environment set up for using git and its tools. | We recommend [http://code.google.com/p/msysgit msysgit]. msysgit provides an msys shell that has the appropriate environment set up for using git and its tools. | ||
</div> | |||
|} | |||
=Configure VTK with CMake= | |||
* Always use a <font color="red">'''separate build directory'''</font>. Do not build in the source directory. | |||
{| cellspacing="3" | |||
|- valign="top" | |||
|width="50%" class="MainPageBG" style="border: 1px solid #ffc9c9; color: #000; background-color: #fff3f3"| | |||
<div style="padding: .4em .9em .9em"> | |||
===On Unix-like systems=== | |||
* Use ccmake (Curses CMake GUI) from the CMake installed location. CCMake is a Curses based GUI for CMake. To run it go to the build directory and specify the VTK source directory as an argument. | |||
<pre> | |||
mkdir $HOME/projects/VTK-build | |||
cd $HOME/projects/VTK-build | |||
ccmake $HOME/projects/VTK | |||
</pre> | |||
[[Image:Vtk-ccmake.png|400px]] | |||
===About CCMake (Curses CMake GUI)=== | |||
* Iterative process. | |||
** Select values, run configure (c key). | |||
** Set the settings, run configure, set the settings, run configure, etc. | |||
* Repeat until all values are set and the generate option is available (g key). | |||
* Some variables (advanced variables) are not visible right away. | |||
* To see advanced varables, toggle to advanced mode (t key). | |||
* To set a variable, move the cursor to the variable and press enter. | |||
** If it is a boolean (ON/OFF) it will flip the value. | |||
** If it is string or file, it will allow editing of the string. | |||
** For file and directories, the <nowiki><tab></nowiki> key can be used to complete. | |||
* To search for a variable press '/' key; to repeat the search, press the 'n' key. | |||
</div> | |||
|width="50%" class="MainPageBG" style="border: 1px solid #c6c9ff; color: #000; background-color: #f0f0ff"| | |||
<div style="clear: right; text-align: left; float: right; padding: .4em .9em .9em"> | |||
===On Windows=== | |||
* Use CMakeSetup from the CMake install location. | |||
* Make sure to select the appropriate source and the build directory. | |||
* Also, make sure to pick the appropriate generator. Some CMake versions will ask you to select the generator the first time you press Configure instead of having a drop-down menu in the main dialog. | |||
[[Image:Vtk-cmake-gui.png|400px]] | |||
===About CMake GUI=== | |||
* Iterative process. | |||
** Select values, press the Configure button. | |||
** Set the settings, run configure, set the settings, run configure, etc. | |||
* Repeat until all values are set and the OK button becomes available. | |||
* Some variables (advanced variables) are not visible right away. | |||
* To see advanced varables, toggle to advanced mode ("Show Advanced Values" toggle). | |||
* To set the value of a variable, click on that value. | |||
** If it is boolean (ON/OFF), a drop-down menu will appear for changing the value. | |||
** If it is file or directory, an ellipsis button will appear ("...") on the far right of the entry. Clicking this button will bring up the file or directory selection dialog. | |||
** If it is a string, it will become an editable string. | |||
</div> | </div> | ||
|} | |} |
Revision as of 18:43, 30 April 2014
Introduction
Hello! Welcome to the wiki.
This page is applicable for VTK 6.0 and above. For earlier versions, refer to a deprecated version of this document.
This page describes how to configure and build VTK, with several popular options turned on.
Prerequisites
- The VTK build process requires CMake version 2.8.8 or higher and a working compiler. On Unix-like operating systems, it also requires Make, while on Windows it requires Visual Studio (8 or later).
- Building VTK with Qt is a common use case for the creation of nice user interfaces. Using Qt 4.8.* is recommended, but earlier versions and Qt 5.* are in various stages of support. Visit the Qt download page to get a copy of the source code or installer. Either the LGPL or commercial versions of Qt may be used.
Download And Install CMake
CMake is a tool that makes cross-platform building simple. If CMake does not exist on the system, and there are no pre-compiled binaries, use the instructions below on how to build it. Use the most recent source or binary version of CMake from the CMake web site.
Using Binaries
There are several precompiled binaries available at the CMake download page.
On Unix-like operating systemsLet's say on Linux, download the appropriate version and follow these instructions: cd $HOME wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2-Linux-i386.tar.gz mkdir software cd software tar xvfz ../cmake-2.8.12.2-Linux-i386.tar.gz
|
On Windows
On Windows, if you are not administrator
|
Build Your Own CMake
On Unix-like operating systemsDownload the source code: http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz cd $HOME wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz tar xzf cmake-2.8.12.2.tar.gz cd cmake-2.8.12.2 ./configure --prefix=$HOME/software make make install
|
On WindowsTo build CMake on windows, a previous version of CMake is required. This can be downloaded from the Cmake download page: [1]. |
Download VTK Source code
Download a Release
Download a VTK release from the VTK Downloads page.
Checkout the VTK Repository with Git
If you want the nightly updates of VTK, this is your best bet. Checking out from source control also greatly facilitates the process of contributing back. Note that you may need to download and install a git client, here: [2]
On Unix-like operating systemsPrepare directory for download # mkdir $HOME/projects # cd $HOME/projects To download the source code # git clone git://vtk.org/VTK.git # cd VTK To update the code # git fetch origin # git rebase origin/master |
On WindowsWe recommend msysgit. msysgit provides an msys shell that has the appropriate environment set up for using git and its tools. |
Configure VTK with CMake
- Always use a separate build directory. Do not build in the source directory.
On Unix-like systems
mkdir $HOME/projects/VTK-build cd $HOME/projects/VTK-build ccmake $HOME/projects/VTK About CCMake (Curses CMake GUI)
|
On Windows
About CMake GUI
|