Merge pull request #815 from alemuntoni/master

CMake is the default build system
This commit is contained in:
Alessandro Muntoni 2020-10-27 16:50:42 +01:00 committed by GitHub
commit 4d47a443ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3472 changed files with 3667 additions and 164693 deletions

View File

@ -1,4 +1,4 @@
name: BuildAndRelease
name: CreateRelease
on:
#[push, pull_request] #just for test release scripts
@ -8,9 +8,7 @@ on:
description: 'New MeshLab Version'
required: true
default: 'YYYY.MM'
#schedule:
# - cron: '0 1 1 * *' #every first day of the month at 1am
jobs:
update_ml_version:
@ -19,12 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
submodules: true
#- name: Setup env variables
# id: envs
# run: |
# echo ::set-output name=date::"$(date +%Y.%m)"
- name: Update MeshLab version
run : |
echo ${{ github.event.inputs.version }} | tr -d '\n'> ML_VERSION
@ -34,15 +27,15 @@ jobs:
/usr/libexec/PlistBuddy -c "Set CFBundleVersion ${{ github.event.inputs.version }}" src/meshlab/Info.plist
- name: Update Snap file
run: |
sed "s%MESHLAB_VERSION%$(cat ML_VERSION)%g" install/linux/resources/snap/snap_noversion.yaml > snapcraft.yaml
sed "s%MESHLAB_VERSION%$(cat ML_VERSION)%g" scripts/Linux/resources/snap/snap_noversion.yaml > snapcraft.yaml
- name: commit ML_VERSION, snapcraft.yaml and Info.plist change
uses: stefanzweifel/git-auto-commit-action@v4.1.1
with:
commit_message: Apply automatic ML_VERSION, snapcraft.yaml and Info.plist change
ubuntu_build_appimage:
linux_build:
needs: [update_ml_version]
name: Build MeshLab (Ubuntu - AppImage)
name: Build MeshLab (Linux)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
steps:
@ -50,47 +43,34 @@ jobs:
with:
ref: master
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Install dependencies
run: |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
sudo apt-get install -y libxkbcommon-x11-0 patchelf
sh scripts/${{ runner.os }}/0_setup_env_ubuntu.sh
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
- name: Configure and Build
run: |
sh install/linux/linux_build.sh
- name: Make MeshLab Bundle
sh scripts/${{ runner.os }}/1_build.sh
- name: Deploy
run: |
sh install/linux/linux_make_bundle.sh
- name: Deploy MeshLab and MeshLabServer
sh scripts/${{ runner.os }}/2_deploy.sh
- name: Build MeshLab AppImage
run : |
sh install/linux/linux_deploy.sh
- name: Build MeshLab and MeshLabServer AppImages
run : |
sh install/linux/linux_appimages.sh
sh scripts/${{ runner.os }}/3_appimage.sh
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_portable
path: distrib/
- name: Upload MeshlabServer AppImage
uses: actions/upload-artifact@v1
with:
name: meshlabserver_linux_appimage
path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage
path: src/install/
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_appimage
path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage
path: src/MeshLab${{steps.envs.outputs.date}}-linux.AppImage
ubuntu_build_snap:
linux_build_snap:
needs: [update_ml_version]
name: Build MeshLab (Ubuntu - Snap)
runs-on: ubuntu-latest
@ -145,21 +125,21 @@ jobs:
shell: bash
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
- name: Configure and Build
run: |
sh install/macos/macos_build.sh
- name: Deploy MeshLab
sh scripts/${{ runner.os }}/1_build.sh
- name: Deploy
run: |
sh install/macos/macos_deploy.sh
sh scripts/${{ runner.os }}/2_deploy.sh
- name: Create DMG
run: |
sh install/macos/macos_dmg.sh
mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
sh scripts/${{ runner.os }}/3_dmg.sh
mv src/install/MeshLab${{steps.envs.outputs.date}}.dmg src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
- name: Upload DMG
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_dmg
path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
path: src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
windows_build:
needs: [update_ml_version]
@ -177,57 +157,55 @@ jobs:
New-Item -Name "jom" -ItemType "directory"
Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom
echo "::add-path::$(Get-Location)\jom"
- name: Setup env variables
id: envs
run: |
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
#echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
echo "::set-output name=date::$(type ML_VERSION)"
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Build MeshLab
- name: Setup env variables
id: envs
run: |
.\install\windows\windows_build.ps1
- name: Deploy MeshLab
echo "::set-output name=date::$(type ML_VERSION)"
- name: Configure and Build
shell: bash
run: |
.\install\windows\windows_deploy.ps1
sh scripts/${{ runner.os }}/1_build.sh
- name: Deploy
shell: bash
run: |
sh scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
shell: bash
run: |
.\install\windows\resources\windows_nsis_script.ps1
sh scripts/${{ runner.os }}/resources/nsis_script.sh
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
script-file: "install/windows/resources/meshlab_final.nsi"
script-file: "src/install/meshlab_final.nsi"
- name: Rename Installer
shell: bash
run: |
Rename-Item -Path install\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe
- name: Upload Meshlab Portable
mv src/install/MeshLab${{steps.envs.outputs.date}}.exe src/MeshLab${{steps.envs.outputs.date}}-windows.exe
- name: Uploading MeshLab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_portable
path: distrib
path: src/install
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_installer
path: install/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe
path: src/MeshLab${{steps.envs.outputs.date}}-windows.exe
#after building MeshLab for the three platforms, we create a release in github
#after building MeshLab for the three platforms, we create a release in github
create_release:
name: Create Release
needs: [ubuntu_build_appimage, ubuntu_build_snap, macos_build, windows_build]
needs: [linux_build, linux_build_snap, macos_build, windows_build]
runs-on: ubuntu-latest
steps:
#- name: Setup env variables
# id: envs
# run: |
# echo ::set-output name=date::"$(date +%Y.%m)"
#Linux Release
#Download Linux Packages
- name: Download Linux ZIP
uses: actions/download-artifact@v1
with:
@ -236,10 +214,6 @@ jobs:
uses: actions/download-artifact@v1
with:
name: meshlab_linux_appimage
- name: Download Linux MeshLabServer AppImage
uses: actions/download-artifact@v1
with:
name: meshlabserver_linux_appimage
- name: Download Linux Snap
uses: actions/download-artifact@v1
with:
@ -250,20 +224,19 @@ jobs:
chmod +x meshlab_linux_portable/usr/bin/meshlabserver
chmod +x meshlab_linux_portable/AppRun
chmod +x meshlab_linux_appimage/MeshLab${{ github.event.inputs.version }}-linux.AppImage
chmod +x meshlabserver_linux_appimage/MeshLabServer${{ github.event.inputs.version }}-linux.AppImage
- name: Create MeshLab Portable Linux Archive
run: |
tar -cvzf MeshLab${{ github.event.inputs.version }}-linux.tar.gz meshlab_linux_portable/
#MacOS Release
#Download MacOS Package
- name: Download MacOS DMG
uses: actions/download-artifact@v1
with:
name: meshlab_macos_dmg
#Windows Release
#Download Windows Packages
- name: Download Windows ZIP
uses: actions/download-artifact@v1
with:
@ -275,8 +248,8 @@ jobs:
- name: Create MeshLab Portable Windows Archive
run: |
zip -r MeshLab${{ github.event.inputs.version }}-windows.zip meshlab_windows_portable/
#Create release and upload
- name: Publish Release
id: create_release
@ -309,16 +282,6 @@ jobs:
asset_path: meshlab_linux_appimage/MeshLab${{ github.event.inputs.version }}-linux.AppImage
asset_name: MeshLab${{ github.event.inputs.version }}-linux.AppImage
asset_content_type: MeshLab AppImage for Linux
- name: Upload ReleaseLinuxMeshLabServerAppImage
id: upload-release-linux-meshlabserver-appimage
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: meshlabserver_linux_appimage/MeshLabServer${{ github.event.inputs.version }}-linux.AppImage
asset_name: MeshLabServer${{ github.event.inputs.version }}-linux.AppImage
asset_content_type: MeshLabServer AppImage for Linux
- name: Upload ReleaseLinuxSnap
id: upload-release-linux-snap
uses: actions/upload-release-asset@v1.0.1

View File

@ -4,76 +4,37 @@ on:
[push, pull_request]
jobs:
ubuntu_build_appimage:
name: Build MeshLab (Ubuntu - AppImage)
linux_build:
name: Build MeshLab (Linux)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Install dependencies
run: |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
sudo apt-get install -y libxkbcommon-x11-0 patchelf
sh scripts/${{ runner.os }}/0_setup_env_ubuntu.sh
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
- name: Configure and Build
run: |
sh install/linux/linux_build.sh
- name: Make MeshLab Bundle
sh scripts/${{ runner.os }}/1_build.sh
- name: Deploy
run: |
sh install/linux/linux_make_bundle.sh
- name: Deploy MeshLab and MeshLabServer
sh scripts/${{ runner.os }}/2_deploy.sh
- name: Build MeshLab AppImage
run : |
sh install/linux/linux_deploy.sh
- name: Build MeshLab and MeshLabServer AppImages
run : |
sh install/linux/linux_appimages.sh
sh scripts/${{ runner.os }}/3_appimage.sh
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_portable
path: distrib/
- name: Upload MeshlabServer AppImage
uses: actions/upload-artifact@v1
with:
name: meshlabserver_linux_appimage
path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage
path: src/install/
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_appimage
path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage
ubuntu_build_cmake:
name: Build MeshLab (Ubuntu - CMake)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
sh install/linux/linux_setup_env_ubuntu.sh
sudo apt-get install cmake ninja-build
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Configure
run: |
cmake src/ -G Ninja
- name: Build MeshLab
run: |
ninja -C .
- name: Install Meshlab
run: sudo ninja -C . install
path: src/MeshLab${{steps.envs.outputs.date}}-linux.AppImage

View File

@ -2,10 +2,10 @@ name: LinuxSnap
on:
workflow_dispatch
jobs:
ubuntu_build_snap:
name: Build MeshLab (Ubuntu - Snap)
linux_build_snap:
name: Build MeshLab (Linux - Snap)
runs-on: ubuntu-latest
steps:

View File

@ -24,25 +24,19 @@ jobs:
id: envs
shell: bash
run: |
#sh install/macos/macos_setup_env.sh
#necessary here on github actions:
#echo '::set-env name=QTDIR::/usr/local/opt/qt'
#echo '::add-path::/usr/local/opt/qt/bin'
#echo '::set-env name=LD_LIBRARY_PATH::/usr/local/opt/qt/lib:${{env.LD_LIBRARY_PATH}}'
#echo '::set-env name=PKG_CONFIG_PATH::/usr/local/opt/qt/lib:${{env.PKG_CONFIG_PATH}}'
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
- name: Configure and Build
run: |
sh install/macos/macos_build.sh
- name: Deploy MeshLab
sh scripts/${{ runner.os }}/1_build.sh
- name: Deploy
run: |
sh install/macos/macos_deploy.sh
sh scripts/${{ runner.os }}/2_deploy.sh
- name: Create DMG
run: |
sh install/macos/macos_dmg.sh
mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
sh scripts/${{ runner.os }}/3_dmg.sh
mv src/install/MeshLab${{steps.envs.outputs.date}}.dmg src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg
- name: Upload DMG
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_dmg
path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
path: src/install/MeshLab${{steps.envs.outputs.date}}-macos.dmg

142
.github/workflows/QmakeBuilds.yml vendored Normal file
View File

@ -0,0 +1,142 @@
name: Qmake builds
on: [push, pull_request]
jobs:
ubuntu_build:
name: Build MeshLab (Ubuntu - QMake)
runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Install dependencies
run: |
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev
sudo apt-get install -y libxkbcommon-x11-0 patchelf
- name: Setup env variables
id: envs
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
run: |
sh scripts/${{ runner.os }}/qmake/linux_build.sh
- name: Make MeshLab Bundle
run: |
sh scripts/${{ runner.os }}/qmake/linux_make_bundle.sh
- name: Deploy MeshLab and MeshLabServer
run : |
sh scripts/${{ runner.os }}/qmake/linux_deploy.sh
- name: Build MeshLab and MeshLabServer AppImages
run : |
sh scripts/${{ runner.os }}/qmake/linux_appimages.sh
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_portable
path: distrib/
- name: Upload MeshlabServer AppImage
uses: actions/upload-artifact@v1
with:
name: meshlabserver_linux_appimage
path: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage
- name: Upload Meshlab AppImage
uses: actions/upload-artifact@v1
with:
name: meshlab_linux_appimage
path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage
macos_build_qmake:
name: Build MeshLab (MacOS - QMake)
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
brew install libomp
npm install -g appdmg
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Setup env variables
id: envs
shell: bash
run: |
echo ::set-output name=date::"$(cat ML_VERSION)"
- name: Build MeshLab
run: |
sh scripts/${{ runner.os }}/qmake/macos_build.sh
- name: Deploy MeshLab
run: |
sh scripts/${{ runner.os }}/qmake/macos_deploy.sh
- name: Create DMG
run: |
sh scripts/${{ runner.os }}/qmake/macos_dmg.sh
mv distrib/MeshLab${{steps.envs.outputs.date}}.dmg distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
- name: Upload DMG
uses: actions/upload-artifact@v1
with:
name: meshlab_macos_dmg
path: distrib/MeshLab${{steps.envs.outputs.date}}-macos.dmg
windows_build_qmake:
name: Build MeshLab (Windows - QMake)
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Download Jom
run: |
Invoke-WebRequest -Uri "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" -OutFile "jom_1_1_3.zip"
New-Item -Name "jom" -ItemType "directory"
Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom
echo "::add-path::$(Get-Location)\jom"
- name: Setup env variables
id: envs
run: |
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
#echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
echo "::set-output name=date::$(type ML_VERSION)"
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
- name: Build MeshLab
run: |
.\scripts\${{ runner.os }}\qmake\windows_build.ps1
- name: Deploy MeshLab
run: |
.\scripts\${{ runner.os }}\qmake\windows_deploy.ps1
- name: NSIS script
run: |
.\scripts\${{ runner.os }}\resources\windows_nsis_script.ps1
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
script-file: "scripts/windows/resources/meshlab_final.nsi"
- name: Rename Installer
run: |
Rename-Item -Path scripts\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe
- name: Upload Meshlab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_portable
path: distrib
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_installer
path: scripts/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe

View File

@ -17,75 +17,43 @@ jobs:
New-Item -Name "jom" -ItemType "directory"
Expand-Archive -Path jom_1_1_3.zip -DestinationPath .\jom
echo "::add-path::$(Get-Location)\jom"
- name: Setup env variables
id: envs
run: |
echo "VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" >> $GITHUB_ENV
#echo '::set-env name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC'
echo "::set-output name=date::$(type ML_VERSION)"
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
#mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
- name: Build MeshLab
- name: Setup env variables
id: envs
run: |
.\install\windows\windows_build.ps1
- name: Deploy MeshLab
echo "::set-output name=date::$(type ML_VERSION)"
- name: Configure and Build
shell: bash
run: |
.\install\windows\windows_deploy.ps1
sh scripts/${{ runner.os }}/1_build.sh
- name: Deploy
shell: bash
run: |
sh scripts/${{ runner.os }}/2_deploy.sh
- name: NSIS script
shell: bash
run: |
.\install\windows\resources\windows_nsis_script.ps1
sh scripts/${{ runner.os }}/resources/nsis_script.sh
- name: Create Installer
uses: joncloud/makensis-action@v1
with:
script-file: "install/windows/resources/meshlab_final.nsi"
script-file: "src/install/meshlab_final.nsi"
- name: Rename Installer
shell: bash
run: |
Rename-Item -Path install\windows\resources\MeshLab${{steps.envs.outputs.date}}.exe -NewName MeshLab${{steps.envs.outputs.date}}-windows.exe
- name: Upload Meshlab Portable
mv src/install/MeshLab${{steps.envs.outputs.date}}.exe src/MeshLab${{steps.envs.outputs.date}}-windows.exe
- name: Uploading MeshLab Portable
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_portable
path: distrib
path: src/install
- name: Upload Meshlab Installer
uses: actions/upload-artifact@v1
with:
name: meshlab_windows_installer
path: install/windows/resources/MeshLab${{steps.envs.outputs.date}}-windows.exe
windows_build_cmake:
name: Build MeshLab (Windows, CMake)
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
modules: xmlpatterns
#mirror: 'http://mirrors.ocf.berkeley.edu/qt/'
- name: Setup env variables
id: envs
run: |
echo "::set-output name=date::$(type ML_VERSION)"
- name: Configure
run: |
cmake -S ./src -B ./build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
# -DBUILD_MINI=ON
- name: Build MeshLab
run: |
cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo -j 4
cmake --build $env:GITHUB_WORKSPACE/build --config RelWithDebInfo --target INSTALL
# - name: Uploading MeshLab Portable
# uses: actions/upload-artifact@v1
# with:
# name: meshlab_portable_windows_cmake
# path: install
path: src/MeshLab${{steps.envs.outputs.date}}-windows.exe

1
.gitignore vendored
View File

