Skip to content

Commit

Permalink
fixes and new readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Oct 22, 2020
1 parent 09203c1 commit fe6edde
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 54 deletions.
9 changes: 5 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ option(
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

### Bundled dependencies in the "external" directory
set(EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
include(${EXTERNAL_DIR}/external.cmake)

### Install directories and build/staging directories
MESSAGE( STATUS "CMAKE_INSTALL_PREFIX: " ${CMAKE_INSTALL_PREFIX} )
include(GNUInstallDirs)
if(INSTALL_TO_UNIX_LAYOUT)
set(MESHLAB_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
Expand Down Expand Up @@ -113,6 +110,10 @@ set(MESHLAB_SAMPLE_OUTPUT_DIR ${MESHLAB_BUILD_DISTRIB_DIR}/sample)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${MESHLAB_BUILD_DISTRIB_DIR})

### Bundled dependencies in the "external" directory
set(EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
include(${EXTERNAL_DIR}/external.cmake)

### Common build settings for internal code
include_directories(${VCGDIR} ${CMAKE_CURRENT_SOURCE_DIR})

Expand Down
66 changes: 20 additions & 46 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,50 @@
# MeshLab Source Code structure

In the `src` folder there are several folders containing all the source code and configuration files that allows to compile MeshLab.
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 folders:
The source code of MeshLab is structured in the following directories:

* [external](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/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; some other libraries are just included by some plugins.
* [external](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/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](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/common): a series of utility functions used by MeshLab and its plugins.
* [meshlab](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlab): GUI and core of MeshLab.
* [meshlabserver](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabserver): a tool that allows to compute mesh operations through command line
* [meshlabplugins](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/meshlabplugins): all the plugins that can be added to MeshLab.

The following folders are used by `cmake`:

* cmake;
* templates.

There are also two folders that contains MeshLab plugins that are no longer supported or are experimental, and these plugins are not compiled in any of MeshLab configurations:

* plugins_experimental;
* plugins_unsupported.

## Compiling MeshLab

MeshLab compiles with the three major compilers: `gcc`, `clang`, and `msvc`.
## Build MeshLab

MeshLab requires [Qt](https://www.qt.io/) >= 5.9, with `xmlpatterns` as additional package.
MeshLab builds with the three major compilers: `gcc`, `clang`, and `msvc`. It requires [Qt](https://www.qt.io/) >= 5.12, with `xmlpatterns` as additional package.

After setting up the Qt environment:

git clone --recursive https://github.com/cnr-isti-vclab/meshlab
cd meshlab/src
qmake
make

Then, a meshlab executable can be found inside the `distrib` folder.

You can also use `cmake`:
mkdir meshlab/src/build
cd meshlab/src/build
cmake ..
make

git clone --recursive https://github.com/cnr-isti-vclab/meshlab
cd meshlab
cmake src/
make

You can also use [QtCreator](https://www.qt.io/product) to build meshlab:

1. Install QtCreator and Qt >= 5.9 with `xmlpatterns` as additional package;
2. Open `meshlab.pro` inside `src`;
1. Install QtCreator and Qt >= 5.12 with `xmlpatterns` as additional package;
2. Open `CMakeLists.txt` inside `src`;
3. Select your favourite shadow build directory;
4. Before the build, deactivate the `QtQuickCompiler` option from the qmake call in the project options;
5. 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. As a first step you should try to compile MeshLab with the configuration "meshlab_mini":

qmake "CONFIG+=meshlab_mini"
make

This configuration contains the info for building meshlab with a minimal set of plugins.
4. Build meshlab.

Some plugins of MeshLab need external libraries. All the required libraries are included in the `meshlab/src/external` folder, that are automatically compiled before MeshLab in all its configurations.
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. Qmake is configured in order to look for the `clang` compiler that is automatically installed by `homebrew`, calling:
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 __Linux__, you may optionally choose to use your system installs of some libraries rather than the bundled versions.
The library name, argument to add to all `qmake` calls (e.g. by adding to `QMAKE_FLAGS` in the example below), and Debian package name are listed below:
On __Windows__, we suggest to build meshlab using QtCreator. Before trying to build, you should:

* Eigen3 (at least 3.2) - `CONFIG+=system_eigen3` - package `libeigen3-dev`
* GLEW (version 2 or newer) - `CONFIG+=system_glew` - package `libglew-dev`
* lib3ds - `CONFIG+=system_lib3ds` - package `lib3ds-dev`
* OpenCTM - `CONFIG+=system_openctm` - package `libopenctm-dev`
* BZip2 - `CONFIG+=system_bzip2` - package `libbz2-dev`
* install VisualStudio >= 2017 with the C++ developement package;
* install Qt >= 5.12 and QtCreator.

The versions found in Debian Buster are all new enough to meet these requirements.
then, open the CMakeLists.txt file and try to build MeshLab.
6 changes: 3 additions & 3 deletions src/external/u3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ ENDIF(STDIO_HACK)

#====

MESSAGE( STATUS "CMAKE_INSTALL_PREFIX: " ${CMAKE_INSTALL_PREFIX} )


INCLUDE_DIRECTORIES(
${U3D_DIR}/src/RTL/Component/Include
Expand Down Expand Up @@ -1481,8 +1479,10 @@ IF(APPLE)
# LINK_FLAGS "${MY_LINK_FLAGS} -exported_symbols_list /dev/null" )
ENDIF(APPLE)
IF(UNIX AND NOT APPLE)
ADD_LIBRARY( external-IDTFConverter SHARED ${IDTFConverter_SRCS} ${IDTFConverter_HDRS} )
ADD_LIBRARY( external-IDTFConverter STATIC ${IDTFConverter_SRCS} ${IDTFConverter_HDRS} )
ENDIF(UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES( external-IDTFConverter IFXCoreStatic ${ADDITIONAL_LIBRARIES} ${CMAKE_DL_LIBS} )

set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)

install(TARGETS IFXCore IFXCoreStatic IFXExporting IFXScheduling external-IDTFConverter DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
2 changes: 1 addition & 1 deletion src/meshlabplugins/io_u3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if(TARGET external-IDTFConverter)

target_link_libraries(io_u3d PUBLIC common)

target_link_libraries(io_u3d PUBLIC external-IDTFConverter ${CMAKE_DL_LIBS})
target_link_libraries(io_u3d PUBLIC external-IDTFConverter IFXCoreStatic ${CMAKE_DL_LIBS})

set_property(TARGET io_u3d PROPERTY FOLDER Plugins)

Expand Down

0 comments on commit fe6edde

Please sign in to comment.