Skip to content

Commit

Permalink
Merge pull request #504 from rpavlik/build-improvements
Browse files Browse the repository at this point in the history
Build improvements
  • Loading branch information
alemuntoni authored Nov 29, 2019
2 parents 8850dea + c61384e commit 3c6d6bf
Show file tree
Hide file tree
Showing 25 changed files with 128 additions and 79 deletions.
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ addons:
- qt512xmlpatterns
- mesa-common-dev
- libglu1-mesa-dev
- lib3ds-dev
- libglew-dev
- libeigen3-dev
- libopenctm-dev
- libbz2-dev
homebrew:
packages:
- llvm
Expand Down Expand Up @@ -70,6 +75,19 @@ script:
- cd ..
- qmake meshlab_full.pro
- make -j4
# On linux, rebuild using system libs.
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
make clean
cd external
make clean
qmake CONFIG+=system_eigen3 CONFIG+=system_glew CONFIG+=system_lib3ds CONFIG+=system_openctm CONFIG+=system_bzip2
make -j4
cd ..
qmake CONFIG+=system_eigen3 CONFIG+=system_glew CONFIG+=system_lib3ds CONFIG+=system_openctm CONFIG+=system_bzip2 meshlab_full.pro
make -j4
fi
after_success:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
Expand Down
13 changes: 12 additions & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ Once you have the required lib (check for lib files in the folder `meshlab/src/e
### 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. Install 'clang++-mp-3.9' using macport or modify the .pro accordingly.

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:

* 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`

The versions found in Debian Buster are all new enough to meet these requirements.

###### Ubuntu 16 Compilation example
* Make sure you selected the correct version of Qt: `qmake -v`. You can use `qtchooser -l` to list the versions and if in doubt use the direct path to your qmake binary.
* Clone repositories:
Expand All @@ -45,7 +56,7 @@ git clone --depth 1 [email protected]:cnr-isti-vclab/vcglib.git -b devel
cd meshlab
```
* Set build flags:
```
```and
QMAKE_FLAGS=('-spec' 'linux-g++' 'CONFIG+=release' 'CONFIG+=qml_release' 'CONFIG+=c++11' 'QMAKE_CXXFLAGS+=-fPIC' 'QMAKE_CXXFLAGS+=-std=c++11' 'QMAKE_CXXFLAGS+=-fpermissive' 'INCLUDEPATH+=/usr/include/eigen3' "LIBS+=-L`pwd`/lib/linux-g++")
MAKE_FLAGS=('-j11')
```
Expand Down
13 changes: 9 additions & 4 deletions src/common/common.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include (../general.pri)
EXIF_DIR = ../external/jhead-2.95

GLEWCODE = $$GLEWDIR/src/glew.c

win32-msvc2005:DESTDIR = ../distrib
win32-msvc2008:DESTDIR = ../distrib
Expand Down Expand Up @@ -44,8 +43,11 @@ fi;\
INCLUDEPATH *= ../.. \
$$VCGDIR \
$$EIGENDIR \
$$GLEWDIR/include \
$$EXIF_DIR
!CONFIG(system_glew) {
INCLUDEPATH *= $$GLEWDIR/include
GLEWCODE = $$GLEWDIR/src/glew.c
}
TEMPLATE = lib

linux:CONFIG += dll
Expand All @@ -69,7 +71,6 @@ QT += script

TARGET = common
DEPENDPATH += .
DEFINES += GLEW_STATIC

win32-msvc:DEFINES += _CRT_SECURE_NO_WARNINGS

Expand Down Expand Up @@ -102,7 +103,11 @@ SOURCES += filterparameter.cpp \
mlapplication.cpp \
scriptsyntax.cpp \
searcher.cpp \
$$GLEWCODE \
meshlabdocumentxml.cpp \
meshlabdocumentbundler.cpp \
ml_shared_data_context.cpp

!CONFIG(system_glew) {
SOURCES += $$GLEWCODE
DEFINES += GLEW_STATIC
}
11 changes: 7 additions & 4 deletions src/external/external.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ config += debug_and_release

TEMPLATE = subdirs

SUBDIRS = bzip2-1.0.5/bzip2-1.0.5.pro \
muparser_v225/src \
SUBDIRS = muparser_v225/src \
levmar-2.3/levmar-2.3.pro \
structuresynth-1.5/structuresynth.pro \
OpenCTM-1.0.3/openctm.pro \
jhead-2.95/jhead-2.95.pro \
lib3ds-1.3.0/lib3ds/lib3ds.pro
# openkinect/openkinect.pro

!CONFIG(system_bzip2) SUBDIRS += bzip2-1.0.5/bzip2-1.0.5.pro
!CONFIG(system_openctm) SUBDIRS += OpenCTM-1.0.3/openctm.pro
!CONFIG(system_lib3ds) SUBDIRS += lib3ds-1.3.0/lib3ds/lib3ds.pro

# Can't easily make muparser conditional because of the fact it relies on the _UNICODE define
12 changes: 10 additions & 2 deletions src/general.pri
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
DEFINES += MESHLAB_SCALAR=float

VCGDIR = ../../../vcglib
EIGENDIR = $$VCGDIR/eigenlib
GLEWDIR = ../external/glew-2.1.0
CONFIG(system_eigen3): EIGENDIR = /usr/include/eigen3
!CONFIG(system_eigen3):EIGENDIR = $$VCGDIR/eigenlib
!CONFIG(system_glew): GLEWDIR = ../external/glew-2.1.0

CONFIG += c++11

Expand All @@ -27,4 +28,11 @@ MACLIBDIR = ../../external/lib/macx64
# the following line is needed to avoid mismatch between
# the awful min/max macros of windows and the limits max
win32:DEFINES += NOMINMAX

linux-g++:QMAKE_CXXFLAGS+=-Wno-unknown-pragmas

# Set up library search paths
linux:QMAKE_LFLAGS+=-L$$PWD/external/lib/linux
linux-g++:QMAKE_LFLAGS+=-L$$PWD/external/lib/linux-g++
linux-g++-32:QMAKE_LFLAGS += -L$$PWD/external/lib/linux-g++-32
linux-g++-64:QMAKE_LFLAGS += -L$$PWD/external/lib/linux-g++-64
8 changes: 6 additions & 2 deletions src/meshlab/meshlab.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ INCLUDEPATH *= . \
../.. \
$$VCGDIR \
$$EIGENDIR \
$$GLEWDIR/include \
$$EXIF_DIR
!CONFIG(system_glew): INCLUDEPATH *= $$GLEWDIR/include
DEPENDPATH += $$VCGDIR \
$$VCGDIR/vcg \
$$VCGDIR/wrap
Expand Down Expand Up @@ -65,7 +65,6 @@ SOURCES = main.cpp \
$$VCGDIR/wrap/gui/trackball.cpp \
$$VCGDIR/wrap/gui/trackmode.cpp \
$$VCGDIR/wrap/gui/coordinateframe.cpp \
#$$GLEWDIR/src/glew.c \
glarea_setting.cpp \
filterthread.cpp

Expand Down Expand Up @@ -157,6 +156,11 @@ win32-g++:LIBS += -L../external/lib/win32-gcc -ljhead -L../distrib -lcom
linux:LIBS += -L$$PWD/../external/lib/linux-g++ -ljhead -L../distrib -lcommon -lGLU
linux:QMAKE_RPATHDIR += ../distrib

!CONFIG(system_glew) {
INCLUDEPATH *= $$GLEWDIR/include
}
CONFIG(system_glew): LIBS += -lGLEW

# uncomment in your local copy only in emergency cases.
# We should never be too permissive
# win32-g++:QMAKE_CXXFLAGS += -fpermissive
Expand Down
9 changes: 6 additions & 3 deletions src/meshlabplugins/edit_align/edit_align.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ SOURCES = edit_align_factory.cpp \
../../meshlab/stdpardialog.cpp \
$$VCGDIR/wrap/ply/plylib.cpp\
$$VCGDIR/wrap/gui/trackball.cpp\
$$VCGDIR/wrap/gui/trackmode.cpp \
$$GLEWCODE

$$VCGDIR/wrap/gui/trackmode.cpp

!CONFIG(system_glew): SOURCES += $$GLEWCODE
CONFIG(system_glew) {
linux: LIBS += -lGLEW
}

INCLUDEPATH += ../../external

Expand Down
4 changes: 1 addition & 3 deletions src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.pro
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ win32-msvc: LIBS += ../../external/lib/win32-msvc/levmar.lib
win32-msvc2013: LIBS += ../../external/lib/win32-msvc2013/levmar.lib
win32-msvc2015: LIBS += ../../external/lib/win32-msvc2015/levmar.lib
win32-g++:LIBS += -L../../external -llevmar
linux-g++:LIBS += -L$$PWD/../../external/lib/linux-g++ -llevmar
linux-g++-32:LIBS += -L$$PWD/../../external/lib/linux-g++-32 -llevmar
linux-g++-64:LIBS += -L$$PWD/../../external/lib/linux-g++-64 -llevmar
linux-g++:LIBS += -llevmar
macx:LIBS += $$MACLIBDIR/liblevmar.a

4 changes: 1 addition & 3 deletions src/meshlabplugins/filter_func/filter_func.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ win32-msvc2013:LIBS += ../../external/lib/win32-msvc2013/muparser.lib
win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/muparser.lib

macx:LIBS += $$MACLIBDIR/libmuparser.a
linux-g++:LIBS += $$PWD/../../external/lib/linux-g++/libmuparser.a
linux-g++-32:LIBS += $$PWD/../../external/lib/linux-g++-32/libmuparser.a
linux-g++-64:LIBS += $$PWD/../../external/lib/linux-g++-64/libmuparser.a
linux-g++:LIBS += -lmuparser
win32-g++:LIBS += ../../external/lib/win32-gcc/libmuparser.a
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/levmar.lib
win32-msvc2012:LIBS += ../../external/lib/win32-msvc2012/levmar.lib
win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/levmar.lib
win32-g++:LIBS += -L../../external/lib/win32-gcc -llevmar
linux-g++:LIBS += -L$$PWD/../../external/lib/linux-g++ -llevmar
linux-g++-32:LIBS += -L$$PWD/../../external/lib/linux-g++-32 -llevmar
linux-g++-64:LIBS += -L$$PWD/../../external/lib/linux-g++-64 -llevmar
linux-g++:LIBS += -llevmar
macx:LIBS += $$MACLIBDIR/liblevmar.a

# Please never ever uncomment this...
Expand Down
5 changes: 3 additions & 2 deletions src/meshlabplugins/filter_plymc/plymc.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
TARGET = plymc
DEPENDPATH += .
INCLUDEPATH += ../../../../vcglib \
../../code/lib/glew/include
INCLUDEPATH += ../../../../vcglib
CONFIG += console \
stl \
debug_and_release
Expand All @@ -24,5 +23,7 @@ HEADERS = plymc.h \
simplemeshprovider.h \
../../meshlab/alnParser.h

!CONFIG(system_glew): INCLUDEPATH *= ../../code/lib/glew/include

#macx-g++:DEFINES += NDEBUG

2 changes: 1 addition & 1 deletion src/meshlabplugins/filter_ssynth/filter_ssynth.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/ssynth.lib
win32-msvc2012:LIBS += ../../external/lib/win32-msvc2012/ssynth.lib
win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/ssynth.lib
win32-g++:LIBS += ../../external/lib/win32-gcc/libssynth.a
linux-g++:LIBS += ../../external/lib/linux-g++/libssynth.a
linux-g++:LIBS += -lssynth
macx:LIBS += ../../external/lib/macx64/libssynth.a
TARGET = filter_ssynth
TEMPLATE = lib
Expand Down
15 changes: 6 additions & 9 deletions src/meshlabplugins/io_3ds/io_3ds.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ HEADERS = meshio.h \
import_3ds.h \
io_3ds.h

SOURCES += meshio.cpp \

DEFINES += LIB3DS_STATIC
SOURCES += meshio.cpp

TARGET = io_3ds

INCLUDEPATH += ../../external/lib3ds-1.3.0/
!CONFIG(system_lib3ds) {
INCLUDEPATH *= ../../external/lib3ds-1.3.0/
DEFINES += LIB3DS_STATIC
}

# Notes on the paths of lib3ds files.
# Once you have compiled the library put the lib files in a dir named lib/XXX/
Expand All @@ -26,11 +27,7 @@ win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/3ds.lib
win32-msvc2005:LIBS += ../../external/lib/win32-msvc2005/3ds.lib
win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/3ds.lib
win32-g++:LIBS += ../../external/lib/win32-gcc/lib3ds.a
linux-g++:LIBS += $$PWD/../../external/lib/linux-g++/lib3ds.a
linux-g++-32:LIBS += $$PWD/../../external/lib/linux-g++-32/lib3ds.a
linux-g++-64:LIBS += $$PWD/../../external/lib/linux-g++-64/lib3ds.a

# unix:LIBS += -L../../../../code/lib/lib3ds-1.3.0/lib3ds/lib/unix -l3ds
linux-g++:LIBS += -l3ds

# mac:LIBS -= -l3ds
# mac:LIBS += ../../../../code/lib/lib3ds-1.3.0/lib/mac/lib3ds.a
Expand Down
7 changes: 3 additions & 4 deletions src/meshlabplugins/io_ctm/io_ctm.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ HEADERS += io_ctm.h \
$$VCGDIR/wrap/io_trimesh/import_ctm.h \
$$VCGDIR/wrap/io_trimesh/export_ctm.h
SOURCES += io_ctm.cpp
INCLUDEPATH += ../../external/OpenCTM-1.0.3/lib
TARGET = io_ctm

!CONFIG(system_openctm): INCLUDEPATH *= ../../external/OpenCTM-1.0.3/lib

win32-msvc.net:QMAKE_CXXFLAGS += /DOPENCTM_STATIC
win32-msvc2005:QMAKE_CXXFLAGS += /DOPENCTM_STATIC
win32-msvc2008:QMAKE_CXXFLAGS += /DOPENCTM_STATIC
Expand All @@ -21,8 +22,6 @@ win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/openctm.lib
win32-msvc2012:LIBS += ../../external/lib/win32-msvc2012/openctm.lib
win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/openctm.lib
win32-g++:LIBS += ../../external/lib/win32-gcc/libopenctm.a
linux-g++:LIBS += $$PWD/../../external/lib/linux-g++/libopenctm.a
linux-g++-32:LIBS += $$PWD/../../external/lib/linux-g++-32/libopenctm.a
linux-g++-64:LIBS += $$PWD/../../external/lib/linux-g++-64/libopenctm.a
linux-g++:LIBS += -lopenctm
#macx:LIBS += ../../external/lib/macx/libopenctm.a
macx:LIBS += $$MACLIBDIR/libopenctm.a
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
include (../../shared.pri)

HEADERS = textureParams.h textureFormat.h texture2D.h framebufferObject.h gpuShader.h gpuProgram.h radianceScalingRenderer.h shaderDialog.h
SOURCES = textureParams.cpp textureFormat.cpp framebufferObject.cpp gpuShader.cpp gpuProgram.cpp radianceScalingRenderer.cpp shaderDialog.cpp $$GLEWCODE
SOURCES = textureParams.cpp textureFormat.cpp framebufferObject.cpp gpuShader.cpp gpuProgram.cpp radianceScalingRenderer.cpp shaderDialog.cpp

!CONFIG(system_glew): SOURCES += $$GLEWCODE
CONFIG(system_glew) {
linux: LIBS += -lGLEW
}

TARGET = render_radiance_scaling
FORMS = shaderDialog.ui
Expand Down
6 changes: 5 additions & 1 deletion src/meshlabserver/meshlabserver.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include (../general.pri)

INCLUDEPATH += . .. $$VCGDIR $$EIGENDIR $$GLEWDIR/include
INCLUDEPATH += . .. $$VCGDIR $$EIGENDIR

!CONFIG(system_glew): INCLUDEPATH *= $$GLEWDIR/include

HEADERS =

Expand Down Expand Up @@ -44,6 +46,8 @@ win32-msvc2010:DEFINES += GLEW_STATIC
win32-msvc2012:DEFINES += GLEW_STATIC
win32-msvc2015:DEFINES += GLEW_STATIC

CONFIG(system_glew):LIBS += -lGLEW

#DEFINES += GLEW_STATIC

# This removes the need of XSERVER to run meshlabserver
Expand Down
5 changes: 3 additions & 2 deletions src/plugins_experimental/edit_ocme/src/ocme/ocme_builder.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ GLEWDIR = ../../../../external/glew-1.5.1
win32-msvc2005:DEFINES += GLEW_STATIC
win32-msvc2008:DEFINES += GLEW_STATIC

INCLUDEPATH *= ../.. $$VCGDIR $$GLEWDIR/include
INCLUDEPATH *= ../.. $$VCGDIR
!CONFIG(system_glew): INCLUDEPATH *= $$GLEWDIR/include
DEPENDPATH += $$VCGDIR

# the following line is to hide the hundred of warnings about the deprecated
Expand Down Expand Up @@ -109,7 +110,7 @@ QMAKE_CXXFLAGS_RELEASE += -DNDEBUG
LIBS += -lGLEW
LIBS += -lkyotocabinet

QMAKE_LIBDIR += $$GLEWDIR/lib
!CONFIG(system_glew): QMAKE_LIBDIR += $$GLEWDIR/lib
QMAKE_LIBDIR += ../../../../external/kyotocabinet-1.2.34


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ SOURCES += filter_multiscale_align.cpp \
TARGET = filter_multiscale_align

## Dependencies
INCLUDEPATH += lib \
$$VCGDIR/eigenlib #needed by Grenaille
INCLUDEPATH += lib
!CONFIG(system_eigen3): INCLUDEPATH *= $$VCGDIR/eigenlib #needed by Grenaille
CONFIG(system_eigen3): INCLUDEPATH *= $$EIGENDIR #needed by Grenaille


unix: QMAKE_CXXFLAGS += -DQ_OS_LINUX
Expand Down
16 changes: 2 additions & 14 deletions src/plugins_unsupported/edit_arc3D/edit_arc3D.pro
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,10 @@ win32-msvc2012:LIBS += ../../external/lib/win32-msvc2012/bz2.lib
win32-msvc2013:LIBS += ../../external/lib/win32-msvc2013/bz2.lib
win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/bz2.lib
win32-g++:LIBS += ../../external/lib/win32-gcc/libbz2.a
linux-g++:LIBS += $$PWD/../../external/lib/linux-g++/libbz2.a
linux-g++-32:LIBS += $$PWD/../../external/lib/linux-g++-32/libbz2.a
linux-g++-64:LIBS += $$PWD/../../external/lib/linux-g++-64/libbz2.a
linux-g++:LIBS += -lbz2
mac:LIBS += -lbz2

win32-msvc2005:INCLUDEPATH += ../../external/bzip2-1.0.5
win32-msvc2008:INCLUDEPATH += ../../external/bzip2-1.0.5
win32-msvc2010:INCLUDEPATH += ../../external/bzip2-1.0.5
win32-msvc2012:INCLUDEPATH += ../../external/bzip2-1.0.5
win32-msvc2013:INCLUDEPATH += ../../external/bzip2-1.0.5
win32-msvc2015:INCLUDEPATH += ../../external/bzip2-1.0.5

win32-g++:INCLUDEPATH += ../../external/bzip2-1.0.5
linux-g++:INCLUDEPATH += ../../external/bzip2-1.0.5
linux-g++-32:INCLUDEPATH += ../../external/bzip2-1.0.5
linux-g++-64:INCLUDEPATH += ../../external/bzip2-1.0.5
!CONFIG(system_bzip2):INCLUDEPATH += ../../external/bzip2-1.0.5


CONFIG(release, debug|release) {
Expand Down
Loading

0 comments on commit 3c6d6bf

Please sign in to comment.