@ -18,6 +18,7 @@
*.AppImage
.DS_Store
distrib*
src/install/*
install/macos/resources/meshlab_dmg_final.json
install/windows/resources/meshlab_final.nsi
install/windows/resources/MeshLab*.exe

4
.gitmodules vendored
View File

@ -1,4 +1,4 @@
[submodule "vcglib"]
path = vcglib
[submodule "src/vcglib"]
path = src/vcglib
url = https://github.com/cnr-isti-vclab/vcglib
branch = devel

View File

@ -5,9 +5,9 @@
![MacOS](https://github.com/cnr-isti-vclab/meshlab/workflows/MacOS/badge.svg)
![Windows](https://github.com/cnr-isti-vclab/meshlab/workflows/Windows/badge.svg)
This is the official repository for the source and the binaries of [MeshLab](https://www.MeshLab.net).
This is the official repository for the source and the binaries of [MeshLab](https://www.MeshLab.net).
MeshLab is an open source, portable, and extensible system for the processing and editing of unstructured large 3D triangular meshes. It is aimed to help the processing of the typical not-so-small unstructured models arising in 3D scanning, providing a set of tools for editing, cleaning, healing, inspecting, rendering and converting this kind of meshes. These tools include MeshLab proper, a versatile program with a graphical user interface, and [meshlabserver](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/meshlabserver/README.md), a program that can perform mesh processing tasks in batch mode, without a GUI.
MeshLab is an open source, portable, and extensible system for the processing and editing of unstructured large 3D triangular meshes. It is aimed to help the processing of the typical not-so-small unstructured models arising in 3D scanning, providing a set of tools for editing, cleaning, healing, inspecting, rendering and converting this kind of meshes. These tools include MeshLab proper, a versatile program with a graphical user interface, and [meshlabserver](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/meshlabserver/README.md), a program that can perform mesh processing tasks in batch mode, without a GUI.
MeshLab is mostly based on the open source C++ mesh processing library [VCGlib](http://www.vcglib.net) developed at the [Visual Computing Lab](http://vcg.isti.cnr.it) of [ISTI - CNR](http://www.isti.cnr.it). VCG can be used as a stand-alone large-scale automated mesh processing pipeline, while MeshLab makes it easy to experiment with its algorithms interactively.
@ -15,32 +15,29 @@ MeshLab is available for Windows, MacOS, and Linux.
# Releases
You can find the last MeshLab release in the [Releases Tab](https://github.com/cnr-isti-vclab/meshlab/releases) for your favourite platform. [Github Actions](https://github.com/cnr-isti-vclab/meshlab/actions) is scheduled to release a new beta version of MeshLab the first day of every month.
You can find the last MeshLab release in the [Releases Tab](https://github.com/cnr-isti-vclab/meshlab/releases) for your favourite platform.
You can also test a built version of MeshLab generated by the last commit pushed in this repository, by downloading the artifacts of the last [Github Actions](https://github.com/cnr-isti-vclab/meshlab/actions) workflow.
### Note for Windows
The portable version of MeshLab won't start if doesn't find a Visual C++ Compiler installed. If you get the error "MSVCP140.dll not found" or related, please install Visual C++ Redist by executing the `vc_redist.exe` file contained in the MeshLab portable archive. Alternatively, you can download Visual C++ Redist [here](https://support.microsoft.com/it-it/help/2977003/the-latest-supported-visual-c-downloads).
# Build instructions
We provide a set of scripts that build and deploy MeshLab automatically. All the scripts can be found in the [install](https://github.com/cnr-isti-vclab/meshlab/tree/master/install) folder.
We provide a set of scripts that build and deploy MeshLab automatically. All the scripts can be found in the [scripts](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts) folder.
For specific build instructions see the [src](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/README.md) folder.
# Structure of the Repository
The MeshLab repository is organized as follows:
* `distrib`: this folder contains a set of prebuilt libraries, shaders and plugins that will be used by MeshLab once it is compiled. Binaries and plugins will be placed in this folder after MeshLab is built, or a copy of this folder will be placed in the chosen shadow build directory. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib/README.md);
* `distrib`: this folder contains a set of prebuilt libraries and shaders that will be used by MeshLab once it is compiled. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib/README.md);
* `docs`: doxygen scripts for generating MeshLab documentation. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/docs);
* `install`: in this folder there are a set of platform-dependent script to build and deploy MeshLab. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/README.md);
* `sample`: a set of files (meshes, images) used for tests;
* `src`: this folder contains all the source code of MeshLab, its plugins and the external libraries that it requires. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/README.md);
* `vcglib`: submodule of [VCGLib](https://github.com/cnr-isti-vclab/vcglib).
* `sample` and `textures`: a set of files (meshes, images) used for tests;
* `scripts`: in this folder there is a set of platform-dependent scripts to build and deploy MeshLab. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/README.md);
* `src`: this folder contains all the source code of MeshLab, its plugins and the external libraries that it requires. For more details, check the readme [here](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/README.md);
* `unsupported`: this folder contains a set of old and unsupported MeshLab plugins that are no longer included and built under MeshLab.
# License
The Meshlab source is released under the [GPL License](LICENSE.txt).
# Copyright
```

View File

@ -1,8 +1,3 @@
# distrib folder
The distrib folder contains a set of pre-built libraries, plugins and shaders that MeshLab needs to properly run.
Running `qmake && make` from the [src](https://github.com/cnr-isti-vclab/meshlab/tree/master/src) folder of the repo, MeshLab binaries, plugins and libraries will be placed automatically in this folder.
If instead a shadow build is set, the `distrib` folder will be automatically copied inside the selected build directory, and it will contain also binaries, plugins and libraries.
After building MeshLab, the `distrib` directory will **not** contain a portable version of MeshLab, since it won't contain all the Qt's libraries needed by MeshLab. In order to deploy MeshLab, see the [install](https://github.com/cnr-isti-vclab/meshlab/tree/master/install) directory.
The distrib folder contains a set of pre-built libraries and shaders that MeshLab needs to properly run, plus some other txt files and icons.

View File

@ -1,10 +1,7 @@
copy here the lib compiled for the system with the name specified in the directory name according to the QT system configuration names
Some compilation notes
------ libgmp ------
For mac osx 10.6 with meshlab 32 bitÉ
For mac osx 10.6 with meshlab 32 bit
After extracting the archive
./configure CFLAGS="-mmacosx-version-min=10.5 -arch i386" LDFLAGS="-mmacosx-version-min=10.5 -arch i386" ABI=32 --enable-cxx --enable-static --with-pic
@ -13,9 +10,9 @@ make
cp .libs/*.a ../../external/lib/macx/
--- using mpir instead GMP ---
Exactly the same steps as aboveÉ
For mac osx 10.6 with meshlab 32 bitÉ
--- using mpir instead GMP ---
Exactly the same steps as above<EFBFBD>
For mac osx 10.6 with meshlab 32 bit<EFBFBD>
After extracting the archive
./configure CFLAGS="-mmacosx-version-min=10.5 -arch i386" LDFLAGS="-mmacosx-version-min=10.5 -arch i386" ABI=32 --enable-cxx --enable-static --with-pic

View File

@ -1,19 +0,0 @@
# install folder
**Work in Progress**
This folder contains a series of platform-dependent scripts to build and deploy meshlab.
Every platform folder contains:
* `$platform$-build.[sh/ps1]`: a script that builds MeshLab. Requires a Qt environment properly set, with `qmake` accessible. Binaries will be placed inside `$1/distrib`, where `$1` is the argument that represents the build directory, or in the [distrib](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib) folder if arguments were not provided.
* `$platform$-deploy.[sh/ps1]`: a script that deploys MeshLab, making sure that the folder will be a self-contained MeshLab, without Qt library dependencies. Requires a properly built MeshLab in the directory passed as an argument, or in the [distrib](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib) folder if arguments were not provided.
* `$platform$-$installer$.[sh/ps1]`: a script that computes a self-contained package/installer of MeshLab. Requires a properly deployed MeshLab in the directory passed as an argument, or in the [distrib](https://github.com/cnr-isti-vclab/meshlab/tree/master/distrib) folder if arguments were not provided. The result will be saved in the same directory.
* `$platform$-make_it.[sh/ps1]`: a script that computes all the three previous scripts: starting from the source code, it will produce a self-contained package/installer of MeshLab.
* various other files used by the scripts listed above.
See in each platform subfolder for details and other platform-dependent requirements:
- [Linux](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/linux)
- [MaxOS](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/macos)
- [Windows](https://github.com/cnr-isti-vclab/meshlab/tree/master/install/windows)

View File

@ -1,87 +0,0 @@
MeshLab Release Note
** Every Time you commit something significant add a few lines here.
** Be Descriptive please.
2014 04 08 Corrected Selection Bug.
Old and low-end graphics cards (like the integrated intel ones) do not support OpenGL selection modes. Re-implemented all the selection using a internal pipeline that is actually faster.
2014 04 18 New MeshLabServer version has been committed
MeshLabServer is now able to properly manage the MeshLab Project files. MeshLabServer has been completely rewritten in order (hopefully) to enhance the robustness and usability of the tool
2014 04 25 Improved on screen Help.
Now it reports the trick for quick visibility toggling in the Layer window.
2014 04 28 Corrected Missing Preview Bug
The preview check box disappeared from many filters that were changing just the geometry of the mesh (like all the smoothing filters) without any serious reason.
2014 05 13 Added support for xml filters in the old fashioned scripting system=======
The preview check box disappeared from many filters that were changing just the geometry of the mesh (like all the smoothing filters) without any serious reason.
2014 04 30 Improved selection-by-quality filters
Now they consistently works also for point clouds.
2014 04 30 Improved Computation of normals for point clouds
In the case of working with point clouds generated with the well known Bundler, we added the options to reorient the vertex normals to comply with the cameras in Bundler datasets that have a camera attribute
2014 05 06 Obj File Export.
Added support of polygonal meshes in OBJ output. Now meshes with faux edges set are correctly exported as polygonal meshes (and not tris)
2014 05 07 OFF File Import
Corrected bug in the faux edge setting when loading polygonal meshes.
2014 05 07 Faux Edge Decorator
Added control of width of the drawn line.
2014 05 13 MeshLab core
Added support for xml filters in the old fashioned scripting system
2014 05 15 Create Sphere Cap
Added another basic shape (tessellated spherical cap).
2014 05 15 Invert Face Filter
Corrected bug in filter inverting faces that messed the faux bit flag.
2014 05 23 Sampling Filter
Improved Montecarlo, added weighted montecarlo
Improved Poisson weighting scheme (now it is coherent with the montecarlo one)
Combined the variable disk and standard poisson disk sampling
Added option for obtaining an exact number of samples (very useful when you want to get a very low number of samples)
2014 05 23 Added Point Cloud Simplification Filter
Easy to use filter for uniformly simplifying point clouds.
2014 05 23 Improved normal computation for polygonal face.
2014 05 23 Quality for face
Added two new measures for measuring the planarity of polygonal faces.
2014 05 23 Compute Measures
Improved quality of the results formatting and report more useful info (edge Length sum)
Improved support of polygonal meshes
2014 06 17 Decorators and Interface
Added possibility of choosing the color of the text, useful when showing info, histograms and such on white backgrounds.
Exposed color of NonFaux Edges
2014 06 17 Colorize by face color
Corrected small bug in the percentile filtering
2014 06 17 Filter Change: Create->Random Sphere now is Create->Point on a Sphere
It allows the creation of points randomly generated using a Poisson Disk distribution or using the Dave Rusin's disco ball algorithm for the regular placement of points on a sphere.
2014 06 17 New Filter: Build a Polyline with NonFaux Edges
Create a new Layer with an edge mesh composed only by the non faux edges of the current mesh
2014 06 17 Removed Filter: Voronoi Clustering. substituted by the voronoi sampling filter.
2014 08 26 Boundary Decorator
Now works also with edgemesh showing endpoints.
2014 10 20 Screened Poisson Surface Reconstruction
The latest version of the very powerful surface reconstruction algorithm.
2014 11 13 Histogram computation
Added area weighting counting to for vertex/face quality Histogram dumping filters

View File

@ -1,41 +0,0 @@
# Linux Scripts
This folder contains a series of scripts to build and deploy MeshLab under a Linux environment.
The following scripts are provided:
* `linux_setup_env_ubuntu.sh`: this script installs all the required dependencies that are necessary to build MeshLab in an Ubuntu distro (tested in 16.04, 18.04). If you never installed Qt and other libraries, you should run it before any other script;
* `linux_build.sh`: this script compiles MeshLab in a Linux environment:
* it requires a properly set Qt environment (see `linux_setup_env_ubuntu.sh`);
* without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries will be then placed inside `BUILD_PATH/distrib`;
* `linux_build_meshlab_mini.sh`: this script compiles MeshLab mini in a Linux environment. Works in the same way as the `linux_build.sh` script;
* `linux_deploy.sh`: makes the `distrib` folder a portable version of MeshLab (no Qt and other libraries dependencies):
* it requires a properly built meshlab `distrib` directory (see `linux_build.sh`);
* without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
* `linux_appimages.sh`: this script makes the `distrib` folder a portable version of MeshLab (no Qt and other libraries dependencies), and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies;
* it requires a properly built meshlab `distrib` directory (see `linux_build.sh`);
* without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`.
* `linux_meshlabserver_appimage.sh`: this script generates an [AppImage](https://appimage.org/) of [MeshLabServer](https://github.com/cnr-isti-vclab/meshlab/blob/master/src/meshlabserver/README.md) that can be run in a Linux Environment without dependencies;
* it requires a properly built meshlab `distrib` directory (see `linux_build.sh`);
* without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`.
* `linux_make_it.sh`: this script builds, deploys and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies;
* it requires a properly set Qt environment (see `linux_setup_env_ubuntu.sh`);
* without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries and the AppImage will be then placed inside `BUILD_PATH/distrib`;
__NOTE__: `linux_deploy.sh`, `linux_appimage.sh` and `linux_make_it.sh` use [LinuxDeployQt](https://github.com/probonopd/linuxdeployqt), which allows to deploy applications only running the oldest supported linux distro (see [this](https://github.com/probonopd/linuxdeployqt/issues/340)) in order to guarantee the largest support possible. Therefore, before running these scripts, be sure that your Linux distribution is the oldest supported one.
## Examples
Building meshlab on a clean Linux environment (compiled MeshLab in `meshlab/distrib`):
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
bash meshlab/install/linux/linux_setup_env_ubuntu.sh
bash meshlab/install/linux/linux_build.sh
Building and generating AppImage on a clean Ubuntu 16.04 (last supported distro) environment, build directory in `~/build_meshlab`:
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
bash meshlab/install/linux/linux_setup_env_ubuntu.sh
bash meshlab/install/linux/linux_make_it.sh ~/build_meshlab
Meshlab*.AppImage can be found in `~/build_meshlab/distrib/`.

View File

@ -1,8 +0,0 @@
#!/bin/bash
# this is a script shell sets up an ubuntu (16.04, 18.04) environment where
# MeshLab can be compiled.
#
# Run this script if you never installed any of the MeshLab dependencies.
sudo apt-get update
sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev libqt5xmlpatterns5-dev mesa-common-dev libglu1-mesa-dev lib3ds-dev libglew-dev libeigen3-dev libopenctm-dev libgmp-dev libqhull-dev patchelf #libmuparser-dev

View File

@ -1,36 +0,0 @@
# MacOS Scripts
This folder contains a series of scripts to build and deploy MeshLab under a MacOS environment.
The following scripts are provided:
* `macos_setup_env.sh`: this script installs all the required dependencies that are necessary to build MeshLab and create its DMG in a MacOS machine (tested in 10.15 Catalina). It requires [homebrew](https://brew.sh/) installed.
* `macos_build.sh`: this script compiles MeshLab in a MacOS environment:
* it requires a properly set Qt environment (see `macos_setup_env.sh`);
* without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries will be then placed inside `BUILD_PATH/distrib`;
* `macos_build_meshlab_mini.sh`: this script compiles MeshLab mini in a MacOS environment. Works in the same way as the `macos_build.sh` script;
* `macos_deploy.sh`: makes the `distrib/meshlab.app` app a portable version of MeshLab (no Qt and other libraries dependencies):
* it requires a properly built meshlab `distrib` directory (see `macos_build.sh`);
* without given arguments, the meshlab.app that will be deployed should be inside `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
* `macos_dmg.sh`: this script generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab;
* it requires a properly deployed meshlab `meshlab.app` directory (see `macos_deploy.sh`), a properly set Qt environment, and `appdmg` installed (see `macos_setup_env.sh`);
* without given arguments, the meshlab.app that will be used should be inside `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`.
* `macos_make_it.sh`: this script builds, deploys and generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab;
* it requires a properly set Qt environment and `appdmg` installed (see `macos_setup_env.sh`);
* without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries and the DMG will be then placed inside `BUILD_PATH/distrib`;
## Examples
Building meshlab on a clean MacOS environment (compiled MeshLab in `meshlab/distrib`):
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
sh meshlab/install/macos/macos_setup_env.sh
sh meshlab/install/macos/macos_build.sh
Building and generating DMG on a clean MacOS environment, build directory in `~/build_meshlab`:
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
sh meshlab/install/macos/macos_setup_env.sh
sh meshlab/install/macos/macos_make_it.sh ~/build_meshlab
Meshlab*.dmg can be found in `~/build_meshlab/distrib/`.

View File

@ -1,21 +0,0 @@
# Windows Scripts
**WORK IN PROGRESS**
This folder contains a series of scripts to build and deploy MeshLab under a Windows environment.
The following scripts are provided:
* `windows_build.ps1`: this script compiles MeshLab in a Windows environment:
* it requires a properly set Visual Studio (>=2015) and MSVC compiler;
* it requires a properly set Qt (>= 5.9) environment;
* without given arguments, all the binaries will be placed in the `meshlab/distrib` folder. You can give as argument the `BUILD_PATH`, and meshlab binaries will be then placed inside `BUILD_PATH/distrib`;
* `windows_build_meshlab_mini.ps1`: this script compiles MeshLab mini in a Windows environment. Works in the same way as the `windows_build.ps1` script;
* `windows_deploy.ps1`: makes the `distrib` folder a portable version of MeshLab (no Qt and other libraries dependencies):
* it requires a properly built meshlab `distrib` directory (see `windows_build.ps1`);
* `windeployqt.exe` directly accessible by powershell and `VCINSTALLDIR` set to the VC Visual Studio;
* without given arguments, the folder that will be deployed is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;
* `windows_nsis_installer.ps1`: this script generates an installer for MeshLab:
* it requires a properly built and deployed meshlab `distrib` directory (see `windows_deploy.ps1`);
* `makensis.exe` directly accessible by powershell;
* without given arguments, the folder used for creating the installer is `meshlab/distrib`. You can give as argument the `DISTRIB_PATH`;

View File

@ -0,0 +1,10 @@
#!/bin/bash
# this is a script shell sets up an ubuntu (16.04, 18.04, 20.04) environment where
# MeshLab can be compiled.
#
# Run this script if you never installed any of the MeshLab dependencies.
sudo apt-get update
sudo apt-get install -y qt5-default qttools5-dev-tools qtdeclarative5-dev libqt5xmlpatterns5-dev
sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev lib3ds-dev libeigen3-dev
sudo apt-get install -y libopenctm-dev libgmp-dev libqhull-dev patchelf cmake

61
scripts/Linux/1_build.sh Normal file
View File

@ -0,0 +1,61 @@
#!/bin/bash
# this is a script shell for compiling meshlab in a Linux environment.
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
#
# Without given arguments, MeshLab will be built in the meshlab/src/build
# directory, and installed in $BUILD_PATH/../install.
#
# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
# following way:
# sh linux_build.sh --build_path=/path/to/build --install_path=/path/to/install
# -b and -i arguments are also supported.
#default paths wrt the script folder
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
SOURCE_PATH=$SCRIPTS_PATH/../../src
BUILD_PATH=$SOURCE_PATH/build
INSTALL_PATH=$SOURCE_PATH/install/usr/
CORES="-j4"
#check parameters
for i in "$@"
do
case $i in
-b=*|--build_path=*)
BUILD_PATH="${i#*=}"
shift # past argument=value
;;
-i=*|--install_path=*)
INSTALL_PATH="${i#*=}"/usr/
shift # past argument=value
;;
-j*)
CORES=$i
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
#create build path if necessary
if ! [ -d $BUILD_PATH ]
then
mkdir -p $BUILD_PATH
fi
#create install path if necessary
if ! [ -d $INSTALL_PATH ]
then
mkdir -p $INSTALL_PATH
fi
BUILD_PATH=$(realpath $BUILD_PATH)
INSTALL_PATH=$(realpath $INSTALL_PATH)
cd $BUILD_PATH
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
make $CORES
make install

36
scripts/Linux/2_deploy.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# This is a script shell for deploying a meshlab-portable folder.
# Requires a properly built MeshLab (see 1_build.sh).
#
# This script can be run only in the oldest supported linux distro
# due to linuxdeployqt tool choice (see https://github.com/probonopd/linuxdeployqt/issues/340).
#
# Without given arguments, the folder that will be deployed is meshlab/src/install, which
# should be the path where MeshLab has been installed (default output of 1_build.sh).
#
# You can give as argument the path where you installed MeshLab.
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
#checking for parameters
if [ "$#" -eq 0 ]
then
BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
else
BUNDLE_PATH=$(realpath $1)
fi
bash $SCRIPTS_PATH/resources/make_bundle.sh $BUNDLE_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BUNDLE_PATH/usr/lib/meshlab
$SCRIPTS_PATH/resources/linuxdeployqt $BUNDLE_PATH/usr/share/applications/meshlab.desktop -bundle-non-qt-libs
chmod +x $BUNDLE_PATH/usr/bin/meshlab
rm $BUNDLE_PATH/AppRun
cp $SCRIPTS_PATH/resources/AppRunMeshLab $BUNDLE_PATH/
mv $BUNDLE_PATH/AppRunMeshLab $BUNDLE_PATH/AppRun
chmod +x $BUNDLE_PATH/AppRun
#at this point, distrib folder contains all the files necessary to execute meshlab
echo "$BUNDLE_PATH is now a self contained meshlab application"

View File

@ -0,0 +1,30 @@
#!/bin/bash
# This is a script shell for setting up the AppImage bundle for linux
# Requires a properly built meshlab, boundled and deployed (see linux_deploy.sh)
# inside the directory given as argument
#
# Without given arguments, MeshLab AppImage will be placed in the src
# directory.
#
# You can give as argument the path of the bundle (default is src/install),
# and the AppImage will be placed in the parent directory (src)
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
#checking for parameters
if [ "$#" -eq 0 ]
then
BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
else
BUNDLE_PATH=$(realpath $1)
fi
PARENT_NAME="$(dirname $BUNDLE_PATH)"
export VERSION=$(cat $SCRIPTS_PATH/../../ML_VERSION)
$SCRIPTS_PATH/resources/appimagetool $BUNDLE_PATH
mv MeshLab-$VERSION*.AppImage $PARENT_NAME/MeshLab$VERSION-linux.AppImage
#at this point, distrib folder contains all the files necessary to execute meshlab
echo MeshLab$VERSION-linux.AppImage generated

34
scripts/Linux/README.md Normal file
View File

@ -0,0 +1,34 @@
# Linux Scripts
This folder contains a series of scripts to build and deploy MeshLab under a Linux environment (tested on Ubuntu 16.04, 18.04 and 20.04).
* `0_setup_env_ubuntu.sh`: this script installs all the required dependencies that are necessary to build MeshLab in an Ubuntu distro (tested in 16.04, 18.04 and 20.04). If you never installed Qt and other libraries, you should run it before any other script;
* `1_build.sh`: this script builds MeshLab in a Linux environment:
* it requires a properly set Qt environment (see `0_setup_env_ubuntu.sh`);
* takes as arguments:
* the build directory (default: `src/build`): `--build_path=path/to/build`
* the install directory (default: `src/install`): `--install_path=path/to/install`
* the number of cores used to build MeshLab (default: `-j4`)`
* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`);
* `3_appimage.sh`: this script computes, starting from the portable folder of MeshLab, an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Takes as argument the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`);
* `make_it.sh`: this script builds, deploys and generates an [AppImage](https://appimage.org/) that can be run in a Linux Environment without dependencies. Arguments are the same of the `1_build.sh` script.
__NOTE__: `linux_deploy.sh`and `linux_make_it.sh` use [LinuxDeployQt](https://github.com/probonopd/linuxdeployqt), which allows to deploy applications **only running the oldest supported linux distro** (see [this](https://github.com/probonopd/linuxdeployqt/issues/340)) in order to guarantee the largest support possible. Therefore, before running these scripts, be sure that your Linux distribution is the oldest supported one.
## Examples
Building MeshLab on a clean Linux environment (build placed in `meshlab/src/build`):
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
bash meshlab/scripts/Linux/0_setup_env_ubuntu.sh
bash meshlab/scripts/Linux/1_build.sh
Building and generating AppImage on a clean Ubuntu 16.04 (last supported distro) environment:
* build directory: `./meshlab-build`
* install directory: `./meshlab-install`
* AppImage path: `./`
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
bash meshlab/scripts/Linux/0_setup_env_ubuntu.sh
bash meshlab/scripts/Linux/make_it.sh --build_path="./meshlab-build" --install_path="./meshlab-install"

52
scripts/Linux/make_it.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/bash
# This is a script shell for compiling and deploying MeshLab in a Linux environment.
#
# This script can be run only in the oldest supported linux distro
# due to linuxdeployqt tool choice (see https://github.com/probonopd/linuxdeployqt/issues/340).
#
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
#
# Without given arguments, MeshLab will be built in the meshlab/src/build,
# the folder meshlab/src/install will be a portable version of MeshLab and
# the AppImage will be placed in meshlab/src.
#
# You can give as argument the build path, the install path (that will contain
# the portable version of MeshLab), and the number of cores to use to build MeshLab
# (default: 4).
# The AppImage will be placed in the parent directory of the install path.
#
# Example of call:
# bash make_it.sh --build_path=path/to/build --install_path=path/to/install -j8
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
SOURCE_PATH=$SCRIPTS_PATH/../../src
BUILD_PATH=$SOURCE_PATH/build
INSTALL_PATH=$SOURCE_PATH/install
CORES="-j4"
#check parameters
for i in "$@"
do
case $i in
-b=*|--build_path=*)
BUILD_PATH="${i#*=}"
shift # past argument=value
;;
-i=*|--install_path=*)
INSTALL_PATH="${i#*=}"/usr/
shift # past argument=value
;;
-j*)
CORES=$i
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
sh $SCRIPTS_PATH/1_build.sh -b=$BUILD_PATH -i=$INSTALL_PATH $CORES
sh $SCRIPTS_PATH/2_deploy.sh $INSTALL_PATH
sh $SCRIPTS_PATH/3_appimages.sh $INSTALL_PATH

View File

@ -11,13 +11,13 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
DISTRIB_PATH="../../distrib"
DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$(realpath $1)
fi
cd "$(dirname "$(realpath "$0")")"; #move to script directory
INSTALL_PATH=$(pwd)
INSTALL_PATH=$(pwd)/../
cd $DISTRIB_PATH
PARENT_NAME="$(basename $DISTRIB_PATH)"

View File

@ -12,7 +12,7 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
BUILD_PATH="../../../src"
else
BUILD_PATH=$(realpath $1)
fi
@ -25,7 +25,7 @@ then
fi
echo "Build path is: " $BUILD_PATH
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro

View File

@ -12,7 +12,7 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
BUILD_PATH="../../../src"
else
BUILD_PATH=$(realpath $1)
fi
@ -25,7 +25,7 @@ then
fi
echo "Build path is: " $BUILD_PATH
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro CONFIG+=debug

View File

@ -12,7 +12,7 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
BUILD_PATH="../../../src"
else
BUILD_PATH=$(realpath $1)
fi
@ -25,7 +25,7 @@ then
fi
echo "Build path is: " $BUILD_PATH
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro "CONFIG+=meshlab_mini"

View File

@ -12,13 +12,13 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
DISTRIB_PATH="../../distrib"
DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$(realpath $1)
fi
cd "$(dirname "$(realpath "$0")")"; #move to script directory
INSTALL_PATH=$(pwd)
INSTALL_PATH=$(pwd)/../
cd $DISTRIB_PATH

View File

@ -10,16 +10,16 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
DISTRIB_PATH="../../distrib"
DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$(realpath $1)
fi
cd "$(dirname "$(realpath "$0")")"; #move to script directory
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
INSTALL_PATH=$(pwd)
INSTALL_PATH=$(pwd)/../
cd $DISTRIB_PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)

View File

@ -16,8 +16,8 @@
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
DISTRIB_PATH="../../distrib"
BUILD_PATH="../../../src"
DISTRIB_PATH="../../../distrib"
else
BUILD_PATH=$(realpath $1)
BUILD_PATH=$BUILD_PATH/distrib

View File

@ -0,0 +1,45 @@
#!/bin/bash
# this is a script shell for setting up the application bundle for linux
# Requires a properly built meshlab.
#
# Without given arguments, the application boundle will be placed in the meshlab/src/install
# directory.
#
# You can give as argument the path were meshlab has been installed.
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/../
SOURCE_PATH=$SCRIPTS_PATH/../../src
DISTRIB_PATH=$SCRIPTS_PATH/../../distrib
#checking for parameters
if [ "$#" -eq 0 ]
then
INSTALL_PATH=$SOURCE_PATH/install
else
INSTALL_PATH=$(realpath $1)
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTALL_PATH
#check if we have an exec in distrib
if ! [ -f $INSTALL_PATH/usr/bin/meshlab ]
then
echo "ERROR: meshlab bin not found inside $INSTALL_PATH/usr/bin/"
exit 1
fi
mkdir -p $INSTALL_PATH/usr/share/doc/meshlab
mkdir -p $INSTALL_PATH/usr/share/icons/hicolor/512x512/apps/
mkdir -p $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/
cp $SCRIPTS_PATH/resources/meshlab_appimage.desktop $INSTALL_PATH/usr/share/applications/meshlab.desktop
cp $DISTRIB_PATH/meshlab.png $INSTALL_PATH/usr/share/icons/hicolor/512x512/apps/meshlab.png
cp $DISTRIB_PATH/meshlab.png $INSTALL_PATH/usr/share/icons/Yaru/512x512/apps/meshlab.png
cp $DISTRIB_PATH/LICENSE.txt $INSTALL_PATH/usr/share/doc/meshlab/
cp $DISTRIB_PATH/privacy.txt $INSTALL_PATH/usr/share/doc/meshlab/
cp $DISTRIB_PATH/readme.txt $INSTALL_PATH/usr/share/doc/meshlab/
for filename in $INSTALL_PATH/usr/lib/meshlab/plugins/*.so; do
patchelf --set-rpath '$ORIGIN/../' $filename
done

View File

@ -1,4 +1,4 @@
# Known to build in Ubuntu 18.04
# Known to build in Ubuntu 18.04, 20.04
name: meshlab
base: core18
version: 'MESHLAB_VERSION'
@ -19,9 +19,6 @@ apps:
command: desktop-launch $SNAP/AppRun
plugs: [home, x11, mir, opengl, removable-media]
desktop: usr/share/applications/meshlab.desktop
meshlabserver:
command: desktop-launch meshlabserver
plugs: [home, x11, opengl, removable-media]
parts:
@ -44,6 +41,7 @@ parts:
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libqt5qml5
- libgdk-pixbuf2.0-0
- libqt5svg5
- try:
@ -65,9 +63,9 @@ parts:
- libglu1-mesa-dev
- lib3ds-dev
- libglew-dev
- libeigen3-dev
- libopenctm-dev
- libgmp-dev
- libeigen3-dev
- libopenctm-dev
- libgmp-dev
- libqhull-dev
- chrpath
stage-packages:
@ -77,19 +75,17 @@ parts:
- libqhull7
- libglew-dev
- libqt5opengl5-dev
- qtdeclarative5-dev
- libqt5xmlpatterns5-dev
- libqt5gui5
override-build: |
qmake src/meshlab.pro "CONFIG+= system_eigen3 system_glew system_bzip2 system_openctm system_lib3ds"
make -j4
sh install/linux/linux_make_boundle.sh distrib/
rsync -av distrib/* $SNAPCRAFT_PART_INSTALL/
rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab_server.desktop
override-build: |
sh scripts/Linux/1_build.sh
sh scripts/Linux/resources/make_bundle.sh
rsync -av src/install/* $SNAPCRAFT_PART_INSTALL/
rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab.desktop
cp install/linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
cp install/linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
cp scripts/Linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
cp scripts/Linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
mv $SNAPCRAFT_PART_INSTALL/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/AppRun
chmod +x $SNAPCRAFT_PART_INSTALL/AppRun

16
scripts/README.md Normal file
View File

@ -0,0 +1,16 @@
#scripts folder
This folder contains a series of platform-dependent scripts to build and deploy MeshLab.
Every platform folder contains:
* `1_build.sh`: a script that builds MeshLab. Requires a Qt environment properly set, with `cmake` accessible. Takes as inputh the build directory (default: `src/build`), the install directory (default: `src/install`) and the number of cores used to build MeshLab (default: `-j4`). Example of call: `bash 1_build.sh --build_path=path/to/build --install_path=path/to/install -j8`
* `2_deploy.sh`: a script that deploys MeshLab, making sure that the folder will be a self-contained MeshLab, without Qt library dependencies. Requires a properly built MeshLab in the directory passed as an argument (default: `src/install`). Example of call: `bash 2_deploy.sh path/to/deploy`
* `3_$installer$.sh`: a script that computes a platform-dependent self-contained package/installer of MeshLab. Requires a properly deployed MeshLab in the directory passed as an argument (default: `src/install`). The result will be saved in the parent directory of the given argument.
* `make_it.sh`: a script that computes all the three previous scripts: starting from the source code, it will produce a self-contained package/installer of MeshLab (arguments are the same of `1_build.sh`). Example of call: `bash makeit.sh --build_path=path/to/build --install_path=path/to/install -j8`
Note for Windows: scripts are written in bash, therefore they should be run in a linux subsystem environment.
See in each platform subfolder for details and other platform-dependent requirements:
- [Linux](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/Linux)
- [MaxOS](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/macOS)
- [Windows](https://github.com/cnr-isti-vclab/meshlab/tree/master/scripts/Windows)

View File

@ -0,0 +1,68 @@
#!/bin/bash
# this is a script shell for compiling meshlab in a windows environment.
# Requires a VS >= 2017 and Qt environments which are set-up properly,
# and an accessible cmake binary.
#
# Without given arguments, MeshLab will be built in the meshlab/src/build
# directory, and installed in $BUILD_PATH/../install.
#
# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
# following way:
# sh linux_build.sh --build_path=/path/to/build --install_path=/path/to/install
# -b and -i arguments are also supported.
#default paths wrt the script folder
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
SOURCE_PATH=$SCRIPTS_PATH/../../src
BUILD_PATH=$SOURCE_PATH/build
INSTALL_PATH=$SOURCE_PATH/install
CORES="-j4"
#check parameters
for i in "$@"
do
case $i in
-b=*|--build_path=*)
BUILD_PATH="${i#*=}"
shift # past argument=value
;;
-i=*|--install_path=*)
INSTALL_PATH="${i#*=}"
shift # past argument=value
;;
-j*)
CORES=$i
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
#create build path if necessary
if ! [ -d $BUILD_PATH ]
then
mkdir -p $BUILD_PATH
fi
#create install path if necessary
if ! [ -d $INSTALL_PATH ]
then
mkdir -p $INSTALL_PATH
fi
BUILD_PATH=$(realpath $BUILD_PATH)
INSTALL_PATH=$(realpath $INSTALL_PATH)
echo "BUILD PATH: "$BUILD_PATH
echo "INSTALL PATH: "$INSTALL_PATH
echo "SCRIPTS PATH: "$SCRIPTS_PATH
cd $BUILD_PATH
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
echo "-----"
ls -l
echo "-----"
jom $CORES #Qt nmake for parallel build
nmake install

View File

@ -0,0 +1,28 @@
#!/bin/bash
# This is a script shell for deploying a meshlab-portable folder.
# Requires a properly built meshlab (see windows_build.sh).
#
# Without given arguments, the folder that will be deployed is meshlab/src/install.
#
# You can give as argument the path where meshlab is installed.
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
DISTRIB_PATH=$SCRIPTS_PATH/../../distrib
#checking for parameters
if [ "$#" -eq 0 ]
then
BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
else
BUNDLE_PATH=$(realpath $1)
fi
windeployqt $BUNDLE_PATH/meshlab.exe
mv $BUNDLE_PATH/lib/meshlab/IFX* $BUNDLE_PATH
cp $BUNDLE_PATH/IFXCoreStatic.lib $BUNDLE_PATH/lib/meshlab/
cp $DISTRIB_PATH/LICENSE.txt $BUNDLE_PATH/
cp $DISTRIB_PATH/privacy.txt $BUNDLE_PATH/
#at this point, distrib folder contains all the files necessary to execute meshlab
echo "$BUNDLE_PATH is now a self contained meshlab application"

View File

@ -0,0 +1,26 @@
# This is a powershell script for computing an installer for MeshLab.
# Requires:
# - a properly deployed meshlab (see windows_deploy.ps1);
# - the env variable PATH containing the NSIS folder (makensis.exe must be directly accessible)
#
# Without given arguments, the folder that will be deployed is meshlab/distrib.
#
# You can give as argument the DISTRIB_PATH.
#
# After running this script, the installer can be found inside the resources folder.
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"
#checking for parameters
if [ "$#" -eq 0 ]
then
BUNDLE_PATH=$SCRIPTS_PATH/../../src/install
else
BUNDLE_PATH=$(realpath $1)
fi
sh $SCRIPTS_PATH/resources/nsis_script.sh $BUNDLE_PATH
makensis.exe $SCRIPTS_PATH/resources/meshlab_final.nsi
rm $SCRIPTS_PATH/resources/meshlab_final.nsi

26
scripts/Windows/README.md Normal file
View File

@ -0,0 +1,26 @@
# Windows Scripts
**WORK IN PROGRESS**
This folder contains a series of scripts to build and deploy MeshLab under a Windows environment.
**Note**: scripts are written in bash, therefore they should be run in a linux subsystem environment.
* `1_build.sh`: this script builds MeshLab in a Windows environment:
* it requires a properly set Visual Studio (>=2015) and MSVC compiler;
* it requires a properly set Qt environment;
* `cmake` in the PATH env variable;
* takes as arguments:
* the build directory (default: `src/build`): `--build_path=path/to/build`
* the install directory (default: `src/install`): `--install_path=path/to/install`
* the number of cores used to build MeshLab (default: `-j4`)`
* `2_deploy.sh`: this script makes the given path a portable version of MeshLab. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`);
* `3_installer.sh`: this script computes, starting from the portable folder of MeshLab, an NSIS installer. Takes as argument the path where the output install path of the `2_deploy.sh` script is placed (default: `src/install`);
* it requires `makensis.exe` in the PATH env variable.
## Examples
Building MeshLab on Windows, having VisualStudio, MSVC and Qt installed, cmake in the PATH (build placed in `meshlab/src/build`):
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
sh meshlab/scripts/Windows/1_build.sh

View File

@ -14,8 +14,7 @@
write-host "N of arguments: $($args.count)"
$DIR = Get-Location
$INSTALL_PATH = $PSScriptRoot
$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\src
$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\..\src
if ($args.Count -gt 0){
$BUILD_PATH = Resolve-Path -Path $args[0]

View File

@ -14,8 +14,7 @@
write-host "N of arguments: $($args.count)"
$DIR = Get-Location
$INSTALL_PATH = $PSScriptRoot
$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\src
$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\..\src
if ($args.Count -gt 0){
$BUILD_PATH = Resolve-Path -Path $args[0]

View File

@ -18,24 +18,21 @@
write-host "N of arguments: $($args.count)"
$DIR = Get-Location
$INSTALL_PATH = $PSScriptRoot
$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\src
$SOURCE_PATH = Join-Path $PSScriptRoot ..\..\..\src
if ($args.Count -gt 0){
$DISTRIB_PATH = $args[0]
} else {
$DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\distrib #default distrib
$DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\..\distrib #default distrib
}
cd $DISTRIB_PATH
if(! (Test-Path meshlab.exe)){ #meshlab.exe not found inside $DISTRIB_PATH
cd $DIR
throw 'meshlab.exe not found in ' + ($DISTRIB_PATH) + '. Exiting.'
throw 'meshlab.exe not found in ' + ($DISTRIB_PATH) + '. Exiting.'
}
#Copy-Item (Join-Path $INSTALL_PATH ..\meshlab.png) .
windeployqt --no-translations meshlab.exe
Move-Item .\lib\meshlab\IFX* .

View File

@ -12,21 +12,21 @@
#saving location where script has been run
$DIR = Get-Location
$INSTALL_PATH = $PSScriptRoot
$SCRIPTS_PATH = Join-Path $PSScriptRoot ..\
if ($args.Count -gt 0){
$DISTRIB_PATH = $args[0]
} else {
$DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\distrib #default distrib
$DISTRIB_PATH = Join-Path $PSScriptRoot ..\..\..\distrib #default distrib
}
.\resources\windows_nsis_script.ps1 $DISTRIB_PATH
.\..\resources\windows_nsis_script.ps1 $DISTRIB_PATH
cd $INSTALL_PATH
cd $SCRIPTS_PATH
makensis.exe .\resources\meshlab_final.nsi
makensis.exe .\..\resources\meshlab_final.nsi
Remove-Item .\resources\meshlab_final.nsi
Remove-Item .\..\resources\meshlab_final.nsi
#going back to original location
cd $DIR

View File

@ -0,0 +1,35 @@
# This is a powershell script for computing the meshlab_final.nsi script.
# Requires:
# - a properly deployed meshlab (see windows_deploy.ps1);
#
# Without given arguments, the folder that will be deployed is meshlab/distrib.
#
# You can give as argument the DISTRIB_PATH.
#
# After running this script, a meshlab_final.script can be found in the resources folder.
# This script is ready to be run by makensis.exe
SCRIPTS_PATH="$(dirname "$(realpath "$0")")"/..
SOURCE_PATH=$SCRIPTS_PATH/../../src
#checking for parameters
if [ "$#" -eq 0 ]
then
BUNDLE_PATH=$SOURCE_PATH/install
else
BUNDLE_PATH=$(realpath $1)
fi
#if(! (Test-Path meshlab.exe)){ #meshlab.exe not found inside $DISTRIB_PATH
# cd $DIR
# throw 'meshlab.exe not found in ' + ($BUNDLE_PATH) + '. Exiting.'
#}
VERSION=$(cat $SOURCE_PATH/../ML_VERSION)
sed "s%MESHLAB_VERSION%$VERSION%g" $SCRIPTS_PATH/resources/meshlab.nsi > $SCRIPTS_PATH/resources/meshlab_final.nsi
sed -i "s%DISTRIB_PATH%.%g" $SCRIPTS_PATH/resources/meshlab_final.nsi
mv $SCRIPTS_PATH/resources/meshlab_final.nsi $BUNDLE_PATH/
cp $SCRIPTS_PATH/resources/ExecWaitJob.nsh $BUNDLE_PATH/
cp $SCRIPTS_PATH/resources/FileAssociation.nsh $BUNDLE_PATH/

63
scripts/macOS/1_build.sh Normal file
View File

@ -0,0 +1,63 @@
#!/bin/bash
# this is a script shell for compiling meshlab in a MacOS environment.
# Requires a Qt environment which is set-up properly, and an accessible
# cmake binary.
#
# Without given arguments, MeshLab will be built in the meshlab/src/build
# directory, and installed in $BUILD_PATH/../install.
#
# You can give as argument the BUILD_PATH and the INSTALL_PATH in the
# following way:
# sh macos_build.sh --build_path=/path/to/build --install_path=/path/to/install
# -b and -i arguments are also supported.
#realpath function
#realpath() {
# [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
#}
#default paths wrt the script folder
SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SOURCE_PATH=$SCRIPTS_PATH/../../src
BUILD_PATH=$SOURCE_PATH/build
INSTALL_PATH=$SOURCE_PATH/install
CORES="-j4"
#check parameters
for i in "$@"
do
case $i in
-b=*|--build_path=*)
BUILD_PATH="${i#*=}"
shift # past argument=value
;;
-i=*|--install_path=*)
INSTALL_PATH="${i#*=}"
shift # past argument=value
;;
-j*)
CORES=$i
shift # past argument=value
;;
*)
# unknown option
;;
esac
done
#create build path if necessary
if ! [ -d $BUILD_PATH ]
then
mkdir -p $BUILD_PATH
fi
#create install path if necessary
if ! [ -d $INSTALL_PATH ]
then
mkdir -p $INSTALL_PATH
fi
cd $BUILD_PATH
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SOURCE_PATH
make $CORES
make install

48
scripts/macOS/2_deploy.sh Executable file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# this is a script shell for deploying a meshlab-portable app.
# Requires a properly built meshlab.
#
# Without given arguments, the folder that will be deployed is meshlab/distrib.
#
# You can give as argument the DISTRIB_PATH.
#
# After running this script, $DISTRIB_PATH/meshlab.app will be a portable meshlab application.
#realpath function
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
#checking for parameters
if [ "$#" -eq 0 ]
then
INSTALL_PATH=$SCRIPTS_PATH/../../src/install
else
INSTALL_PATH=$(realpath $1)
fi
APPNAME="meshlab.app"
echo "Hopefully I should find " $INSTALL_PATH/$APPNAME
if ! [ -e $INSTALL_PATH/$APPNAME -a -d $INSTALL_PATH/$APPNAME ]
then
echo "Started in the wrong dir: I have not found the meshlab.app"
exit -1
fi
#copy libIFX libraries and change rpath u3d plugin
#cp -a $DISTRIB_PATH/lib/meshlab/libIFX* $DISTRIB_PATH/$APPNAME/Contents/Frameworks
#rm $DISTRIB_PATH/$APPNAME/Contents/Frameworks/libIFXCoreStatic.a
#install_name_tool -change libIFXCore.1.so @rpath/libIFXCore.1.so $DISTRIB_PATH/$APPNAME/Contents/PlugIns/libio_u3d.dylib
#install_name_tool -change libIFXExporting.1.so @rpath/libIFXExporting.1.so $DISTRIB_PATH/$APPNAME/Contents/PlugIns/libio_u3d.dylib
#install_name_tool -change libIFXScheduling.1.so @rpath/libIFXScheduling.1.so $DISTRIB_PATH/$APPNAME/Contents/PlugIns/libio_u3d.dylib
if [ -e $QTDIR/bin/macdeployqt ]
then
$QTDIR/bin/macdeployqt $INSTALL_PATH/$APPNAME
else
macdeployqt $INSTALL_PATH/$APPNAME
fi

47
scripts/macOS/3_dmg.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# this is a script shell for setting up the application DMG for MacOS.
# Requires a properly built and deployed meshlab (requires to run the
# macos_deploy.sh script first).
#
# Without given arguments, meshlab.app will be looked for in meshlab/distrib
# folder. MeshLab DMG will be placed in the same directory of meshlab.app.
#
# You can give as argument the DISTRIB_PATH containing meshlab.app.
#realpath function
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
SCRIPTS_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
#checking for parameters
if [ "$#" -eq 0 ]
then
INSTALL_PATH=$SCRIPTS_PATH/../../src/install
else
INSTALL_PATH=$( realpath $1 )
fi
if ! [ -e $INSTALL_PATH/meshlab.app -a -d $INSTALL_PATH/meshlab.app ]
then
echo "Started in the wrong dir: I have not found the meshlab.app"
exit -1
fi
SOURCE_PATH=$SCRIPTS_PATH/../../src
# final step create the dmg using appdmg
# appdmg is installed with 'npm install -g appdmg'",
sed "s%DISTRIB_PATH%$INSTALL_PATH%g" $SCRIPTS_PATH/resources/meshlab_dmg_latest.json > $SCRIPTS_PATH/resources/meshlab_dmg_final.json
sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" $SCRIPTS_PATH/resources/meshlab_dmg_final.json
rm -f $INSTALL_PATH/*.dmg
echo "Running appdmg"
appdmg $SCRIPTS_PATH/resources/meshlab_dmg_final.json $INSTALL_PATH/MeshLab$(cat $SCRIPTS_PATH/../../ML_VERSION).dmg
rm $SCRIPTS_PATH/resources/meshlab_dmg_final.json
#at this point, distrib folder contains a DMG MeshLab file
echo "distrib folder now contains a DMG file"

32
scripts/macOS/README.md Normal file
View File

@ -0,0 +1,32 @@
# MacOS Scripts
This folder contains a series of scripts to build and deploy MeshLab under a MacOS environment.
* `0_setup_env.sh`: this script installs all the required dependencies that are necessary to build MeshLab and to create its DMG in a MacOS machine (tested in 10.15 Catalina). It requires [homebrew](https://brew.sh/) installed;
* `1_build.sh`: this script builds MeshLab in a MacOS environment:
* it requires a properly set Qt environment (see `0_setup_env.sh`);
* takes as arguments:
* the build directory (default: `src/build`): `--build_path=path/to/build`
* the install directory (default: `src/install`): `--install_path=path/to/install`
* the number of cores used to build MeshLab (default: `-j4`)`
* `2_deploy.sh`: this script makes portable a `meshlab.app` appdir. Takes as argument the path where the output install path of the `1_build.sh` script is placed (default: `src/install`);
* `3_dmg.sh`: this script generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Takes as argument the path where the install path of the `2_deploy.sh` script is placed (default: `src/install`);
* `make_it.sh`: this script builds, deploys and generates a [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) that can be used to install MeshLab. Arguments are the same of the `1_build.sh` script.
## Examples
Building MeshLab on a clean MacOS environment (build placed in `meshlab/src/build`):
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
sh meshlab/scripts/macOS/0_setup_env.sh
sh meshlab/scripts/macOS/1_build.sh
Building and generating a DMG on a clean MacOS environment:
* build directory: `./meshlab-build`
* install directory: `./meshlab-install`
* DMG path: `./`
git clone --recursive https://github.com/cnr-isti-vclab/meshlab
sh meshlab/scripts/macOS/0_setup_env.sh
sh meshlab/scripts/macOS/make_it.sh --build_path="./meshlab-build" --install_path="./meshlab-install"

View File

@ -17,7 +17,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
BUILD_PATH="../../../src"
else
BUILD_PATH=$( realpath $1 )
fi
@ -31,7 +31,7 @@ then
fi
echo "Build path is: " $(realpath $BUILD_PATH)
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro

View File

@ -17,7 +17,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
BUILD_PATH="../../../src"
else
BUILD_PATH=$( realpath $1 )
fi
@ -31,7 +31,7 @@ then
fi
echo "Build path is: " $(realpath $BUILD_PATH)
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro CONFIG+=debug

View File

@ -17,7 +17,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
BUILD_PATH="../../../src"
else
BUILD_PATH=$( realpath $1 )
fi
@ -31,7 +31,7 @@ then
fi
echo "Build path is: " $(realpath $BUILD_PATH)
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
cd $BUILD_PATH
qmake $SOURCE_PATH/meshlab.pro "CONFIG+=meshlab_mini"

View File

@ -16,7 +16,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
DISTRIB_PATH="../../distrib"
DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$( realpath $1 )
fi
@ -24,7 +24,7 @@ fi
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR #move to script directory
SOURCE_PATH=$PWD/../../src
SOURCE_PATH=$PWD/../../../src
APPNAME="meshlab.app"

View File

@ -16,7 +16,7 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
DISTRIB_PATH="../../distrib"
DISTRIB_PATH="../../../distrib"
else
DISTRIB_PATH=$( realpath $1 )
fi
@ -32,17 +32,17 @@ then
exit -1
fi
SOURCE_PATH=$DIR/../../src
SOURCE_PATH=$DIR/../../../src
# final step create the dmg using appdmg
# appdmg is installed with 'npm install -g appdmg'",
sed "s%DISTRIB_PATH%$DISTRIB_PATH%g" resources/meshlab_dmg_latest.json > resources/meshlab_dmg_final.json
sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" resources/meshlab_dmg_final.json
sed "s%DISTRIB_PATH%$DISTRIB_PATH%g" ../resources/meshlab_dmg_latest.json > ../resources/meshlab_dmg_final.json
sed -i '' "s%SOURCE_PATH%$SOURCE_PATH%g" ../resources/meshlab_dmg_final.json
rm -f $DISTRIB_PATH/*.dmg
echo "Running appdmg"
appdmg resources/meshlab_dmg_final.json $DISTRIB_PATH/MeshLab$(cat ../../ML_VERSION).dmg
appdmg ../resources/meshlab_dmg_final.json $DISTRIB_PATH/MeshLab$(cat ../../../ML_VERSION).dmg
#at this point, distrib folder contains a DMG MeshLab file
echo "distrib folder now contains a DMG file"

View File

@ -18,8 +18,8 @@ realpath() {
#checking for parameters
if [ "$#" -eq 0 ]
then
BUILD_PATH="../../src"
DISTRIB_PATH="../../distrib"
BUILD_PATH="../../../src"
DISTRIB_PATH="../../../distrib"
else
BUILD_PATH=$( realpath $1 )
DISTRIB_PATH=$BUILD_PATH/distrib

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -19,9 +19,6 @@ apps:
command: desktop-launch $SNAP/AppRun
plugs: [home, x11, mir, opengl, removable-media]
desktop: usr/share/applications/meshlab.desktop
meshlabserver:
command: desktop-launch meshlabserver
plugs: [home, x11, opengl, removable-media]
parts:
@ -44,6 +41,7 @@ parts:
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libqt5qml5
- libgdk-pixbuf2.0-0
- libqt5svg5
- try:
@ -65,9 +63,9 @@ parts:
- libglu1-mesa-dev
- lib3ds-dev
- libglew-dev
- libeigen3-dev
- libopenctm-dev
- libgmp-dev
- libeigen3-dev
- libopenctm-dev
- libgmp-dev
- libqhull-dev
- chrpath
stage-packages:
@ -77,19 +75,17 @@ parts:
- libqhull7
- libglew-dev
- libqt5opengl5-dev
- qtdeclarative5-dev
- libqt5xmlpatterns5-dev
- libqt5gui5
override-build: |
qmake src/meshlab.pro "CONFIG+= system_eigen3 system_glew system_bzip2 system_openctm system_lib3ds"
make -j4
sh install/linux/linux_make_boundle.sh distrib/
rsync -av distrib/* $SNAPCRAFT_PART_INSTALL/
rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab_server.desktop
override-build: |
sh scripts/Linux/1_build.sh
sh scripts/Linux/resources/make_bundle.sh
rsync -av src/install/* $SNAPCRAFT_PART_INSTALL/
rm $SNAPCRAFT_PART_INSTALL/usr/share/applications/meshlab.desktop
cp install/linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
cp install/linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
cp scripts/Linux/resources/snap/meshlab.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/
cp scripts/Linux/resources/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/
mv $SNAPCRAFT_PART_INSTALL/AppRunMeshLab $SNAPCRAFT_PART_INSTALL/AppRun
chmod +x $SNAPCRAFT_PART_INSTALL/AppRun

View File

@ -6,58 +6,30 @@ project(MeshLab)
# Prefer GLVND
if(POLICY CMP0072)
cmake_policy(SET CMP0072 NEW)
cmake_policy(SET CMP0072 NEW)
endif()
### vcglib
if(NOT VCGDIR)
get_filename_component(VCGDIR "${CMAKE_CURRENT_SOURCE_DIR}/../vcglib" ABSOLUTE)
if(NOT EXISTS ${VCGDIR})
set(VCGDIR NOTFOUND)
endif()
get_filename_component(VCGDIR "${CMAKE_CURRENT_SOURCE_DIR}/vcglib" ABSOLUTE)
if(NOT EXISTS ${VCGDIR})
set(VCGDIR NOTFOUND)
endif()
endif()
set(VCGDIR
"${VCGDIR}"
CACHE PATH "The location of the vcglib source tree - defaults to sibling of meshlab directory.")
"${VCGDIR}")
if(NOT VCGDIR)
message(
FATAL_ERROR
"vcglib is required to build MeshLab. Please get the source and set VCGDIR to its location: default location is as a sibling to the meshlab directory above this directory."
)
message(
FATAL_ERROR
"vcglib is required to build MeshLab. Please get the source and set VCGDIR to its location: default location is as a sibling to the meshlab directory above this directory."
)
endif()
### Build options
option(BUILD_MINI "Build only a minimal set of plugins" OFF)
option(BUILD_STRICT "Strictly enforce resolution of all symbols" ON)
set(BUILD_ADDITIONAL_PLUGINS
${BUILD_ADDITIONAL_PLUGINS}
CACHE
STRING
"A list of other plugin subdirectories to recurse into (e.g. select experimental or unsupported plugins) - relative to meshlab/src"
)
option(ALLOW_BUNDLED_EIGEN "Allow use of bundled Eigen source" ON)
option(ALLOW_BUNDLED_GLEW "Allow use of bundled GLEW source" ON)
option(ALLOW_BUNDLED_NEWUOA "Allow use of bundled newuoa source" ON)
option(ALLOW_BUNDLED_LEVMAR "Allow use of bundled levmar source" ON)
option(ALLOW_BUNDLED_LIB3DS "Allow use of bundled lib3ds source" ON)
# option(ALLOW_BUNDLED_MPIR "Allow use of bundled MPIR binaries" ON) # TODO
option(ALLOW_BUNDLED_MUPARSER "Allow use of bundled muparser source" ON)
option(ALLOW_BUNDLED_OPENCTM "Allow use of bundled OpenCTM source" ON)
option(ALLOW_BUNDLED_SSYNTH "Allow use of bundled structure-synth source" ON)
option(ALLOW_BUNDLED_QHULL "Allow use of bundled Qhull source" ON)
option(ALLOW_BUNDLED_U3D "Allow use of bundled u3d source" ON)
option(ALLOW_BUNDLED_OPENGR "Allow use of bundled OpenGR source" ON)
option(ALLOW_SYSTEM_EIGEN "Allow use of system-provided Eigen" ON)
option(ALLOW_SYSTEM_GLEW "Allow use of system-provided GLEW" ON)
option(ALLOW_SYSTEM_LIB3DS "Allow use of system-provided lib3ds" ON)
option(ALLOW_SYSTEM_GMP "Allow use of system-provided GMP" ON)
option(ALLOW_SYSTEM_MUPARSER "Allow use of system-provided muparser" ON)
option(ALLOW_SYSTEM_OPENCTM "Allow use of system-provided OpenCTM" ON)
option(ALLOW_SYSTEM_QHULL "Allow use of system-provided QHull" ON)
### Dependencies
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -68,9 +40,9 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(
Qt5
COMPONENTS OpenGL Xml XmlPatterns
REQUIRED)
Qt5
COMPONENTS OpenGL Xml XmlPatterns
REQUIRED)
message(STATUS "Searching for required components with bundled fallback")
find_package(GLEW)
@ -85,55 +57,50 @@ find_package(OpenCTM)
find_package(Qhull COMPONENTS libqhull)
find_package(OpenMP)
if(WIN32)
option(INSTALL_TO_UNIX_LAYOUT
"Should the files be installed to a unix layout? If false, they will be installed more like the build tree."
OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
get_target_property(Qt5_qmake_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(Qt5_BIN_DIR "${Qt5_qmake_EXECUTABLE}" DIRECTORY)
find_program(
Qt5_windeployqt_EXECUTABLE
NAMES windeployqt
HINTS ${Qt5_BIN_DIR})
if(Qt5_windeployqt_EXECUTABLE)
option(BUILD_WITH_WINDEPLOYQT_POST_BUILD
"Should we run windeployqt after the build to copy the qt parts to the build tree?" ON)
endif()
if(WIN32 OR APPLE)
option(INSTALL_TO_UNIX_LAYOUT
"Should the files be installed to a unix layout? If false, they will be installed more like the build tree."
OFF)
else()
set(INSTALL_TO_UNIX_LAYOUT ON)
set(INSTALL_TO_UNIX_LAYOUT ON)
endif()
option(INSTALL_SAMPLE_MESHES
"Should the sample meshes in src/distrib/samples be installed? It will increase the installed size by 14 MiB."
OFF)
"Should the sample meshes in src/distrib/samples be installed? It will increase the installed size by 14 MiB."
OFF)
option(
INSTALL_SAMPLE_RANGEMAPS
"Should the sample rangemaps in src/distrib/samples/rangemaps be installed? It will increase the installed size by 67 MiB."
OFF)
INSTALL_SAMPLE_RANGEMAPS
"Should the sample rangemaps in src/distrib/samples/rangemaps be installed? It will increase the installed size by 67 MiB."
OFF)
### Settings needed for both "external" and internal code
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("${CMAKE_CURRENT_SOURCE_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})
set(MESHLAB_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/meshlab)
set(MESHLAB_PLUGIN_INSTALL_DIR ${MESHLAB_LIB_INSTALL_DIR}/plugins)
set(MESHLAB_SHADER_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab/shaders)
set(MESHLAB_SAMPLE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab)
set(MESHLAB_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
set(MESHLAB_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/meshlab)
set(MESHLAB_PLUGIN_INSTALL_DIR ${MESHLAB_LIB_INSTALL_DIR}/plugins)
set(MESHLAB_SHADER_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab/shaders)
set(MESHLAB_SAMPLE_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/meshlab)
elseif(APPLE)
set(MESHLAB_BIN_INSTALL_DIR .)
set(MESHLAB_LIB_INSTALL_DIR meshlab.app/Contents/Frameworks)
set(MESHLAB_PLUGIN_INSTALL_DIR meshlab.app/Contents/PlugIns)
set(MESHLAB_SHADER_INSTALL_DIR meshlab.app/Contents/shaders)
set(MESHLAB_SAMPLE_INSTALL_DIR .)
else()
set(MESHLAB_BIN_INSTALL_DIR .)
set(MESHLAB_LIB_INSTALL_DIR .)
set(MESHLAB_PLUGIN_INSTALL_DIR plugins)
set(MESHLAB_SHADER_INSTALL_DIR shaders)
set(MESHLAB_SAMPLE_INSTALL_DIR .)
set(MESHLAB_BIN_INSTALL_DIR .)
set(MESHLAB_LIB_INSTALL_DIR .)
set(MESHLAB_PLUGIN_INSTALL_DIR plugins)
set(MESHLAB_SHADER_INSTALL_DIR shaders)
set(MESHLAB_SAMPLE_INSTALL_DIR .)
endif()
set(MESHLAB_BUILD_DISTRIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/distrib)
@ -143,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})
@ -151,146 +122,143 @@ include_directories(${EIGEN_INCLUDE_DIRS})
add_definitions(-DMESHLAB_SCALAR=float)
if(BUILD_STRICT AND NOT MSVC)
# Make sure that our shared libraries were appropriately linked
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
if(BUILD_STRICT AND NOT MSVC AND NOT APPLE)
# Make sure that our shared libraries were appropriately linked
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
endif()
if (BUILD_STRICT AND APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-undefined,error")
endif()
if(WIN32)
add_definitions(-DNOMINMAX)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif()
add_definitions(-DNOMINMAX)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif()
endif()
### Enter subdirectories
add_subdirectory(common)
set(CMAKE_INSTALL_RPATH $ORIGIN/../${MESHLAB_LIB_INSTALL_DIR};$ORIGIN/../${CMAKE_INSTALL_LIBDIR})
if (NOT APPLE)
set(CMAKE_INSTALL_RPATH $ORIGIN/../${MESHLAB_LIB_INSTALL_DIR};$ORIGIN/../${CMAKE_INSTALL_LIBDIR})
else()
SET(CMAKE_INSTALL_RPATH $ORIGIN/../Frameworks)
endif()
add_subdirectory(meshlab)
add_subdirectory(meshlabserver)
if (WIN32)
add_subdirectory(use_cpu_opengl)
endif()
set(CMAKE_INSTALL_RPATH)
if (WIN32)
add_subdirectory(use_cpu_opengl)
endif()
### Plugin subdirectories
if(BUILD_MINI)
# mini
set(POSSIBLE_PLUGINS
meshlabplugins/io_base
meshlabplugins/filter_meshing
meshlabplugins/decorate_base
meshlabplugins/filter_measure)
# mini
set(POSSIBLE_PLUGINS
meshlabplugins/io_base
meshlabplugins/filter_meshing
meshlabplugins/decorate_base
meshlabplugins/filter_measure)
else()
# full
# full
set(POSSIBLE_PLUGINS
# IO plugins
meshlabplugins/io_3ds
meshlabplugins/io_base
meshlabplugins/io_bre
meshlabplugins/io_collada
meshlabplugins/io_ctm
meshlabplugins/io_expe
meshlabplugins/io_json
meshlabplugins/io_pdb
meshlabplugins/io_tri
meshlabplugins/io_txt
meshlabplugins/io_u3d
meshlabplugins/io_x3d
set(POSSIBLE_PLUGINS
# IO plugins
meshlabplugins/io_3ds
meshlabplugins/io_base
meshlabplugins/io_bre
meshlabplugins/io_collada
meshlabplugins/io_ctm
meshlabplugins/io_expe
meshlabplugins/io_json
meshlabplugins/io_pdb
meshlabplugins/io_tri
meshlabplugins/io_txt
meshlabplugins/io_u3d
meshlabplugins/io_x3d
# Filter plugins
# meshlabplugins/filter_aging # not in qmake file?
# meshlabplugins/filter_bnpts # not in qmake file?
meshlabplugins/filter_ao
meshlabplugins/filter_camera
meshlabplugins/filter_clean
meshlabplugins/filter_color_projection
meshlabplugins/filter_colorproc
meshlabplugins/filter_create
meshlabplugins/filter_csg
meshlabplugins/filter_dirt
meshlabplugins/filter_fractal
meshlabplugins/filter_func
meshlabplugins/filter_globalregistration
meshlabplugins/filter_img_patch_param
meshlabplugins/filter_isoparametrization
meshlabplugins/filter_layer
meshlabplugins/filter_measure
meshlabplugins/filter_meshing
meshlabplugins/filter_mls
meshlabplugins/filter_mutualglobal
meshlabplugins/filter_mutualinfo
meshlabplugins/filter_plymc
meshlabplugins/filter_qhull
meshlabplugins/filter_quality
meshlabplugins/filter_sampling
meshlabplugins/filter_screened_poisson
meshlabplugins/filter_sdfgpu
meshlabplugins/filter_select
meshlabplugins/filter_sketchfab
meshlabplugins/filter_ssynth
meshlabplugins/filter_texture
meshlabplugins/filter_trioptimize
meshlabplugins/filter_unsharp
meshlabplugins/filter_voronoi
# Filter plugins
# meshlabplugins/filter_aging # not in qmake file?
# meshlabplugins/filter_bnpts # not in qmake file?
meshlabplugins/filter_ao
meshlabplugins/filter_camera
meshlabplugins/filter_clean
meshlabplugins/filter_color_projection
meshlabplugins/filter_colorproc
meshlabplugins/filter_create
meshlabplugins/filter_csg
meshlabplugins/filter_dirt
meshlabplugins/filter_fractal
meshlabplugins/filter_func
meshlabplugins/filter_globalregistration
meshlabplugins/filter_img_patch_param
meshlabplugins/filter_isoparametrization
meshlabplugins/filter_layer
meshlabplugins/filter_measure
meshlabplugins/filter_meshing
meshlabplugins/filter_mls
meshlabplugins/filter_mutualglobal
meshlabplugins/filter_mutualinfo
meshlabplugins/filter_plymc
meshlabplugins/filter_qhull
meshlabplugins/filter_quality
meshlabplugins/filter_sampling
meshlabplugins/filter_screened_poisson
meshlabplugins/filter_sdfgpu
meshlabplugins/filter_select
meshlabplugins/filter_sketchfab
meshlabplugins/filter_ssynth
meshlabplugins/filter_texture
meshlabplugins/filter_trioptimize
meshlabplugins/filter_unsharp
meshlabplugins/filter_voronoi
# Rendering and Decoration Plugins
meshlabplugins/render_gdp
meshlabplugins/render_radiance_scaling
meshlabplugins/decorate_base
meshlabplugins/decorate_background
meshlabplugins/decorate_raster_proj
meshlabplugins/decorate_shadow
# Rendering and Decoration Plugins
meshlabplugins/render_gdp
meshlabplugins/render_radiance_scaling
meshlabplugins/decorate_base
meshlabplugins/decorate_background
meshlabplugins/decorate_raster_proj
meshlabplugins/decorate_shadow
# Edit Plugins
meshlabplugins/edit_align
# meshlabplugins/edit_hole # not in qmake file?
meshlabplugins/edit_manipulators
meshlabplugins/edit_measure
meshlabplugins/edit_mutualcorrs
meshlabplugins/edit_paint
meshlabplugins/edit_pickpoints
meshlabplugins/edit_point
meshlabplugins/edit_referencing
meshlabplugins/edit_quality
meshlabplugins/edit_select
# meshlabplugins/edit_slice # not in qmake file?
# meshlabplugins/edit_texture # not in qmake file?
# Edit Plugins
meshlabplugins/edit_align
# meshlabplugins/edit_hole # not in qmake file?
meshlabplugins/edit_manipulators
meshlabplugins/edit_measure
meshlabplugins/edit_mutualcorrs
meshlabplugins/edit_paint
meshlabplugins/edit_pickpoints
meshlabplugins/edit_point
meshlabplugins/edit_referencing
meshlabplugins/edit_quality
meshlabplugins/edit_select
# meshlabplugins/edit_slice # not in qmake file?
# meshlabplugins/edit_texture # not in qmake file?
# Sample Plugins
meshlabplugins/edit_sample
meshlabplugins/filter_sample
meshlabplugins/filter_sample_dyn
meshlabplugins/filter_createiso
meshlabplugins/filter_geodesic
meshlabplugins/filter_sample_gpu)
# Sample Plugins
meshlabplugins/edit_sample
meshlabplugins/filter_sample
meshlabplugins/filter_sample_dyn
meshlabplugins/filter_createiso
meshlabplugins/filter_geodesic
meshlabplugins/filter_sample_gpu)
endif()
message(STATUS "\nConfiguring plugins")
foreach(PLUGIN ${POSSIBLE_PLUGINS})
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN}/CMakeLists.txt)
message(STATUS "- ${PLUGIN}")
add_subdirectory(${PLUGIN})
else()
message(STATUS " - ${PLUGIN} - Skipping, plugin or build system not found.")
endif()
endforeach()
if(BUILD_ADDITIONAL_PLUGINS)
message(STATUS "\nConfiguring plugins specified in BUILD_ADDITIONAL_PLUGINS")
endif()
foreach(PLUGIN ${BUILD_ADDITIONAL_PLUGINS})
get_filename_component(PLUGIN_DIR ${PLUGIN} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if(EXISTS ${PLUGIN_DIR}/CMakeLists.txt)
message(STATUS "- ${PLUGIN}")
add_subdirectory(${PLUGIN_DIR})
else()
message(FATAL_ERROR "${PLUGIN} - Additional plugin specified in BUILD_ADDITIONAL_PLUGINS but not found.")
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGIN}/CMakeLists.txt)
message(STATUS "- ${PLUGIN}")
add_subdirectory(${PLUGIN})
else()
message(STATUS " - ${PLUGIN} - Skipping, plugin or build system not found.")
endif()
endforeach()
### Copy/install other files
@ -301,24 +269,24 @@ set(COPIED_FILES)
# shaders
# TODO subdirs?
file(
GLOB SHADERS
LIST_DIRECTORIES false
"${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.vert" "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.frag"
"${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.gdp")
GLOB SHADERS
LIST_DIRECTORIES false
"${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.vert" "${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.frag"
"${CMAKE_CURRENT_SOURCE_DIR}/../distrib/shaders/*.gdp")
foreach(FN ${SHADERS})
get_filename_component(NAME_ONLY ${FN} NAME)
set(OUTFN ${MESHLAB_SHADER_OUTPUT_DIR}/${NAME_ONLY})
add_custom_command(
OUTPUT ${OUTFN}
COMMAND ${CMAKE_COMMAND} -E make_directory "${MESHLAB_SHADER_OUTPUT_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FN}" "${OUTFN}"
COMMENT "Copying ${NAME_ONLY} to shader build directory"
VERBATIM)
install(
FILES ${FN}
DESTINATION ${MESHLAB_SHADER_INSTALL_DIR}
COMPONENT Shaders)
list(APPEND COPIED_FILES "${OUTFN}")
get_filename_component(NAME_ONLY ${FN} NAME)
set(OUTFN ${MESHLAB_SHADER_OUTPUT_DIR}/${NAME_ONLY})
add_custom_command(
OUTPUT ${OUTFN}
COMMAND ${CMAKE_COMMAND} -E make_directory "${MESHLAB_SHADER_OUTPUT_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${FN}" "${OUTFN}"
COMMENT "Copying ${NAME_ONLY} to shader build directory"
VERBATIM)
install(
FILES ${FN}
DESTINATION ${MESHLAB_SHADER_INSTALL_DIR}
COMPONENT Shaders)
list(APPEND COPIED_FILES "${OUTFN}")
endforeach()
# Custom target - to trigger the execution of the custom commands above.
@ -326,26 +294,22 @@ add_custom_target(copy-distrib-files ALL DEPENDS ${COPIED_FILES})
set_property(TARGET copy-distrib-files PROPERTY FOLDER Core)
if(INSTALL_SAMPLE_MESHES)
# Install sample files from distrib/sample directory (except for the rangemaps)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample
DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}
COMPONENT Samples
PATTERN "*/rangemaps" EXCLUDE)
# Install sample files from distrib/sample directory (except for the rangemaps)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample
DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}
COMPONENT Samples
PATTERN "*/rangemaps" EXCLUDE)
endif()
if(INSTALL_SAMPLE_RANGEMAPS)
# Install sample rangemaps
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample/rangemaps
DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}/sample
COMPONENT Samples)
# Install sample rangemaps
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../sample/rangemaps
DESTINATION ${MESHLAB_SAMPLE_INSTALL_DIR}/sample
COMPONENT Samples)
endif()
if(NOT WIN32 AND NOT APPLE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../install/linux/resources/meshlab.desktop" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../install/meshlab.png" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
endif()
if(Qt5_windeployqt_EXECUTABLE AND BUILD_WITH_WINDEPLOYQT_POST_BUILD)
install(CODE "execute_process(COMMAND \"${Qt5_windeployqt_EXECUTABLE}\" --no-translations meshlab.exe WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX})")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/Linux/resources/meshlab.desktop" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../scripts/meshlab.png" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
endif()

View File

@ -1,76 +1,52 @@
# 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.
* [common](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/common): a series of utility functions used by MeshLab and its 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.
* [common](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/common): a series of utility classes and 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.
* [use_cpu_opengl](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/use_cpu_opengl): a tool compiled only under windows that allows to use non-GPU accelerated OpenGL calls;
* [vcglib](https://github.com/cnr-isti-vclab/meshlab/tree/master/src/vcglib): submodule containing the vcglib.
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.
mkdir meshlab/src/build
cd meshlab/src/build
cmake ..
make
You can also use `cmake`:
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.
4. 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.
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.

View File

@ -1,83 +1,76 @@
# Copyright 2019-2020, Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
### Generated file! Edit the templates in src/templates,
### specifically src/templates/common.cmake (custom for this directory),
### then re-run ./make-cmake.py
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION" MESHLAB_VERSION)
add_definitions(-DMESHLAB_VERSION=${MESHLAB_VERSION})
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../ML_VERSION" MESHLAB_VERSION)
add_definitions(-DMESHLAB_VERSION=${MESHLAB_VERSION})
endif()
set(SOURCES
filter_parameter/rich_parameter.cpp
filter_parameter/rich_parameter_list.cpp
filter_parameter/value.cpp
interfaces/decorate_plugin_interface.cpp
interfaces/filter_plugin_interface.cpp
interfaces/plugin_interface.cpp
GLExtensionsManager.cpp
GLLogStream.cpp
filterscript.cpp
meshlabdocumentbundler.cpp
meshlabdocumentxml.cpp
meshmodel.cpp
ml_selection_buffers.cpp
ml_shared_data_context.cpp
ml_thread_safe_memory_info.cpp
mlapplication.cpp
pluginmanager.cpp
searcher.cpp
${EXTERNAL_DIR}/easyexif/exif.cpp)
filter_parameter/rich_parameter.cpp
filter_parameter/rich_parameter_list.cpp
filter_parameter/value.cpp
interfaces/decorate_plugin_interface.cpp
interfaces/filter_plugin_interface.cpp
interfaces/plugin_interface.cpp
GLExtensionsManager.cpp
GLLogStream.cpp
filterscript.cpp
meshlabdocumentbundler.cpp
meshlabdocumentxml.cpp
meshmodel.cpp
ml_selection_buffers.cpp
ml_shared_data_context.cpp
ml_thread_safe_memory_info.cpp
mlapplication.cpp
pluginmanager.cpp
searcher.cpp
${EXTERNAL_DIR}/easyexif/exif.cpp)
set(HEADERS
filter_parameter/rich_parameter.h
filter_parameter/rich_parameter_list.h
filter_parameter/value.h
interfaces/decorate_plugin_interface.h
interfaces/edit_plugin_interface.h
interfaces/filter_plugin_interface.h
interfaces/io_plugin_interface.h
interfaces/mainwindow_interface.h
interfaces/plugin_interface.h
interfaces/render_plugin_interface.h
GLExtensionsManager.h
GLLogStream.h
filterscript.h
meshlabdocumentbundler.h
meshlabdocumentxml.h
meshmodel.h
ml_mesh_type.h
ml_selection_buffers.h
ml_shared_data_context.h
ml_thread_safe_memory_info.h
mlapplication.h
mlexception.h
pluginmanager.h
searcher.h)
set(RESOURCES common.qrc)
filter_parameter/rich_parameter.h
filter_parameter/rich_parameter_list.h
filter_parameter/value.h
interfaces/decorate_plugin_interface.h
interfaces/edit_plugin_interface.h
interfaces/filter_plugin_interface.h
interfaces/io_plugin_interface.h
interfaces/mainwindow_interface.h
interfaces/plugin_interface.h
interfaces/render_plugin_interface.h
GLExtensionsManager.h
GLLogStream.h
filterscript.h
meshlabdocumentbundler.h
meshlabdocumentxml.h
meshmodel.h
ml_mesh_type.h
ml_selection_buffers.h
ml_shared_data_context.h
ml_thread_safe_memory_info.h
mlapplication.h
mlexception.h
pluginmanager.h
searcher.h)
set(TARGET_TYPE SHARED)
if(WIN32)
set(TARGET_TYPE STATIC)
if(WIN32 OR APPLE)
set(TARGET_TYPE STATIC)
endif()
add_library(common ${TARGET_TYPE} ${SOURCES} ${HEADERS} ${RESOURCES})
set_target_properties(common PROPERTIES OUTPUT_NAME meshlab-common)
target_include_directories(common PRIVATE ${EXTERNAL_DIR}/easyexif/)
target_link_libraries(
common
PUBLIC Qt5::Core
Qt5::OpenGL
Qt5::Widgets
Qt5::Xml
Qt5::XmlPatterns
external-glew)
common
PUBLIC
Qt5::Core
Qt5::OpenGL
Qt5::Widgets
Qt5::Xml
Qt5::XmlPatterns
external-glew
)
set_property(TARGET common PROPERTY FOLDER Core)
if(NOT WIN32)
install(TARGETS common DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
install(TARGETS common DESTINATION ${MESHLAB_LIB_INSTALL_DIR})
endif()

View File

@ -1,6 +0,0 @@
<RCC>
<qresource prefix="/">
<file>script_system/meshlabfilterXMLspecificationformat.xsd</file>
<file>script_system/math.js</file>
</qresource>
</RCC>

View File

@ -7,38 +7,35 @@
#include "mlexception.h"
static QString DLLExtension() {
static QStringList fileNamePluginDLLs() {
QStringList l;
#if defined(Q_OS_WIN)
return QString("dll");
l.push_back("*.dll");
return l;
#elif defined(Q_OS_MAC)
return QString("dylib");
#else
return QString("so");
l.push_back("*.dylib");
l.push_back("*.so");
return l;
#else //linux
l.push_back("*.so");
return l;
#endif
assert(0 && "Unknown Operative System. Please Define the appropriate dynamic library extension");
return QString();
}
static QString DLLFileNamePreamble() {
static QString fileNamePrefixPluginDLLs() {
#if defined(Q_OS_WIN)
return QString("");
#elif defined(Q_OS_MAC)
return QString("lib");
#else
return QString("lib");
return QString("");
#else //macos and linux
return QString("lib");
#endif
assert(0 && "Unknown Operative System. Please Define the appropriate dynamic library preamble");
return QString();
}
PluginManager::PluginManager()
{
//pluginsDir=QDir(getPluginDirPath());
// without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
//qApp->addLibraryPath(getPluginDirPath());
//qApp->addLibraryPath(getBaseDirPath());
//pluginsDir=QDir(getPluginDirPath());
// without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
//qApp->addLibraryPath(getPluginDirPath());
//qApp->addLibraryPath(getBaseDirPath());
}
PluginManager::~PluginManager()
@ -50,7 +47,7 @@ PluginManager::~PluginManager()
for (PluginInterface* plugin : ownerPlug)
delete plugin;
ownerPlug.clear();
for (int ii = 0; ii < meshEditInterfacePlug.size(); ++ii)
delete meshEditInterfacePlug[ii];
meshEditInterfacePlug.clear();
@ -69,13 +66,11 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
// without adding the correct library path in the mac the loading of jpg (done via qt plugins) fails
qApp->addLibraryPath(getDefaultPluginDirPath());
qApp->addLibraryPath(getBaseDirPath());
QStringList pluginfilters;
pluginfilters << QString("*." + DLLExtension());
QStringList nameFiltersPlugins = fileNamePluginDLLs();
//only the file with extension pluginfilters will be listed by function entryList()
pluginsDir.setNameFilters(pluginfilters);
pluginsDir.setNameFilters(nameFiltersPlugins);
qDebug("Current Plugins Dir is: %s ", qUtf8Printable(pluginsDir.absolutePath()));
for(QString fileName : pluginsDir.entryList(QDir::Files))
{
@ -116,7 +111,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
iCommon = iIO;
meshIOPlug.push_back(iIO);
}
DecoratePluginInterface *iDecorator = qobject_cast<DecoratePluginInterface *>(plugin);
if (iDecorator)
{
@ -128,14 +123,14 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl
iDecorator->initGlobalParameterList(decoratorAction, defaultGlobal);
}
}
RenderPluginInterface *iRender = qobject_cast<RenderPluginInterface *>(plugin);
if (iRender)
{
iCommon = iRender;
meshRenderPlug.push_back(iRender);
}
EditPluginInterfaceFactory *iEditFactory = qobject_cast<EditPluginInterfaceFactory *>(plugin);
if (iEditFactory)
{
@ -164,13 +159,13 @@ int PluginManager::numberIOPlugins() const
// Search among all the decorator plugins the one that contains a decoration with the given name
DecoratePluginInterface *PluginManager::getDecoratorInterfaceByName(const QString& name)
{
foreach(DecoratePluginInterface *tt, this->meshDecoratePlugins())
{
foreach( QAction *ac, tt->actions())
if( name == tt->decorationName(ac) ) return tt;
}
assert(0);
return 0;
foreach(DecoratePluginInterface *tt, this->meshDecoratePlugins())
{
foreach( QAction *ac, tt->actions())
if( name == tt->decorationName(ac) ) return tt;
}
assert(0);
return 0;
}
/*
@ -188,7 +183,7 @@ QMap<QString, RichParameterList> PluginManager::generateFilterParameterMap()
for (ai = this->actionFilterMap.begin(); ai != this->actionFilterMap.end(); ++ai)
{
QString filterName = ai.key();// ->filterName();
//QAction act(filterName,NULL);
//QAction act(filterName,NULL);
RichParameterList rp;
stringFilterMap[filterName]->initParameterList(ai.value(), md, rp);
FPM[filterName] = rp;
@ -196,31 +191,26 @@ QMap<QString, RichParameterList> PluginManager::generateFilterParameterMap()
return FPM;
}
QString PluginManager::osDependentFileBaseName(const QString &plname)
{
return (DLLFileNamePreamble() + plname + "." + DLLExtension());
}
QString PluginManager::getBaseDirPath()
{
QDir baseDir(qApp->applicationDirPath());
#if defined(Q_OS_WIN)
// Windows:
// during development with visual studio binary could be in the debug/release subdir.
// once deployed plugins dir is in the application directory, so
if (baseDir.dirName() == "debug" || baseDir.dirName() == "release") baseDir.cdUp();
#endif
#if defined(Q_OS_MAC)
// Mac: during developmentwith xcode and well deployed the binary is well buried.
for(int i=0;i<6;++i){
if(baseDir.exists("plugins")) break;
baseDir.cdUp();
}
qDebug("The base dir is %s", qUtf8Printable(baseDir.absolutePath()));
// Mac: during developmentwith xcode and well deployed the binary is well buried.
for(int i=0;i<6;++i){
if(baseDir.exists("plugins")) break;
baseDir.cdUp();
}
qDebug("The base dir is %s", qUtf8Printable(baseDir.absolutePath()));
#endif
return baseDir.absolutePath();
return baseDir.absolutePath();
}
QString PluginManager::getDefaultPluginDirPath()
@ -230,7 +220,7 @@ QString PluginManager::getDefaultPluginDirPath()
QString d = pluginsDir.dirName();
QString dLower = d.toLower();
if (dLower == "release" || dLower == "relwithdebinfo" || dLower == "debug" ||
dLower == "minsizerel") {
dLower == "minsizerel") {
// This is a configuration directory for MS Visual Studio.
pluginsDir.cdUp();
} else {
@ -239,18 +229,18 @@ QString PluginManager::getDefaultPluginDirPath()
#endif
if (pluginsDir.exists("plugins")) {
pluginsDir.cd("plugins");
#if defined(Q_OS_WIN)
// Re-apply the configuration dir, if any.
if (!d.isEmpty() && pluginsDir.exists(d)) {
pluginsDir.cd(d);
}
#endif
return pluginsDir.absolutePath();
}
#if !defined(Q_OS_MAC) && !defined(Q_OS_WIN)
else if (pluginsDir.dirName() == "bin") {
else if (pluginsDir.dirName() == "bin") {
pluginsDir.cdUp();
pluginsDir.cd("lib");
pluginsDir.cd("meshlab");
@ -293,9 +283,9 @@ void PluginManager::knownIOFormats()
for (QList<IOPluginInterface::Format>::iterator itf = format.begin(); itf != format.end(); ++itf)
{
IOPluginInterface::Format currentFormat = *itf;
QString currentFilterEntry = currentFormat.description + " (";
//a particular file format could be associated with more than one file extension
QStringListIterator itExtension(currentFormat.extensions);
while (itExtension.hasNext())
@ -313,7 +303,7 @@ void PluginManager::knownIOFormats()
currentFilterEntry.append(')');
formatFilters->append(currentFilterEntry);
}
}
allKnownFormatsFilter.append(')');
if (formatFilters != NULL)
@ -325,7 +315,7 @@ QString PluginManager::osIndependentPluginName(const QString& plname)
{
QFileInfo fi(plname);
QString res = fi.baseName();
QString pref = DLLFileNamePreamble();
QString pref = fileNamePrefixPluginDLLs();
return res.remove(0, pref.size());
}

View File

@ -82,7 +82,6 @@ public:
QStringList pluginsLoaded;
static QString osDependentFileBaseName(const QString& plname);
static QString osIndependentPluginName(const QString& plname);
private:

File diff suppressed because it is too large Load Diff

View File

@ -1,185 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='MESHLAB_FILTER_INTERFACE'>
<xs:complexType>
<xs:sequence>
<xs:element ref='PLUGIN'/>
</xs:sequence>
<xs:attribute name='mfiVersion' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='PLUGIN'>
<xs:complexType>
<xs:sequence>
<xs:element ref='FILTER' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='pluginName' type='xs:string' use='required'/>
<xs:attribute name='pluginAuthor' type='xs:string' use='required'/>
<xs:attribute name='pluginEmail' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='FILTER' type='filterType'>
<xs:unique name="paramNameKey">
<xs:selector xpath="*/PARAM"/>
<xs:field xpath="parName"/>
</xs:unique>
</xs:element>
<xs:complexType name='filterType'>
<xs:sequence>
<xs:element ref='FILTER_HELP'/>
<xs:element ref='FILTER_JSCODE' minOccurs='0' maxOccurs='1'/>
<xs:element ref='PARAM' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='filterName' type='xs:string' use='required'/>
<xs:attribute name='filterFunction' type='xs:string' use='required'/>
<xs:attribute name='filterClass' type='xs:string' use='required'/>
<xs:attribute name='filterPre' type='xs:string' use='required'/>
<xs:attribute name='filterPost' type='xs:string' use='required'/>
<xs:attribute name='filterArity' type='ArityType' use='required'/>
<xs:attribute name='filterRasterArity' type='ArityRasterType' use='required'/>
<xs:attribute name='filterIsInterruptible' type='xs:string' use='required'/>
</xs:complexType>
<xs:element name='FILTER_HELP'>
<xs:complexType mixed='true'>
</xs:complexType>
</xs:element>
<xs:element name='FILTER_JSCODE'>
<xs:complexType mixed='true'>
</xs:complexType>
</xs:element>
<xs:element name='PARAM'>
<xs:complexType>
<xs:sequence>
<xs:element ref='PARAM_HELP'/>
<xs:choice>
<xs:element ref='CHECKBOX_GUI'/>
<xs:element ref='ABSPERC_GUI'/>
<xs:element ref='EDIT_GUI'/>
<xs:element ref='VEC3_GUI'/>
<xs:element ref='COLOR_GUI'/>
<xs:element ref='SLIDER_GUI'/>
<xs:element ref='ENUM_GUI'/>
<xs:element ref='MESH_GUI'/>
<xs:element ref='SHOT_GUI'/>
<xs:element ref='STRING_GUI'/>
</xs:choice>
</xs:sequence>
<xs:attribute name='parType' use='required'>
<xs:simpleType>
<xs:restriction base='xs:string'>
<xs:pattern value='Boolean'/>
<xs:pattern value='Int'/>
<xs:pattern value='Real'/>
<xs:pattern value='Vec3'/>
<xs:pattern value='Color'/>
<xs:pattern value='Mesh'/>
<xs:pattern value='CameraShot'/>
<xs:pattern value='String'/>
<xs:pattern value='Enum \{(\s*\S+(\s*\S*)*\s*\:\s*\d+\s*(\|)?)+\}'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='parName' type='xs:string' use='required'/>
<xs:attribute name='parDefault' type='xs:string' use='required'/>
<xs:attribute name='parIsImportant' type='xs:string' use='required'/>
<xs:attribute name='parIsPersistent' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='PARAM_HELP'>
<xs:complexType mixed='true'>
</xs:complexType>
</xs:element>
<xs:element name='CHECKBOX_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='EDIT_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='STRING_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='VEC3_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='ABSPERC_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
<xs:attribute name='guiMin' type='xs:string' use='required'/>
<xs:attribute name='guiMax' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='COLOR_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='SLIDER_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
<xs:attribute name='guiMin' type='xs:string' use='required'/>
<xs:attribute name='guiMax' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='ENUM_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='MESH_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:element name='SHOT_GUI'>
<xs:complexType>
<xs:attribute name='guiLabel' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>
<xs:simpleType name="ArityType">
<xs:restriction base="xs:string">
<xs:enumeration value="SingleMesh"/>
<xs:enumeration value="Fixed"/>
<xs:enumeration value="Variable"/>
<xs:enumeration value="FunctionDefined"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ArityRasterType">
<xs:restriction base="xs:string">
<xs:enumeration value="NoRaster"/>
<xs:enumeration value="SingleRaster"/>
<xs:enumeration value="Fixed"/>
<xs:enumeration value="Variable"/>
<xs:enumeration value="FunctionDefined"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@ -1,140 +0,0 @@
%option noyywrap
%option nounistd
%x MLCOMMENTSTATE
%{
#include "js_parser.tab.hh"
#include <cstdlib>
#include <cstdio>
#include <QtCore>
#include <io.h>
#define YY_DECL int yylex(yy::JSCacheParser::semantic_type* yylval,yy::JSCacheParser::location_type* yylloc)
#define YY_USER_ACTION yylloc->columns(yyleng);
typedef yy::JSCacheParser::token token;
%}
hex [0-9a-fA-F]
dec [1-9][0-9]*
oct [0-7]
digit [0-9]
letter [a-zA-Z]
fract {digit}*\.{digit}+|{digit}+\.
exp [eE][+-]?{digit}+
hexfract {hex}*\.{hex}+|{hex}+\.
binexp [pP][+-]?{digit}+
icst ({dec}|0{oct}*|0[xX]{hex}+)
%%
%{
yylloc->step();
%}
<MLCOMMENTSTATE>"*/" {BEGIN(INITIAL);}
<MLCOMMENTSTATE>[^*\n]+ {}
<MLCOMMENTSTATE>"*" {}
<MLCOMMENTSTATE>\n {}
"//"(.)* {}
"/*" {BEGIN(MLCOMMENTSTATE);}
"&&" {}
"&=" {}
"&" {}
"break" {}
"case" {}
"catch" {}
":" {return token::T_COLON;}
"," {return token::T_COMMA;}
"continue" {}
"default" {}
"delete" {}
"/=" {}
"/" {}
"do" {}
"." {return token::T_DOT;}
"else" {}
"===" {}
"==" {}
"=" {return token::T_EQ;}
"finally" {}
"for" {}
"function" {return token::T_FUNCTION;}
">>>=" {}
">>=" {}
">=" {}
">>" {}
">" {}
"if" {}
"in" {}
"instanceof" {}
"{" {return token::T_LBRACKET;}
"[" {return token::T_LBRACE;}
"<<=" {}
"<<" {}
"<=" {}
"<" {}
"(" {return token::T_LPAREN;}
"--" {}
"-=" {}
"-" {}
"new" {return token::T_NEW;}
"!==" {}
"!=" {}
"!" {}
"|=" {}
"||" {}
"|" {}
"+=" {}
"++" {}
"+" {}
"?" {}
"}" {return token::T_RBRACKET;}
"]" {return token::T_RBRACE;}
"%=" {}
"%" {}
"return" {}
")" {return token::T_RPAREN;}
";" {return token::T_SEMICOLON;}
"*=" {}
"*" {}
\"([^"\\]|\\.)*\" {return token::T_STRING_LITERAL;}
"switch" {}
"this" {return token::T_THIS;}
"throw" {}
"~" {}
"try" {}
"typeof" {}
"var" {return token::T_VAR;}
"void" {}
"while" {}
"with" {}
"^=" {}
"^" {}
"null" {return token::T_NULL;}
"true" {}
"false" {}
"const" {return token::T_CONST;}
"debugger" {}
"reserved" {}
{icst} {yylval->i = QString(yytext).toInt();return token::T_NUMERIC_LITERAL;}
{icst}[uU] {yylval->u = QString(yytext).toUInt();return token::T_NUMERIC_LITERAL;}
{icst}[uU][lL] {yylval->ul = QString(yytext).toULong();return token::T_NUMERIC_LITERAL;}
{icst}[lL][uU] {yylval->ul = QString(yytext).toULong();return token::T_NUMERIC_LITERAL;}
{icst}[lL] {yylval->l = QString(yytext).toLong();return token::T_NUMERIC_LITERAL;}
{icst}[uU](ll|LL) {yylval->l = QString(yytext).toULongLong();return token::T_NUMERIC_LITERAL;}
{icst}(ll|LL) {yylval->l = QString(yytext).toLongLong();return token::T_NUMERIC_LITERAL;}
{icst}(ll|LL)[uU] {yylval->l = QString(yytext).toULongLong();return token::T_NUMERIC_LITERAL;}
{fract}{exp}?[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
{digit}+{exp}[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
0[xX]{hexfract}{binexp}[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
0[xX]{hex}+{binexp}[flFL]? {yylval->f = QString(yytext).toFloat();return token::T_NUMERIC_LITERAL;}
({letter}|"_")+({letter}|{digit}|"_")* {yylval->s = new QString(yytext);return token::T_IDENTIFIER;}
[ \t\n] {}
%%

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,320 +0,0 @@
/* A Bison parser, made by GNU Bison 2.5. */
/* Skeleton interface for Bison LALR(1) parsers in C++
Copyright (C) 2002-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
#ifndef PARSER_HEADER_H
# define PARSER_HEADER_H
/* "%code requires" blocks. */
/* Line 35 of lalr1.cc */
#line 7 "js_parser.yy"
#include <QtCore>
#include "../../scriptsyntax.h"
/* Line 35 of lalr1.cc */
#line 50 "js_parser.tab.hh"
#include <string>
#include <iostream>
#include "stack.hh"
#include "location.hh"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
namespace yy {
/* Line 35 of lalr1.cc */
#line 80 "js_parser.tab.hh"
/// A Bison parser.
class JSCacheParser
{
public:
/// Symbol semantic values.
#ifndef YYSTYPE
union semantic_type
{
/* Line 35 of lalr1.cc */
#line 15 "js_parser.yy"
int i;
unsigned u;
unsigned long ul;
unsigned long long ull;
long l;
double d;
float f;
QString *s;
JSFunctionTypeDescriptor* ftd;
JSVarDescriptor* vd;
/* Line 35 of lalr1.cc */
#line 108 "js_parser.tab.hh"
};
#else
typedef YYSTYPE semantic_type;
#endif
/// Symbol locations.
typedef location location_type;
/// Tokens.
struct token
{
/* Tokens. */
enum yytokentype {
T_COLON = 258,
T_COMMA = 259,
T_DOT = 260,
T_EQ = 261,
T_FUNCTION = 262,
T_IDENTIFIER = 263,
T_LBRACE = 264,
T_LBRACKET = 265,
T_LPAREN = 266,
T_NEW = 267,
T_RBRACE = 268,
T_RBRACKET = 269,
T_RPAREN = 270,
T_SEMICOLON = 271,
T_STRING_LITERAL = 272,
T_THIS = 273,
T_NULL = 274,
T_VAR = 275,
T_CONST = 276,
T_NUMERIC_LITERAL = 277
};
};
/// Token type.
typedef token::yytokentype token_type;
/// Build a parser object.
JSCacheParser (JSSymbolsCache& symb_yyarg, QList<JSVarDescriptor>& tmp_yyarg);
virtual ~JSCacheParser ();
/// Parse.
/// \returns 0 iff parsing succeeded.
virtual int parse ();
#if YYDEBUG
/// The current debugging stream.
std::ostream& debug_stream () const;
/// Set the current debugging stream.
void set_debug_stream (std::ostream &);
/// Type for debugging levels.
typedef int debug_level_type;
/// The current debugging level.
debug_level_type debug_level () const;
/// Set the current debugging level.
void set_debug_level (debug_level_type l);
#endif
private:
/// Report a syntax error.
/// \param loc where the syntax error is found.
/// \param msg a description of the syntax error.
virtual void error (const location_type& loc, const std::string& msg);
/// Generate an error message.
/// \param state the state where the error occurred.
/// \param tok the lookahead token.
virtual std::string yysyntax_error_ (int yystate, int tok);
#if YYDEBUG
/// \brief Report a symbol value on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
#endif
/// State numbers.
typedef int state_type;
/// State stack type.
typedef stack<state_type> state_stack_type;
/// Semantic value stack type.
typedef stack<semantic_type> semantic_stack_type;
/// location stack type.
typedef stack<location_type> location_stack_type;
/// The state stack.
state_stack_type yystate_stack_;
/// The semantic value stack.
semantic_stack_type yysemantic_stack_;
/// The location stack.
location_stack_type yylocation_stack_;
/// Whether the given \c yypact_ value indicates a defaulted state.
/// \param yyvalue the value to check
static bool yy_pact_value_is_default_ (int yyvalue);
/// Whether the given \c yytable_ value indicates a syntax error.
/// \param yyvalue the value to check
static bool yy_table_value_is_error_ (int yyvalue);
/// Internal symbol numbers.
typedef unsigned char token_number_type;
/* Tables. */
/// For a state, the index in \a yytable_ of its portion.
static const signed char yypact_[];
static const signed char yypact_ninf_;
/// For a state, default reduction number.
/// Unless\a yytable_ specifies something else to do.
/// Zero means the default is an error.
static const unsigned char yydefact_[];
static const signed char yypgoto_[];
static const signed char yydefgoto_[];
/// What to do in a state.
/// \a yytable_[yypact_[s]]: what to do in state \a s.
/// - if positive, shift that token.
/// - if negative, reduce the rule which number is the opposite.
/// - if zero, do what YYDEFACT says.
static const signed char yytable_[];
static const signed char yytable_ninf_;
static const signed char yycheck_[];
/// For a state, its accessing symbol.
static const unsigned char yystos_[];
/// For a rule, its LHS.
static const unsigned char yyr1_[];
/// For a rule, its RHS length.
static const unsigned char yyr2_[];
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/// For a symbol, its name in clear.
static const char* const yytname_[];
#endif
#if YYDEBUG
/// A type to store symbol numbers and -1.
typedef signed char rhs_number_type;
/// A `-1'-separated list of the rules' RHS.
static const rhs_number_type yyrhs_[];
/// For each rule, the index of the first RHS symbol in \a yyrhs_.
static const unsigned char yyprhs_[];
/// For each rule, its source line number.
static const unsigned short int yyrline_[];
/// For each scanner token number, its symbol number.
static const unsigned short int yytoken_number_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
virtual void yy_reduce_print_ (int r);
/// Print the state stack on the debug stream.
virtual void yystack_print_ ();
/* Debugging. */
int yydebug_;
std::ostream* yycdebug_;
#endif
/// Convert a scanner token number \a t to a symbol number.
token_number_type yytranslate_ (int t);
/// \brief Reclaim the memory associated to a symbol.
/// \param yymsg Why this token is reclaimed.
/// \param yytype The symbol type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
/// Pop \a n symbols the three stacks.
inline void yypop_ (unsigned int n = 1);
/* Constants. */
static const int yyeof_;
/* LAST_ -- Last index in TABLE_. */
static const int yylast_;
static const int yynnts_;
static const int yyempty_;
static const int yyfinal_;
static const int yyterror_;
static const int yyerrcode_;
static const int yyntokens_;
static const unsigned int yyuser_token_number_max_;
static const token_number_type yyundef_token_;
/* User arguments. */
JSSymbolsCache& symb;
QList<JSVarDescriptor>& tmp;
};
} // yy
/* Line 35 of lalr1.cc */
#line 317 "js_parser.tab.hh"
#endif /* ! defined PARSER_HEADER_H */

View File

@ -1,295 +0,0 @@
%language "C++"
%defines /* generates .h */
%locations
%define parser_class_name "JSCacheParser"
%code requires
{
#include <QtCore>
#include "../../scriptsyntax.h"
}
%parse-param {JSSymbolsCache& symb} /*add a parameter member to the parser class*/
%parse-param {QList<JSVarDescriptor>& tmp} /*add a parameter member to the parser class*/
%union {
int i;
unsigned u;
unsigned long ul;
unsigned long long ull;
long l;
double d;
float f;
QString *s;
JSFunctionTypeDescriptor* ftd;
JSVarDescriptor* vd;
};
%token T_COLON
%token T_COMMA
%token T_DOT
%token T_EQ
%token T_FUNCTION
%token <s> T_IDENTIFIER
%token T_LBRACE
%token T_LBRACKET
%token T_LPAREN
%token T_NEW
%token T_RBRACE
%token T_RBRACKET
%token T_RPAREN
%token T_SEMICOLON
%token T_STRING_LITERAL
%token T_THIS
%token T_NULL
%token T_VAR
%token T_CONST
%token T_NUMERIC_LITERAL
%type <ftd> Expression NewExpr Assignment InitOpt;
%type <s> IdTok OptIdTok;
%{
extern int yylex(yy::JSCacheParser::semantic_type *yylval,yy::JSCacheParser::location_type *yylloc);
%}
%%
Program: StatementList;
StatementList:
| StatementList Statement
;
Statement: Block
| FunctionDecl
| VariableDeclStatement
| AssignmentStatement
| error T_SEMICOLON
{
qDebug() << "Parsing Error Recovery!!!\n";
}
;
Block: OpenBlock StatementList CloseBlock;
OpenBlock: T_LBRACKET
{
symb.pushFrame();
}
;
CloseBlock: T_RBRACKET
{
symb.popFrame();
}
;
VariableDeclStatement: DeclTok IdTok InitOpt OtherDeclOpt T_SEMICOLON
{
JSVarDescriptor vd(*$2,$3);
symb.currentFrame()[*$2] = vd;
}
;
AssignmentStatement: MemberExpr Assignment T_SEMICOLON
{
}
| ThisExpr Assignment T_SEMICOLON
{
}
;
OtherDeclOpt:
| OtherDeclOpt T_COMMA IdTok InitOpt
;
DeclTok: T_VAR
| T_CONST
;
Assignment: T_EQ Expression
{
$$ = $2;
}
;
InitOpt:
{
$$ = NULL;
}
| Assignment
;
/*divided in two rules in order to add formal parameters to current frame in the varsstack*/
FunctionDecl: StartFun StatementList CloseBlock;
StartFun: T_FUNCTION IdTok OpenBracket OptParamList CloseBracket OpenBlock
{
JSFunctionTypeDescriptor ftd(*$2);
symb.globalFunType()[*$2] = ftd;
}
;
StartOptFun : T_FUNCTION OptIdTok OpenBracket OptParamList CloseBracket
{
QString nm;
if (*$2 == "")
nm = QUuid::createUuid().toString();
JSFunctionTypeDescriptor ftd(nm);
}
;
OptParamList:
| IdTok OtherOptParamList
{
symb.currentFrame()[*$1] = JSVarDescriptor(*$1,NULL);
}
;
OtherOptParamList:
| OtherOptParamList T_COMMA IdTok
{
symb.currentFrame()[*$3] = JSVarDescriptor(*$3,NULL);
}
;
Expression: MemberExpr
{
$$ = NULL;
}
| ThisExpr
{
$$ = NULL;
}
| NewExpr
{
$$ = $1;
}
| FunctionExpr
{
$$ = NULL;
}
| FunctionCall
{
$$ = NULL;
}
| ObjConstExpr
{
JSFunctionTypeDescriptor ftd(QUuid::createUuid().toString());
for(int ii = 0;ii < tmp.size();++ii)
ftd.varmember[tmp[ii].name] = tmp[ii];
tmp.clear();
symb.globalFunType()[ftd.name] = ftd;
$$ = &symb.globalFunType()[ftd.name];
}
| ArrayExpr
{
$$ = NULL;
}
| T_NULL
{
$$ = NULL;
}
| T_STRING_LITERAL
{
$$ = NULL;
}
| T_NUMERIC_LITERAL
{
$$ = NULL;
}
;
OptIdTok:
{
$$ = NULL;
}
| IdTok
;
MemberExpr: IdTok
| MemberExpr T_DOT IdTok
;
ThisExpr: ThisTok T_DOT MemberExpr;
ThisTok: T_THIS;
IdTok: T_IDENTIFIER;
NewTok: T_NEW;
NewExpr: NewTok IdTok OpenBracket OptArgumentList CloseBracket
{
$$ = symb.getFunctionType(*$2);
};
FunctionExpr: StartOptFun StatementList CloseBlock
{
}
;
FunctionCall: MemberExpr OpenBracket OptExpressionList CloseBracket
| ThisExpr OpenBracket OptExpressionList CloseBracket
;
OptExpressionList:
Expression OtherOptExpressionList
;
OtherOptExpressionList:
| OtherOptExpressionList T_COMMA Expression
;
OptArgumentList:
| IdTok OtherOptArgumentList
;
OtherOptArgumentList:
| OtherOptArgumentList T_COMMA IdTok
;
ObjConstExpr: OpenBlock CloseBlock
| OpenBlock IdTok T_COLON Expression OtherOptFields CloseBlock
{
JSVarDescriptor vd(*$2,$4);
tmp.push_back(vd);
}
;
OtherOptFields:
| OtherOptFields T_COMMA IdTok T_COLON Expression
{
JSVarDescriptor vd(*$3,$5);
tmp.push_back(vd);
}
;
ArrayExpr: OpenArrBracket Expression OtherOptExpressionList CloseArrBracket;
OpenBracket: T_LPAREN;
CloseBracket: T_RPAREN;
OpenArrBracket: T_LBRACE;
CloseArrBracket: T_RBRACE;
%%
namespace yy
{
void JSCacheParser::error(location const& loc, const std::string& s)
{
//std::cerr << "error at " << loc << ": " << s << "\n";
}
}

View File

@ -1,164 +0,0 @@
/* A Bison parser, made by GNU Bison 2.5. */
/* Locations for Bison parsers in C++
Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/**
** \file location.hh
** Define the yy::location class.
*/
#ifndef BISON_LOCATION_HH
# define BISON_LOCATION_HH
# include <iostream>
# include <string>
# include "position.hh"
namespace yy {
/* Line 162 of location.cc */
#line 50 "location.hh"
/// Abstract a location.
class location
{
public:
/// Construct a location.
location ()
: begin (), end ()
{
}
/// Initialization.
inline void initialize (std::string* fn)
{
begin.initialize (fn);
end = begin;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// Reset initial location to final location.
inline void step ()
{
begin = end;
}
/// Extend the current location to the COUNT next columns.
inline void columns (unsigned int count = 1)
{
end += count;
}
/// Extend the current location to the COUNT next lines.
inline void lines (unsigned int count = 1)
{
end.lines (count);
}
/** \} */
public:
/// Beginning of the located region.
position begin;
/// End of the located region.
position end;
};
/// Join two location objects to create a location.
inline const location operator+ (const location& begin, const location& end)
{
location res = begin;
res.end = end.end;
return res;
}
/// Add two location objects.
inline const location operator+ (const location& begin, unsigned int width)
{
location res = begin;
res.columns (width);
return res;
}
/// Add and assign a location.
inline location& operator+= (location& res, unsigned int width)
{
res.columns (width);
return res;
}
/// Compare two location objects.
inline bool
operator== (const location& loc1, const location& loc2)
{
return loc1.begin == loc2.begin && loc1.end == loc2.end;
}
/// Compare two location objects.
inline bool
operator!= (const location& loc1, const location& loc2)
{
return !(loc1 == loc2);
}
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param loc a reference to the location to redirect
**
** Avoid duplicate information.
*/
inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
{
position last = loc.end - 1;
ostr << loc.begin;
if (last.filename
&& (!loc.begin.filename
|| *loc.begin.filename != *last.filename))
ostr << '-' << last;
else if (loc.begin.line != last.line)
ostr << '-' << last.line << '.' << last.column;
else if (loc.begin.column != last.column)
ostr << '-' << last.column;
return ostr;
}
} // yy
/* Line 271 of location.cc */
#line 163 "location.hh"
#endif // not BISON_LOCATION_HH

View File

@ -1,161 +0,0 @@
/* A Bison parser, made by GNU Bison 2.5. */
/* Positions for Bison parsers in C++
Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/**
** \file position.hh
** Define the yy::position class.
*/
#ifndef BISON_POSITION_HH
# define BISON_POSITION_HH
# include <iostream>
# include <string>
# include <algorithm>
namespace yy {
/* Line 37 of location.cc */
#line 50 "position.hh"
/// Abstract a position.
class position
{
public:
/// Construct a position.
position ()
: filename (0), line (1), column (1)
{
}
/// Initialization.
inline void initialize (std::string* fn)
{
filename = fn;
line = 1;
column = 1;
}
/** \name Line and Column related manipulators
** \{ */
public:
/// (line related) Advance to the COUNT next lines.
inline void lines (int count = 1)
{
column = 1;
line += count;
}
/// (column related) Advance to the COUNT next columns.
inline void columns (int count = 1)
{
column = std::max (1u, column + count);
}
/** \} */
public:
/// File name to which this position refers.
std::string* filename;
/// Current line number.
unsigned int line;
/// Current column number.
unsigned int column;
};
/// Add and assign a position.
inline const position&
operator+= (position& res, const int width)
{
res.columns (width);
return res;
}
/// Add two position objects.
inline const position
operator+ (const position& begin, const int width)
{
position res = begin;
return res += width;
}
/// Add and assign a position.
inline const position&
operator-= (position& res, const int width)
{
return res += -width;
}
/// Add two position objects.
inline const position
operator- (const position& begin, const int width)
{
return begin + -width;
}
/// Compare two position objects.
inline bool
operator== (const position& pos1, const position& pos2)
{
return (pos1.line == pos2.line
&& pos1.column == pos2.column
&& (pos1.filename == pos2.filename
|| (pos1.filename && pos2.filename
&& *pos1.filename == *pos2.filename)));
}
/// Compare two position objects.
inline bool
operator!= (const position& pos1, const position& pos2)
{
return !(pos1 == pos2);
}
/** \brief Intercept output stream redirection.
** \param ostr the destination output stream
** \param pos a reference to the position to redirect
*/
inline std::ostream&
operator<< (std::ostream& ostr, const position& pos)
{
if (pos.filename)
ostr << *pos.filename << ':';
return ostr << pos.line << '.' << pos.column;
}
} // yy
/* Line 144 of location.cc */
#line 161 "position.hh"
#endif // not BISON_POSITION_HH

View File

@ -1,135 +0,0 @@
/* A Bison parser, made by GNU Bison 2.5. */
/* Stack handling for Bison parsers in C++
Copyright (C) 2002-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef BISON_STACK_HH
# define BISON_STACK_HH
#include <deque>
namespace yy {
/* Line 1149 of lalr1.cc */
#line 43 "stack.hh"
template <class T, class S = std::deque<T> >
class stack
{
public:
// Hide our reversed order.
typedef typename S::reverse_iterator iterator;
typedef typename S::const_reverse_iterator const_iterator;
stack () : seq_ ()
{
}
stack (unsigned int n) : seq_ (n)
{
}
inline
T&
operator [] (unsigned int i)
{
return seq_[i];
}
inline
const T&
operator [] (unsigned int i) const
{
return seq_[i];
}
inline
void
push (const T& t)
{
seq_.push_front (t);
}
inline
void
pop (unsigned int n = 1)
{
for (; n; --n)
seq_.pop_front ();
}
inline
unsigned int
height () const
{
return seq_.size ();
}
inline const_iterator begin () const { return seq_.rbegin (); }
inline const_iterator end () const { return seq_.rend (); }
private:
S seq_;
};
/// Present a slice of the top of a stack.
template <class T, class S = stack<T> >
class slice
{
public:
slice (const S& stack,
unsigned int range) : stack_ (stack),
range_ (range)
{
}
inline
const T&
operator [] (unsigned int i) const
{
return stack_[range_ - i];
}
private:
const S& stack_;
unsigned int range_;
};
} // yy
/* Line 1235 of lalr1.cc */
#line 133 "stack.hh"
#endif // not BISON_STACK_HH[]dnl

View File

@ -1,366 +0,0 @@
# Copyright 2019 Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
# GLEW - required
set(GLEW_DIR ${EXTERNAL_DIR}/glew-2.1.0)
if(ALLOW_SYSTEM_GLEW AND TARGET GLEW::GLEW)
message(STATUS "- glew - using system-provided library")
add_library(external-glew INTERFACE)
target_link_libraries(external-glew INTERFACE GLEW::GLEW)
if(TARGET OpenGL::OpenGL)
target_link_libraries(external-glew INTERFACE OpenGL::OpenGL)
elseif(TARGET OpenGL::GL)
target_link_libraries(external-glew INTERFACE OpenGL::GL)
else()
message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
endif()
elseif(ALLOW_BUNDLED_GLEW AND EXISTS "${GLEW_DIR}/src/glew.c")
message(STATUS "- glew - using bundled source")
add_library(external-glew STATIC "${GLEW_DIR}/src/glew.c")
target_compile_definitions(external-glew PUBLIC GLEW_STATIC)
target_include_directories(external-glew SYSTEM PUBLIC ${GLEW_DIR}/include)
if(TARGET OpenGL::OpenGL)
target_link_libraries(external-glew PUBLIC OpenGL::OpenGL)
elseif(TARGET OpenGL::GL)
target_link_libraries(external-glew PUBLIC OpenGL::GL)
else()
message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
endif()
if(TARGET OpenGL::GLX)
target_link_libraries(external-glew PUBLIC OpenGL::GLX)
endif()
set_property(TARGET external-glew PROPERTY FOLDER External)
else()
message(
FATAL_ERROR
"GLEW is required - at least one of ALLOW_SYSTEM_GLEW or ALLOW_BUNDLED_GLEW must be enabled and found.")
endif()
# Eigen3 - required
set(EIGEN_DIR ${VCGDIR}/eigenlib)
if(ALLOW_SYSTEM_EIGEN AND EIGEN3_INCLUDE_DIR)
message(STATUS "- Eigen - using system-provided library")
set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
elseif(ALLOW_BUNDLED_EIGEN AND EXISTS "${EIGEN_DIR}/Eigen/Eigen")
message(STATUS "- Eigen - using bundled source")
set(EIGEN_INCLUDE_DIRS ${EIGEN_DIR})
else()
message(
FATAL_ERROR
"Eigen is required - at least one of ALLOW_SYSTEM_EIGEN or ALLOW_BUNDLED_EIGEN must be enabled and found.")
endif()
# newuoa - optional and header-only, for several plugins including all that use levmar
set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa)
if(ALLOW_BUNDLED_NEWUOA AND EXISTS "${NEWUOA_DIR}/include/newuoa.h")
message(STATUS "- newuoa - using bundled source")
add_library(external-newuoa INTERFACE)
target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include)
endif()
# levmar - optional, for several plugins
set(LEVMAR_DIR ${EXTERNAL_DIR}/levmar-2.3)
if(ALLOW_BUNDLED_LEVMAR AND EXISTS "${LEVMAR_DIR}/lm.h")
message(STATUS "- levmar - using bundled source")
add_library(
external-levmar STATIC
"${LEVMAR_DIR}/compiler.h"
"${LEVMAR_DIR}/lm.h"
"${LEVMAR_DIR}/misc.h"
"${LEVMAR_DIR}/Axb.c"
"${LEVMAR_DIR}/lm.c"
"${LEVMAR_DIR}/lmbc.c"
"${LEVMAR_DIR}/lmblec.c"
"${LEVMAR_DIR}/lmlec.c"
"${LEVMAR_DIR}/misc.c")
target_include_directories(external-levmar PUBLIC ${LEVMAR_DIR})
set_property(TARGET external-levmar PROPERTY FOLDER External)
endif()
# lib3ds - optional, for io_3ds
set(LIB3DS_DIR ${EXTERNAL_DIR}/lib3ds-1.3.0)
if(ALLOW_SYSTEM_LIB3DS AND TARGET Lib3ds::Lib3ds)
message(STATUS "- lib3ds - using system-provided library")
add_library(external-lib3ds INTERFACE)
target_link_libraries(external-lib3ds INTERFACE Lib3ds::Lib3ds)
elseif(ALLOW_BUNDLED_LIB3DS AND EXISTS "${LIB3DS_DIR}/lib3ds/types.h")
message(STATUS "- lib3ds - using bundled source")
add_library(
external-lib3ds STATIC
"${LIB3DS_DIR}/lib3ds/atmosphere.c"
"${LIB3DS_DIR}/lib3ds/atmosphere.h"
"${LIB3DS_DIR}/lib3ds/background.c"
"${LIB3DS_DIR}/lib3ds/background.h"
"${LIB3DS_DIR}/lib3ds/camera.c"
"${LIB3DS_DIR}/lib3ds/camera.h"
"${LIB3DS_DIR}/lib3ds/chunk.c"
"${LIB3DS_DIR}/lib3ds/chunk.h"
"${LIB3DS_DIR}/lib3ds/chunktable.h"
"${LIB3DS_DIR}/lib3ds/ease.c"
"${LIB3DS_DIR}/lib3ds/ease.h"
"${LIB3DS_DIR}/lib3ds/file.c"
"${LIB3DS_DIR}/lib3ds/file.h"
"${LIB3DS_DIR}/lib3ds/io.c"
"${LIB3DS_DIR}/lib3ds/io.h"
"${LIB3DS_DIR}/lib3ds/light.c"
"${LIB3DS_DIR}/lib3ds/light.h"
"${LIB3DS_DIR}/lib3ds/material.c"
"${LIB3DS_DIR}/lib3ds/material.h"
"${LIB3DS_DIR}/lib3ds/matrix.c"
"${LIB3DS_DIR}/lib3ds/matrix.h"
"${LIB3DS_DIR}/lib3ds/mesh.c"
"${LIB3DS_DIR}/lib3ds/mesh.h"
"${LIB3DS_DIR}/lib3ds/node.c"
"${LIB3DS_DIR}/lib3ds/node.h"
"${LIB3DS_DIR}/lib3ds/quat.c"
"${LIB3DS_DIR}/lib3ds/quat.h"
"${LIB3DS_DIR}/lib3ds/shadow.c"
"${LIB3DS_DIR}/lib3ds/shadow.h"
"${LIB3DS_DIR}/lib3ds/tcb.c"
"${LIB3DS_DIR}/lib3ds/tcb.h"
"${LIB3DS_DIR}/lib3ds/tracks.c"
"${LIB3DS_DIR}/lib3ds/tracks.h"
"${LIB3DS_DIR}/lib3ds/types.h"
"${LIB3DS_DIR}/lib3ds/vector.c"
"${LIB3DS_DIR}/lib3ds/vector.h"
"${LIB3DS_DIR}/lib3ds/viewport.c"
"${LIB3DS_DIR}/lib3ds/viewport.h")
target_include_directories(external-lib3ds SYSTEM PUBLIC "${LIB3DS_DIR}")
target_compile_definitions(external-lib3ds PUBLIC LIB3DS_STATIC)
set_property(TARGET external-lib3ds PROPERTY FOLDER External)
endif()
# gmp or mpir - optional, for filter_csg
if(ALLOW_SYSTEM_GMP AND GMP_FOUND)
message(STATUS "- GMP/MPIR - using system-provided GMP library")
add_library(external-gmp INTERFACE)
target_include_directories(external-gmp SYSTEM INTERFACE ${GMP_INCLUDE_DIRS})
target_link_libraries(external-gmp INTERFACE ${GMP_LIBRARIES})
else()
# TODO set up external-mpir per-os for bundled mpir
endif()
# muparser - optional, for filter_func
set(MUPARSER_DIR ${EXTERNAL_DIR}/muparser_v225)
if(ALLOW_SYSTEM_MUPARSER AND TARGET muparser::muparser)
message(STATUS "- muparser - using system-provided library")
add_library(external-muparser INTERFACE)
target_link_libraries(external-muparser INTERFACE muparser::muparser)
elseif(ALLOW_BUNDLED_MUPARSER AND EXISTS "${MUPARSER_DIR}/src/muParser.cpp")
message(STATUS "- muparser - using bundled source")
add_library(
external-muparser STATIC
"${MUPARSER_DIR}/src/muParser.cpp"
"${MUPARSER_DIR}/src/muParserBase.cpp"
"${MUPARSER_DIR}/src/muParserBytecode.cpp"
"${MUPARSER_DIR}/src/muParserCallback.cpp"
"${MUPARSER_DIR}/src/muParserDLL.cpp"
"${MUPARSER_DIR}/src/muParserError.cpp"
"${MUPARSER_DIR}/src/muParserInt.cpp"
"${MUPARSER_DIR}/src/muParserTest.cpp"
"${MUPARSER_DIR}/src/muParserTokenReader.cpp")
target_include_directories(external-muparser SYSTEM PUBLIC ${MUPARSER_DIR}/include)
target_compile_definitions(external-muparser PUBLIC _UNICODE)
set_property(TARGET external-muparser PROPERTY FOLDER External)
endif()
# OpenCTM - optional, for io_ctm
set(OPENCTM_DIR ${EXTERNAL_DIR}/OpenCTM-1.0.3)
if(ALLOW_SYSTEM_OPENCTM AND TARGET OpenCTM::OpenCTM)
message(STATUS "- OpenCTM - using system-provided library")
add_library(external-openctm INTERFACE)
target_link_libraries(external-openctm INTERFACE OpenCTM::OpenCTM)
elseif(ALLOW_BUNDLED_OPENCTM AND EXISTS "${OPENCTM_DIR}/lib/openctm.c")
message(STATUS "- OpenCTM - using bundled source")
# Modified liblzma included - can't build against system version
add_library(
external-openctm STATIC
"${OPENCTM_DIR}/lib/openctm.c"
"${OPENCTM_DIR}/lib/stream.c"
"${OPENCTM_DIR}/lib/compressRAW.c"
"${OPENCTM_DIR}/lib/compressMG1.c"
"${OPENCTM_DIR}/lib/compressMG2.c"
"${OPENCTM_DIR}/lib/liblzma/Alloc.c"
"${OPENCTM_DIR}/lib/liblzma/LzFind.c"
"${OPENCTM_DIR}/lib/liblzma/LzmaDec.c"
"${OPENCTM_DIR}/lib/liblzma/LzmaEnc.c"
"${OPENCTM_DIR}/lib/liblzma/LzmaLib.c")
target_compile_definitions(external-openctm PUBLIC OPENCTM_STATIC)
target_include_directories(
external-openctm SYSTEM
PUBLIC "${OPENCTM_DIR}/lib" SYSTEM
PRIVATE "${OPENCTM_DIR}/lib/liblzma")
if(MSVC)
target_compile_definitions(external-openctm PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
set_property(TARGET external-openctm PROPERTY FOLDER External)
endif()
# structure-synth - optional, for filter_ssynth
set(SSYNTH_DIR ${EXTERNAL_DIR}/structuresynth-1.5)
if(ALLOW_BUNDLED_SSYNTH AND EXISTS "${LEVMAR_DIR}/lm.h")
message(STATUS "- structure-synth - using bundled source")
# Can't use a system version because using StructureSynth as a library is not common
add_library(
external-ssynth STATIC
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Action.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/AmbiguousRule.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Builder.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/ColorPool.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/CustomRule.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/ExecutionStack.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveClass.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveRule.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/RandomStreams.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rule.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleRef.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleSet.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/State.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Transformation.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/TransformationLoop.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Parser/EisenParser.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Preprocessor.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Tokenizer.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Exceptions/Exception.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Box.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Dot.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Grid.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Line.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Mesh.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Object3D.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/AtomicCounter.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RenderThread.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/Sampler.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/RaytraceTriangle.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Triangle.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/ListWidgetLogger.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/Logging.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Matrix4.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Random.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Vector3.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/ColorUtils.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/MiniParser.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Persistence.h"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Version.h"
"${SSYNTH_DIR}/ssynth/ThirdPartyCode/MersenneTwister/MersenneTwister.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/Renderer.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/TemplateRenderer.h"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Action.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/AmbiguousRule.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Builder.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/ColorPool.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/CustomRule.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/ExecutionStack.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveClass.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/PrimitiveRule.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/RandomStreams.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rule.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleRef.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/RuleSet.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/State.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Transformation.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/TransformationLoop.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Parser/EisenParser.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Preprocessor.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Parser/Tokenizer.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Box.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Dot.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Grid.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Line.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Mesh.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Object3D.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/AtomicCounter.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RenderThread.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/Sampler.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/VoxelStepper.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/RaytraceTriangle.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Triangle.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/ListWidgetLogger.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Logging/Logging.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Matrix4.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Random.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Math/Vector3.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/ColorUtils.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/MiniParser.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Persistence.cpp"
"${SSYNTH_DIR}/ssynth/SyntopiaCore/Misc/Version.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/Renderer.cpp"
"${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/TemplateRenderer.cpp")
# These sources were disabled in the .pro file: "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.cpp"
# "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp"
# "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.cpp"
# "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.cpp"
target_include_directories(external-ssynth SYSTEM PUBLIC "${SSYNTH_DIR}/ssynth")
target_link_libraries(external-ssynth PRIVATE Qt5::Core Qt5::Xml Qt5::OpenGL OpenGL::GLU)
set_property(TARGET external-ssynth PROPERTY FOLDER External)
endif()
# qhull - optional, for filter_qhull
set(QHULL_DIR ${EXTERNAL_DIR}/qhull-2003.1)
if(ALLOW_SYSTEM_QHULL AND TARGET Qhull::libqhull)
message(STATUS "- qhull - using system-provided library")
add_library(external-qhull INTERFACE)
target_link_libraries(external-qhull INTERFACE Qhull::libqhull)
target_compile_definitions(external-qhull INTERFACE SYSTEM_QHULL)
target_include_directories(external-qhull INTERFACE ${QHULL_libqhull_INCLUDE_DIR}/libqhull)
elseif(ALLOW_BUNDLED_QHULL AND EXISTS "${QHULL_DIR}/src/qhull.h")
message(STATUS "- qhull - using bundled source")
add_library(
external-qhull STATIC
"${QHULL_DIR}/src/geom2.c"
"${QHULL_DIR}/src/global.c"
"${QHULL_DIR}/src/io.c"
"${QHULL_DIR}/src/io.h"
"${QHULL_DIR}/src/mem.c"
"${QHULL_DIR}/src/mem.h"
"${QHULL_DIR}/src/merge.c"
"${QHULL_DIR}/src/merge.h"
"${QHULL_DIR}/src/poly.c"
"${QHULL_DIR}/src/poly.h"
"${QHULL_DIR}/src/poly2.c"
"${QHULL_DIR}/src/qconvex.c"
"${QHULL_DIR}/src/qhull.c"
"${QHULL_DIR}/src/qhull.h"
"${QHULL_DIR}/src/qset.c"
"${QHULL_DIR}/src/qset.h"
"${QHULL_DIR}/src/stat.c"
"${QHULL_DIR}/src/stat.h"
"${QHULL_DIR}/src/geom.c"
"${QHULL_DIR}/src/geom.h"
"${QHULL_DIR}/src/user.c"
"${QHULL_DIR}/src/user.h")
target_include_directories(external-qhull INTERFACE "${QHULL_DIR}/src")
set_property(TARGET external-qhull PROPERTY FOLDER External)
endif()
# u3d - optional, for io_u3d
set(U3D_DIR ${EXTERNAL_DIR}/u3d)
if(ALLOW_BUNDLED_U3D)
message(STATUS "- u3d - using bundled source")
include("${U3D_DIR}/src/u3d.cmake")
set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
# These sources were disabled in the .pro file: "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/EngineWidget.cpp"
# "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp"
# "${SSYNTH_DIR}/ssynth/SyntopiaCore/GLEngine/Sphere.cpp"
# "${SSYNTH_DIR}/ssynth/StructureSynth/Model/Rendering/OpenGLRenderer.cpp"
#target_include_directories(external-IDTFConverter SYSTEM PUBLIC "${U3D_DIR}/IDTF")
#set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
endif()
# opengr - optional and header-only, for filter_globalregistration
set(OPENGR_DIR ${EXTERNAL_DIR}/OpenGR)
if(ALLOW_BUNDLED_OPENGR AND EXISTS "${OPENGR_DIR}/src/gr/algorithms/match4pcsBase.h")
message(STATUS "- OpenGR - using bundled source")
add_library(external-opengr INTERFACE)
target_include_directories(external-opengr INTERFACE ${OPENGR_DIR}/src/)
endif()

View File

@ -0,0 +1,29 @@
if(TARGET OpenCTM::OpenCTM)
message(STATUS "- OpenCTM - using system-provided library")
add_library(external-openctm INTERFACE)
target_link_libraries(external-openctm INTERFACE OpenCTM::OpenCTM)
else()
message(STATUS "- OpenCTM - using bundled source")
# Modified liblzma included - can't build against system version
add_library(
external-openctm STATIC
"${OPENCTM_DIR}/lib/openctm.c"
"${OPENCTM_DIR}/lib/stream.c"
"${OPENCTM_DIR}/lib/compressRAW.c"
"${OPENCTM_DIR}/lib/compressMG1.c"
"${OPENCTM_DIR}/lib/compressMG2.c"
"${OPENCTM_DIR}/lib/liblzma/Alloc.c"
"${OPENCTM_DIR}/lib/liblzma/LzFind.c"
"${OPENCTM_DIR}/lib/liblzma/LzmaDec.c"
"${OPENCTM_DIR}/lib/liblzma/LzmaEnc.c"
"${OPENCTM_DIR}/lib/liblzma/LzmaLib.c")
target_compile_definitions(external-openctm PUBLIC OPENCTM_STATIC)
target_include_directories(
external-openctm SYSTEM
PUBLIC "${OPENCTM_DIR}/lib" SYSTEM
PRIVATE "${OPENCTM_DIR}/lib/liblzma")
if(MSVC)
target_compile_definitions(external-openctm PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
set_property(TARGET external-openctm PROPERTY FOLDER External)
endif()

68
src/external/external.cmake vendored Normal file
View File

@ -0,0 +1,68 @@
# Copyright 2019 Collabora, Ltd.
# SPDX-License-Identifier: BSL-1.0
# GLEW - required
set(GLEW_DIR ${EXTERNAL_DIR}/glew-2.1.0)
add_subdirectory(${GLEW_DIR})
# Eigen3 - required
set(EIGEN_DIR ${VCGDIR}/eigenlib)
if(EIGEN3_INCLUDE_DIR)
message(STATUS "- Eigen - using system-provided library")
set(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
else()
message(STATUS "- Eigen - using bundled source")
set(EIGEN_INCLUDE_DIRS ${EIGEN_DIR})
endif()
# newuoa - optional and header-only, for several plugins including all that use levmar
set(NEWUOA_DIR ${VCGDIR}/wrap/newuoa)
message(STATUS "- newuoa - using bundled source")
add_library(external-newuoa INTERFACE)
target_include_directories(external-newuoa INTERFACE ${NEWUOA_DIR}/include)
# levmar - optional, for several plugins
set(LEVMAR_DIR ${EXTERNAL_DIR}/levmar-2.3)
add_subdirectory(${LEVMAR_DIR})
# lib3ds - optional, for io_3ds
set(LIB3DS_DIR ${EXTERNAL_DIR}/lib3ds-1.3.0)
add_subdirectory(${LIB3DS_DIR})
# gmp or mpir - optional, for filter_csg
if(GMP_FOUND)
message(STATUS "- GMP/MPIR - using system-provided GMP library")
add_library(external-gmp INTERFACE)
target_include_directories(external-gmp SYSTEM INTERFACE ${GMP_INCLUDE_DIRS})
target_link_libraries(external-gmp INTERFACE ${GMP_LIBRARIES})
else()
# TODO set up external-mpir per-os for bundled mpir
endif()
# muparser - optional, for filter_func
set(MUPARSER_DIR ${EXTERNAL_DIR}/muparser_v225)
add_subdirectory(${MUPARSER_DIR})
# OpenCTM - optional, for io_ctm
set(OPENCTM_DIR ${EXTERNAL_DIR}/OpenCTM-1.0.3)
add_subdirectory(${OPENCTM_DIR})
# structure-synth - optional, for filter_ssynth
set(SSYNTH_DIR ${EXTERNAL_DIR}/structuresynth-1.5)
add_subdirectory(${SSYNTH_DIR})
# qhull - optional, for filter_qhull
set(QHULL_DIR ${EXTERNAL_DIR}/qhull-2003.1)
add_subdirectory(${QHULL_DIR})
# u3d - optional, for io_u3d
set(U3D_DIR ${EXTERNAL_DIR}/u3d)
add_subdirectory(${U3D_DIR})
#set_property(TARGET external-IDTFConverter PROPERTY FOLDER External)
# opengr - optional and header-only, for filter_globalregistration
set(OPENGR_DIR ${EXTERNAL_DIR}/OpenGR)
message(STATUS "- OpenGR - using bundled source")
add_library(external-opengr INTERFACE)
target_include_directories(external-opengr INTERFACE ${OPENGR_DIR}/src/)

39
src/external/glew-2.1.0/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,39 @@
if (DEFINED GLEW_VERSION)
if((TARGET GLEW::GLEW) AND (${GLEW_VERSION} VERSION_GREATER_EQUAL "2.0.0"))
set(USE_BUNDLED_GLEW false)
else()
set(USE_BUNDLED_GLEW true)
endif()
else()
set(USE_BUNDLED_GLEW true)
endif()
if(${USE_BUNDLED_GLEW})
message(STATUS "- glew - using bundled source")
add_library(external-glew STATIC "${GLEW_DIR}/src/glew.c")
target_compile_definitions(external-glew PUBLIC GLEW_STATIC)
target_include_directories(external-glew SYSTEM PUBLIC ${GLEW_DIR}/include)
if(TARGET OpenGL::OpenGL)
target_link_libraries(external-glew PUBLIC OpenGL::OpenGL)
elseif(TARGET OpenGL::GL)
target_link_libraries(external-glew PUBLIC OpenGL::GL)
else()
message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
endif()
if(TARGET OpenGL::GLX)
target_link_libraries(external-glew PUBLIC OpenGL::GLX)
endif()
set_property(TARGET external-glew PROPERTY FOLDER External)
else()
message(STATUS "- glew - using system-provided library")
add_library(external-glew INTERFACE)
target_link_libraries(external-glew INTERFACE GLEW::GLEW)
if(TARGET OpenGL::OpenGL)
target_link_libraries(external-glew INTERFACE OpenGL::OpenGL)
elseif(TARGET OpenGL::GL)
target_link_libraries(external-glew INTERFACE OpenGL::GL)
else()
message(FATAL_ERROR "OpenGL not found or your CMake version is too old!")
endif()
endif()

View File

@ -1,52 +1,14 @@
# levmar CMake file; see http://www.cmake.org and
# http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial
PROJECT(LEVMAR)
#CMAKE_MINIMUM_REQUIRED(VERSION 1.4)
# compiler flags
ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls
#REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY)
# f2c is sometimes equivalent to libF77 & libI77; in that case, set HAVE_F2C to 0
SET(HAVE_F2C 1 CACHE BOOL "Do we have f2c or F77/I77?" )
# the directory where the lapack/blas/f2c libraries reside
SET(LAPACKBLAS_DIR /usr/lib CACHE PATH "Path to lapack/blas libraries")
# actual names for the lapack/blas/f2c libraries
SET(LAPACK_LIB lapack CACHE STRING "The name of the lapack library")
SET(BLAS_LIB blas CACHE STRING "The name of the blas library")
IF(HAVE_F2C)
SET(F2C_LIB f2c CACHE STRING "The name of the f2c library")
ELSE(HAVE_F2C)
SET(F77_LIB libF77 CACHE STRING "The name of the F77 library")
SET(I77_LIB libI77 CACHE STRING "The name of the I77 library")
ENDIF(HAVE_F2C)
########################## NO CHANGES BEYOND THIS POINT ##########################
#INCLUDE_DIRECTORIES(/usr/include)
LINK_DIRECTORIES(${LAPACKBLAS_DIR})
# levmar library source files
ADD_LIBRARY(levmar STATIC
lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c
lm.h misc.h compiler.h
)
# demo program
ADD_EXECUTABLE(lmdemo lmdemo.c lm.h)
# libraries the demo depends on
IF(HAVE_F2C)
TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F2C_LIB})
ELSE(HAVE_F2C)
TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F77_LIB} ${I77_LIB})
ENDIF(HAVE_F2C)
# make sure that the library is built before the demo
ADD_DEPENDENCIES(lmdemo levmar)
#SUBDIRS(matlab)
#ADD_TEST(levmar_tst lmdemo)
message(STATUS "- levmar - using bundled source")
add_library(
external-levmar STATIC
"${LEVMAR_DIR}/compiler.h"
"${LEVMAR_DIR}/lm.h"
"${LEVMAR_DIR}/misc.h"
"${LEVMAR_DIR}/Axb.c"
"${LEVMAR_DIR}/lm.c"
"${LEVMAR_DIR}/lmbc.c"
"${LEVMAR_DIR}/lmblec.c"
"${LEVMAR_DIR}/lmlec.c"
"${LEVMAR_DIR}/misc.c")
target_include_directories(external-levmar PUBLIC ${LEVMAR_DIR})
set_property(TARGET external-levmar PROPERTY FOLDER External)

View File

@ -0,0 +1,52 @@
# levmar CMake file; see http://www.cmake.org and
# http://www.insightsoftwareconsortium.org/wiki/index.php/CMake_Tutorial
PROJECT(LEVMAR)
#CMAKE_MINIMUM_REQUIRED(VERSION 1.4)
# compiler flags
ADD_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY) # do not free memory between linear solvers calls
#REMOVE_DEFINITIONS(-DLINSOLVERS_RETAIN_MEMORY)
# f2c is sometimes equivalent to libF77 & libI77; in that case, set HAVE_F2C to 0
SET(HAVE_F2C 1 CACHE BOOL "Do we have f2c or F77/I77?" )
# the directory where the lapack/blas/f2c libraries reside
SET(LAPACKBLAS_DIR /usr/lib CACHE PATH "Path to lapack/blas libraries")
# actual names for the lapack/blas/f2c libraries
SET(LAPACK_LIB lapack CACHE STRING "The name of the lapack library")
SET(BLAS_LIB blas CACHE STRING "The name of the blas library")
IF(HAVE_F2C)
SET(F2C_LIB f2c CACHE STRING "The name of the f2c library")
ELSE(HAVE_F2C)
SET(F77_LIB libF77 CACHE STRING "The name of the F77 library")
SET(I77_LIB libI77 CACHE STRING "The name of the I77 library")
ENDIF(HAVE_F2C)
########################## NO CHANGES BEYOND THIS POINT ##########################
#INCLUDE_DIRECTORIES(/usr/include)
LINK_DIRECTORIES(${LAPACKBLAS_DIR})
# levmar library source files
ADD_LIBRARY(levmar STATIC
lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c
lm.h misc.h compiler.h
)
# demo program
ADD_EXECUTABLE(lmdemo lmdemo.c lm.h)
# libraries the demo depends on
IF(HAVE_F2C)
TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F2C_LIB})
ELSE(HAVE_F2C)
TARGET_LINK_LIBRARIES(lmdemo levmar ${LAPACK_LIB} ${BLAS_LIB} ${F77_LIB} ${I77_LIB})
ENDIF(HAVE_F2C)
# make sure that the library is built before the demo
ADD_DEPENDENCIES(lmdemo levmar)
#SUBDIRS(matlab)
#ADD_TEST(levmar_tst lmdemo)

