# -*- 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
# $Id: Portfile 92571 2012-05-01 16:56:16Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                gmsh
conflicts           gmsh-devel
version             2.5.0
categories          science
platforms           darwin
maintainers         ujf-grenoble.fr:Christophe.Prudhomme
description         Finite element mesh generator in 1D, 2D and 3D
long_description    \
        Gmsh is an automatic 3D finite element mesh generator (primarily   \
        Delaunay) with build-in CAD and post-processing facilities. Its     \
        design goal is to provide a simple meshing tool for academic test   \
        cases with parametric input and up to date visualization            \
        capabilities.

homepage            http://www.geuz.org/gmsh/
master_sites        http://www.geuz.org/gmsh/src/
distname            gmsh-${version}-source
extract.suffix      .tgz

checksums           \
                          sha1    b541fd9f1aadf1df7bf6fdd97a68ca41966ffeb6 \
                          rmd160  49ab2054d546e4549250119cec0453cd1cdfffef

patchfiles          patch-cmakelists.diff

# https://trac.macports.org/ticket/33925
if {${configure.compiler} == "clang"} {
    configure.compiler llvm-gcc-4.2
}

configure.args-append \
    -DENABLE_NATIVE_FILE_CHOOSER:BOOL=OFF\
    -DENABLE_OCC:BOOL=OFF \
    -DENABLE_FLTK:BOOL=ON\
    -DENABLE_GRAPHICS:BOOL=ON

post-build {
    # lib and shared targets are not handled by default target
    system "cd ${worksrcpath} && make lib shared"
}

depends_lib  \
    port:mesa \
    port:libpng \
    port:fltk-devel\
    port:jpeg \
    port:zlib \
    port:texinfo
