OpenMesh

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Compiling OpenMesh

# Tested compilers

OpenMesh has been successfully tested for the following operating systems / compilers:

Linux | gcc 4.0.x gcc 4.1.x gcc 4.2.x gcc 4.3.x gcc 4.4.x gcc 4.5.x gcc 4.6.x gcc 4.7.x
Windows | Microsoft Visual Studio 2008 Microsoft Visual Studio 2010
MacOS X (Panther,Tiger,Leopard,Snow Leopard) | gcc 4.0 gcc 4.2
MacOS X (Snow Leopard),... with clang | XCode 4.3 XCode 4.4 XCode 4.5

# Required libraries (Only for included Apps)

Install the following external libraries / frameworks if you want to use the included Applications:

Qt4 | http://www.qtsoftware.com/downloads

# Chosing build system

OpenMesh can be built using the cmake build system.

# Unix

## Compiling OpenMesh using CMake

In order to compile OpenMesh, create a directory named e.g. "build" in OpenMesh's root directory. Change to the newly created directory and type
`cmake .. ## Generates the appropriate Makefiles
make ## Builds the project
`
You can choose the build type by using cmake with the flag
-DCMAKE_BUILD_TYPE=(Debug|Release)
The default is: Debug
Other flags are:
-DBUILD_APPS=OFF to disable build of applications and
-DCMAKE_INSTALL_PREFIX=<path> to specify the install path.
When calling make install cmake will install OpenMesh into this directory using the subdirectories lib/include/bin.

CMake builds both shared and static under Linux.

Everything will then be build in the Build subdirectory containing the libraries in lib and the binaries in bin.

There are some additional targets:
doc: Builds the Documentation
doc-install: Builds the Documentation and installs it

# Windows

## Compiling OpenMesh using CMake

If you want to use cmake to build your Visual Studio 2008 solution file,
download and install CMake from www.cmake.org.
(Note: This is not mandatory since there are already VS2008 solution files included in OpenMesh).

- Get Visual Studio 2008 or 2010
- Extract OpenMesh source code.
- Get all required libraries and install them ( including headers! ).
- Get cmake for windows from http://www.cmake.org/cmake/resources/software.html
- Start the cmake gui and open the OpenMesh toplevel directory as source directory
- Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder)
- Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly. Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 2008 or Visual Studio 10 (Depending on your version) as generator.
- Click generate to create the visual studio project files
- You can now find a Visual Studio solution file (OpenMesh.sln) in the build directory you chose in cmake
- Now you can build OpenMesh from within Visual Studio using the newly created project file.

Note: Set the CMAKE_BUILD_TYPE variable to "Release" if you want OpenMesh to be built as release. In Visual Studio choose "Release" in the appropriate select box and build the solution afterwards.

# MacOS X

Download and install required libraries as stated above. You can download OpenMesh's sources from `www.openmesh.org` or check out the latest repository via SVN:
`svn co http://www.openmesh.org/svnrepo/OpenMesh/trunk OpenMesh`.

## Compiling OpenMesh using CMake

We recommend you to use CMake >= 2.8 as build system. This can also easily be installed via MacPorts as well as the Qt >= 4.7 library which is used for some example applications in OpenMesh.
Once installed, change to OpenMesh's root directory and create a directory named e.g. "buildDebug" (assuming you want to build with debug symbols).
Then type in the following command to initially set up the build environment:
`cmake .. ## Generates the appropriate Makefiles
`
Note: If the build directory is not a subdirectory of OpenMesh's root folder, replace ".." with OpenMesh's absolute (or relative) path. In order to manually set specific build variables, just type:
`ccmake . ## Configure build environment
`
This opens the CMake configure tool. Change the CMAKE_BUILD_TYPE variable to "Release" in order to prepare build for release configuration. Now, when everything is set up, just type:
`make ## Build OpenMesh
`
And optionally:
`make doc ## Build OpenMesh's documentation
`
The mac application bundle will be found under "Build" in the recently created build folder. It automatically contains all needed shared objects (libs, fonts, textures, etc.).

CMake builds both shared and static under MacOS X.