# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 67563 2010-05-13 03:04:47Z ecronin@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                qfsm
version             0.52.0
categories          science
maintainers         ecronin openmaintainer
description         A graphical tool for designing finite state machines
long_description    Qfsm is a graphical editor for finite state machines \
                    written in C++ using Qt the graphical Toolkit from Trolltech

platforms           darwin
homepage            http://qfsm.sourceforge.net
master_sites        sourceforge
distname            ${name}-${version}-Source
use_bzip2           yes

checksums           md5     62590fe7dfd7d77c80b03695860a2434 \
                    sha1    6820603155270d0abdc5a302a647e9588f92a2dc \
                    rmd160  c60d6b49e1eaaffdf258f468e7e897479524baff

depends_lib-append  path:bin/qmake-mac:qt4-mac

set qmake_path      ${prefix}/bin/qmake

post-patch {
    reinplace "s|SET(CMAKE_INSTALL_PREFIX \"/usr\")|SET(CMAKE_INSTALL_PREFIX \"${prefix}\")|g" ${worksrcpath}/CMakeLists.txt
}

configure.args  \
        -DQT_LIBRARY_DIR=${frameworks_dir} \
        -DQT_QMAKE_EXECUTABLE=${qmake_path}-mac

variant x11 description {build with qt4-x11} {
    depends_lib-delete path:bin/qmake-mac:qt4-mac
    configure.args-delete -DQT_QMAKE_EXECUTABLE=${qmake_path}-mac
    
    depends_lib-append port:qt4-x11
    configure.args-append -DQT_QMAKE_EXECUTABLE=${qmake_path}-x11
}
