MeshLab Source Code structure
In the src directory there are several folders containing all the source code and configuration files that allows to build MeshLab.
The source code of MeshLab is structured in the following directories:
- external: it contains a series of external libraries needed by several plugins. Some of these libraries are compiled before the compilation of meshlab, if a corresponding system library is not found and then linked; other are header-only libraries that are just included by some plugins.
- common: a series of utility functions used by MeshLab and its plugins.
- meshlab: GUI and core of MeshLab.
- meshlabserver: a tool that allows to compute mesh operations through command line
- meshlabplugins: all the plugins that can be added to MeshLab.
The following folders are used by cmake:
- cmake;
- templates.
Build MeshLab
MeshLab builds with the three major compilers: gcc, clang, and msvc. It requires Qt >= 5.12, with xmlpatterns as additional package.
After setting up the Qt environment:
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
mkdir meshlab/src/build
cd meshlab/src/build
cmake ..
make
You can also use QtCreator to build meshlab:
- Install QtCreator and Qt >= 5.12 with
xmlpatternsas additional package; - Open
CMakeLists.txtinsidesrc; - Select your favourite shadow build directory;
- Build meshlab.
MeshLab has a plugin architecture and therefore all the plugins are compiled separately; some of them are harder to be compiled. Don't worry: if a plugin fails to compile, just remove it and you lose just that functionality.
Platform specific notes
On osx some plugins exploit openmp parallelism (screened poisson, isoparametrization) so you need a compiler supporting it and the clang provided by xcode does not support openmp. You can install all the required libraries by running the following command in a terminal:
brew install llvm libomp
On Windows, we suggest to build meshlab using QtCreator. Before trying to build, you should:
- install VisualStudio >= 2017 with the C++ developement package;
- install Qt >= 5.12 and QtCreator.
then, open the CMakeLists.txt file and try to build MeshLab.