# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 66583 2010-04-17 12:15:12Z css@macports.org $

PortSystem 1.0
PortGroup	muniversal 1.0

name		cmake
version		2.8.1
revision	2
categories	devel
maintainers	css
description	Cross-platform make
long_description	\
	An extensible, open-source system that manages the build 	\
	process in an operating system and compiler independent manner. \
	Unlike many cross-platform systems, CMake is designed to be 	\
	used in conjunction with the native build environment.
homepage	http://www.cmake.org/
platforms	darwin freebsd
master_sites	http://www.cmake.org/files/v2.8/
# Remove the dist_subdir line when updating to the next version of cmake
dist_subdir ${name}/${version}_1
checksums           md5     feadc2e5ebbfed0efc90178583503725 \
                    sha1    e9f99cfccf8ec4fb5bbd8ca7d499771a2f1d4ebe \
                    rmd160  71e216704ee4313640efdbefcc65c6576071ef82

depends_build	port:libidn \
		port:openssl

configure.args	--mandir=/share/man --docdir=/share/doc/cmake --parallel=${build.jobs}
patchfiles	patch-CMakeFindFrameworks.cmake.diff
post-patch {
	reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Modules/CMakeFindFrameworks.cmake
}

post-destroot {
	xinstall -d -m 0755 ${destroot}${prefix}/share/emacs/site-lisp
	xinstall -m 0644 ${worksrcpath}/Docs/cmake-mode.el \
		${destroot}${prefix}/share/emacs/site-lisp
	foreach type {syntax indent} {
		xinstall -d -m 0755 ${destroot}${prefix}/share/vim/vimfiles/${type}
		xinstall -m 0644 -W ${worksrcpath}/Docs cmake-${type}.vim \
			${destroot}${prefix}/share/vim/vimfiles/${type}
	}
}

variant gui description {Qt4 based cmake-gui} {
	depends_lib-append path:libexec/qt4-mac:qt4-mac
	patchfiles-append patch-CMakeLists.txt.diff
	configure.args-append --qt-gui --qt-qmake=${prefix}/libexec/qt4-mac/bin/qmake
}

livecheck.type  regex
livecheck.regex {Latest Release \((\d(?:\.\d+)*)\)}
livecheck.url	${homepage}cmake/resources/software.html
