misc.docu 7.45 KB
Newer Older
Jan Möbius's avatar
Jan Möbius committed
1 2 3 4 5
//-----------------------------------------------------------------------------


/** \page naming_conventions Naming Conventions

6
The following naming conventions are used for the %OpenMesh code:
Jan Möbius's avatar
Jan Möbius committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

<b>Files:</b>
  \li \c MyClass.cc for C++-Implementation of class \c MyClass
  \li \c MyClass.hh for C++-Header of class \c MyClass

<b>Classes:</b>
  \li Class names start with a capital letter: \c MyClass
  \li Class templates end with \c T: \c MyClassTemplateT

<b>Variables:</b>
  \li One leading underscore for parameters in function-calls: \c _var
  \li One trailing underscore for member-variables: \c var_
  \li Two trailing underscores for static member-variables: \c var__

<b>Functions:</b>
  \li Words are separated by underscores: \c my_function()
		 
<b>Accessing members:</b>
  \li To get the member \c xxx_ use <tt> const& xxx() const </tt>
  \li To set the member \c xxx_ use <tt> void set_xxx(arg)  </tt>
  
**/


//-----------------------------------------------------------------------------


34
/** \page compiling Compiling OpenMesh
Jan Möbius's avatar
Jan Möbius committed
35 36 37

\section compilers Tested compilers

38
%OpenMesh has been successfully tested for the following operating
39
systems / compilers. This is only a list of tested compilers. More might be supported but are not tested.
Jan Möbius's avatar
Jan Möbius committed
40 41 42 43

<table>

<tr><td> Linux </td><td>
Jan Möbius's avatar
Jan Möbius committed
44
gcc 4.6.x<br>
45
gcc 4.7.x<br>
46
gcc 4.8.x<br>
Jan Möbius's avatar
Jan Möbius committed
47
gcc 4.9.x<br>
Jan Möbius's avatar
Jan Möbius committed
48 49
clang 3.3<br>
clang 3.4<br>
Jan Möbius's avatar
Jan Möbius committed
50 51 52 53
</td></tr>

<tr><td> Windows </td><td> 
Microsoft Visual Studio 2008<br>
Jan Möbius's avatar
Jan Möbius committed
54
Microsoft Visual Studio 2010<br>
55
Microsoft Visual Studio 2012<br>
Jan Möbius's avatar
Jan Möbius committed
56
Microsoft Visual Studio 2013<br>
57
Microsoft Visual Studio 2015<br>
Jan Möbius's avatar
Jan Möbius committed
58 59
</td></tr>

60 61
<tr><td> Tested MacOS X Compilers</td>
<td> 
62 63 64
XCode 4.3 <br>
XCode 4.4 <br>
XCode 4.5 <br>
65
XCode 5.1.1 <br>
66
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) <br>
67 68
</td></tr>

Jan Möbius's avatar
Jan Möbius committed
69 70
</table>

Jan Möbius's avatar
Jan Möbius committed
71
\section req_libs Required libraries (Only for included Apps)
Jan Möbius's avatar
Jan Möbius committed
72

Jan Möbius's avatar
Jan Möbius committed
73
Install the following external libraries / frameworks if you want to use the included Applications:<br><br>
74
<table>
75
<tr><td>Qt4/Qt5</td><td><a href="http://qt-project.org/downloads" target="_blank">http://qt-project.org/downloads</a></td></tr>
76
</table><br>
77 78 79

\section build_systems Chosing build system

80
%OpenMesh can be built using the <b>cmake</b> build system.
Jan Möbius's avatar
Jan Möbius committed
81 82
<br>
<br>
83 84

\section sec_compiling_unix Unix
85

86
\subsection linux_using_cmake Compiling OpenMesh using CMake
87

88
In order to compile %OpenMesh, create a directory named e.g. "build" in
89
OpenMesh's root directory. <b>Change to the newly created directory</b> and type
90 91 92
<br/><br/>
<tt>
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
93
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Builds the project<br>
94
</tt><br>
95 96 97 98
You can choose the build type by using cmake with the flag<br>
<b>-DCMAKE_BUILD_TYPE=(Debug|Release)</b><br>
The default is: Debug
<br>
Mike Kremer's avatar
Mike Kremer committed
99 100
Other flags are:<br/>
<b>-DBUILD_APPS=OFF</b> to disable build of applications and<br/>
101
<b>-DCMAKE_INSTALL_PREFIX=&lt;path&gt;</b> to specify the install path.
Mike Kremer's avatar
Mike Kremer committed
102
<br/>
103
When calling <b>make install</b> cmake will install %OpenMesh into this
Mike Kremer's avatar
Mike Kremer committed
104 105 106
directory using the subdirectories lib/include/bin.

CMake builds both shared and static under Linux.
107 108

Everything will then be build in the <b>Build</b> subdirectory containing the libraries in <b>lib</b> and the binaries in <b>bin</b>.
109 110 111 112

There are some additional targets:<br>
<b>doc</b>: Builds the Documentation<br>
<b>doc-install</b>: Builds the Documentation and installs it<br>
113
<br>
Jan Möbius's avatar
Jan Möbius committed
114 115
\note When you link against the static libraries of OpenMesh and get the error "can not be used when making a
shared object; recompile with -fPIC" you need to add "-fPIC" to the CMAKE_CXX_FLAGS. (This is usually added automatically)
116

Jan Möbius's avatar
Jan Möbius committed
117 118
\section sec_compiling_windows Windows

119
\subsection windows_using_cmake Compiling OpenMesh using CMake
120 121 122

If you want to use cmake to build your Visual Studio 2008 solution file,<br>
download and install CMake from <a href="http://www.cmake.org/cmake/resources/software.html">www.cmake.org</a>.<br>
123
(Note: This is not mandatory since there are already VS2008 solution files included in %OpenMesh).<br><br>
124
<ul>
Jan Möbius's avatar
Jan Möbius committed
125
<li> Get Visual Studio ( 2008-2013 ) </li>
126
<li> Extract %OpenMesh source code. </li>
127
<li> Get all required libraries and install them ( including headers! ).</li>
128
<li> Get cmake for windows from http://www.cmake.org/cmake/resources/software.html </li>
129
<li> Start the cmake gui and open the %OpenMesh toplevel directory as source directory </li>
130 131
<li> Choose a build directory (e.g. create a directory called "build" in OpenMesh's root folder) </li>
<li> Click on configure .... If any libraries are left unconfigured, you can adjust the path manually. Rerun configure until everything is configured correctly.
Jan Möbius's avatar
Jan Möbius committed
132
     Attention: Some build variables are only visible in advanced view mode. Select Visual Studio 9 (2008), Visual Studio 10(2010), Visual Studio 11 (2012), Visual Studio 12 (2013)  (Depending on your version) as
133
     generator. </li>
134
<li> Click generate to create the visual studio project files </li>
135
<li> You can now find a Visual Studio solution file (OpenMesh.sln) in the <b>build</b> directory you chose in cmake </li>
136
<li> Now you can build %OpenMesh from within Visual Studio using the newly created project file. </li>
137 138
</ul>

139
Note: Set the CMAKE_BUILD_TYPE variable to "Release" if you want %OpenMesh to be built as release.
Jan Möbius's avatar
Jan Möbius committed
140
In Visual Studio choose "Release" in the appropriate select box and build the solution afterwards.
141

Jan Möbius's avatar
Jan Möbius committed
142 143 144
<br>
<br>

145
\section sec_compiling_macosx MacOS X
Jan Möbius's avatar
Jan Möbius committed
146

147
Download and install required libraries as stated above.
148 149 150 151 152 153
You can download %OpenMesh's sources from <tt>www.openmesh.org</tt> or check out the latest repository via SVN:<br/>
<tt>svn co http://www.openmesh.org/svnrepo/OpenMesh/trunk %OpenMesh</tt>.<br/><br/>

\subsection mac_using_cmake Compiling OpenMesh using CMake

We recommend you to use CMake >= 2.8 as build system. This can also easily be installed
Jan Möbius's avatar
Jan Möbius committed
154
via MacPorts as well as the Qt >= 4.7 library which is used for some example applications
155 156 157 158 159
in %OpenMesh.<br/>
Once installed, change to %OpenMesh's root directory and create a directory
named e.g. "buildDebug" (assuming you want to build with debug symbols).<br/>
Then type in the following command to initially set up the build environment:
<br/><br/>
160
<tt>
161
cmake&nbsp;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Generates the appropriate Makefiles<br>
162
</tt>
163 164 165 166
<br/>
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:
167 168
<br/><br/>
<tt>
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
ccmake&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Configure build environment<br>
</tt>
<br/>
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:
<br/><br/>
<tt>
make&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Build %OpenMesh<br>
</tt>
<br/>
And optionally:
<br/><br/>
<tt>
make&nbsp;doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## Build %OpenMesh's documentation<br>
</tt>
<br>
185 186 187
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.).

Mike Kremer's avatar
Mike Kremer committed
188 189
CMake builds both shared and static under MacOS X.

Jan Möbius's avatar
Jan Möbius committed
190 191 192 193
**/


//-----------------------------------------------------------------------------