View File

@ -0,0 +1,50 @@
if(TARGET Lib3ds::Lib3ds)
message(STATUS "- lib3ds - using system-provided library")
add_library(external-lib3ds INTERFACE)
target_link_libraries(external-lib3ds INTERFACE Lib3ds::Lib3ds)
else()
message(STATUS "- lib3ds - using bundled source")
add_library(
external-lib3ds STATIC
"${LIB3DS_DIR}/lib3ds/atmosphere.c"
"${LIB3DS_DIR}/lib3ds/atmosphere.h"
"${LIB3DS_DIR}/lib3ds/background.c"
"${LIB3DS_DIR}/lib3ds/background.h"
"${LIB3DS_DIR}/lib3ds/camera.c"
"${LIB3DS_DIR}/lib3ds/camera.h"
"${LIB3DS_DIR}/lib3ds/chunk.c"
"${LIB3DS_DIR}/lib3ds/chunk.h"
"${LIB3DS_DIR}/lib3ds/chunktable.h"
"${LIB3DS_DIR}/lib3ds/ease.c"
"${LIB3DS_DIR}/lib3ds/ease.h"
"${LIB3DS_DIR}/lib3ds/file.c"
"${LIB3DS_DIR}/lib3ds/file.h"
"${LIB3DS_DIR}/lib3ds/io.c"
"${LIB3DS_DIR}/lib3ds/io.h"
"${LIB3DS_DIR}/lib3ds/light.c"
"${LIB3DS_DIR}/lib3ds/light.h"
"${LIB3DS_DIR}/lib3ds/material.c"
"${LIB3DS_DIR}/lib3ds/material.h"
"${LIB3DS_DIR}/lib3ds/matrix.c"
"${LIB3DS_DIR}/lib3ds/matrix.h"
"${LIB3DS_DIR}/lib3ds/mesh.c"
"${LIB3DS_DIR}/lib3ds/mesh.h"
"${LIB3DS_DIR}/lib3ds/node.c"
"${LIB3DS_DIR}/lib3ds/node.h"
"${LIB3DS_DIR}/lib3ds/quat.c"
"${LIB3DS_DIR}/lib3ds/quat.h"
"${LIB3DS_DIR}/lib3ds/shadow.c"
"${LIB3DS_DIR}/lib3ds/shadow.h"
"${LIB3DS_DIR}/lib3ds/tcb.c"
"${LIB3DS_DIR}/lib3ds/tcb.h"
"${LIB3DS_DIR}/lib3ds/tracks.c"
"${LIB3DS_DIR}/lib3ds/tracks.h"
"${LIB3DS_DIR}/lib3ds/types.h"
"${LIB3DS_DIR}/lib3ds/vector.c"
"${LIB3DS_DIR}/lib3ds/vector.h"
"${LIB3DS_DIR}/lib3ds/viewport.c"
"${LIB3DS_DIR}/lib3ds/viewport.h")
target_include_directories(external-lib3ds SYSTEM PUBLIC "${LIB3DS_DIR}")
target_compile_definitions(external-lib3ds PUBLIC LIB3DS_STATIC)
set_property(TARGET external-lib3ds PROPERTY FOLDER External)
endif()

