# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           active_variants 1.1
PortGroup           boost 1.0

github.setup        PointCloudLibrary pcl 1.14.1 pcl-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
checksums           rmd160  45cd999a80c4683aa63ea18868ee45659a589ff4 \
                    sha256  5d75196280646064e24937dd4da3b994066d2e5e87649e9148526d6c4e816101 \
                    size    68672454

name                libpcl
categories          gis graphics science
platforms           darwin
license             BSD
maintainers         {vince @Veence}
description         Point Cloud Library
long_description    The Point Cloud Library (PCL) is a standalone, large scale, open project \
                    for 2D/3D image and point cloud processing.

homepage            http://pointclouds.org

depends_lib         path:share/pkgconfig/eigen3.pc:eigen3 \
                    port:flann \
                    port:libpng \
                    port:qhull \
                    port:zlib


depends_test        port:gtest

cmake.build_type    Release

boost.version       1.81

configure.args-append -DBUILD_apps=ON \
                      -DBUILD_examples=ON \
                      -DWITH_DOCS=OFF \
                      -DWITH_VTK=OFF

variant openmp description {Enable OpenMP for speed} {
    # TODO: verify OpenMP version required
    compiler.openmp_version 3.1
}

variant viz description {Adds the visualisation module} {
    configure.args-replace  -DWITH_VTK=OFF -DWITH_VTK=ON
    depends_lib-append      port:vtk \
                            port:glew
}


variant test description {Configure to run unit tests} {
    configure.args-replace -DBUILD_apps=ON -DBUILD_apps=OFF
    configure.args-replace -DBUILD_examples=ON -DBUILD_examples=OFF
    configure.args-append  -DBUILD_global_tests=ON \
                           -DGTEST_SRC_DIR=${prefix}/src/googletest/
}

default_variants +openmp

# Test phase completes to the test summary (93 of 104 passed) but then aborts with
# "Failed to test libpcl: command execution failed"
# Needs further work
test.run            yes
test.target         tests