View File

@ -0,0 +1,21 @@
if(TARGET muparser::muparser)
message(STATUS "- muparser - using system-provided library")
add_library(external-muparser INTERFACE)
target_link_libraries(external-muparser INTERFACE muparser::muparser)
else()
message(STATUS "- muparser - using bundled source")
add_library(
external-muparser STATIC
"${MUPARSER_DIR}/src/muParser.cpp"
"${MUPARSER_DIR}/src/muParserBase.cpp"
"${MUPARSER_DIR}/src/muParserBytecode.cpp"
"${MUPARSER_DIR}/src/muParserCallback.cpp"
"${MUPARSER_DIR}/src/muParserDLL.cpp"
"${MUPARSER_DIR}/src/muParserError.cpp"
"${MUPARSER_DIR}/src/muParserInt.cpp"
"${MUPARSER_DIR}/src/muParserTest.cpp"
"${MUPARSER_DIR}/src/muParserTokenReader.cpp")
target_include_directories(external-muparser SYSTEM PUBLIC ${MUPARSER_DIR}/include)
target_compile_definitions(external-muparser PUBLIC _UNICODE)
set_property(TARGET external-muparser PROPERTY FOLDER External)
endif()

View File

@ -0,0 +1,35 @@
if(TARGET Qhull::libqhull)
message(STATUS "- qhull - using system-provided library")
add_library(external-qhull INTERFACE)
target_link_libraries(external-qhull INTERFACE Qhull::libqhull)
target_compile_definitions(external-qhull INTERFACE SYSTEM_QHULL)
target_include_directories(external-qhull INTERFACE ${QHULL_libqhull_INCLUDE_DIR}/libqhull)
else()
message(STATUS "- qhull - using bundled source")
add_library(
external-qhull STATIC
"${QHULL_DIR}/src/geom2.c"
"${QHULL_DIR}/src/global.c"
"${QHULL_DIR}/src/io.c"
"${QHULL_DIR}/src/io.h"
"${QHULL_DIR}/src/mem.c"
"${QHULL_DIR}/src/mem.h"
"${QHULL_DIR}/src/merge.c"
"${QHULL_DIR}/src/merge.h"
"${QHULL_DIR}/src/poly.c"
"${QHULL_DIR}/src/poly.h"
"${QHULL_DIR}/src/poly2.c"
"${QHULL_DIR}/src/qconvex.c"
"${QHULL_DIR}/src/qhull.c"
"${QHULL_DIR}/src/qhull.h"
"${QHULL_DIR}/src/qset.c"
"${QHULL_DIR}/src/qset.h"
"${QHULL_DIR}/src/stat.c"
"${QHULL_DIR}/src/stat.h"
"${QHULL_DIR}/src/geom.c"
"${QHULL_DIR}/src/geom.h"
"${QHULL_DIR}/src/user.c"
"${QHULL_DIR}/src/user.h")
target_include_directories(external-qhull INTERFACE "${QHULL_DIR}/src")
set_property(TARGET external-qhull PROPERTY FOLDER External)
endif()

Some files were not shown because too many files have changed in this diff Show More