# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-games/ogre/ogre-1.6.5.ebuild,v 1.1 2010/01/11 18:38:13 mr_bones_ Exp $

EAPI=2
inherit multilib eutils flag-o-matic cmake-utils

DESCRIPTION="Object-oriented Graphics Rendering Engine"
HOMEPAGE="http://www.ogre3d.org/"

version_rename=${PV//./-}
version_rename1=${version_rename/_/}
version_rename2=${version_rename1/rc/RC}

SRC_URI="mirror://sourceforge/ogre/1.7/ogre-v${version_rename2}.tar.bz2"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc cg freeimage double-precision examples gtk threads"
RESTRICT="test" #139905

RDEPEND="dev-libs/zziplib
	media-libs/freetype:2
	virtual/opengl
	virtual/glu
	x11-libs/libXt
	x11-libs/libXaw
	x11-libs/libXrandr
	x11-libs/libX11
	cg? ( media-gfx/nvidia-cg-toolkit )
	freeimage? media-libs/freeimage
	gtk? ( x11-libs/gtk+:2 )
	threads? ( || ( >=dev-libs/boost-1.34.1 dev-libs/boost[threads] ) )"
DEPEND="${RDEPEND}
	x11-proto/xf86vidmodeproto
	"

S=${WORKDIR}/${PN}
CMAKE_BUILD_TYPE=RelWithDebInfo

src_configure() {
# if not build with RelWithDebInfo it will use Gentoo here
# which means /usr/bin stuff won't be installed as SampleBrowser for instance
mycmakeargs=(
	 -DCMAKE_INSTALL_PREFIX=/usr \
	 -DOGRE_INSTALL_PLUGINS_HEADERS=TRUE \
	 -DOGRE_INSTALL_SAMPLES=TRUE \
	 -DOGRE_INSTALL_DOCS=TRUE \
	 -DOGRE_INSTALL_MEDIA=TRUE \
	 -DOGRE_INSTALL_TOOLS=TRUE \
	 -DOGRE_INSTALL_SAMPLES_SOURCE=TRUE
	 )
cmake-utils_src_configure 

#	econf \
#		--disable-dependency-tracking \
#		--disable-freeimage \
#		--disable-openexr \
#		--disable-ogre-demos \
#		--enable-static \
#		--with-platform=GLX \
#		--with-gui=$(usev gtk || echo Xt) \
#		$(use_enable cg) \
#		$(use_enable devil) \
#		$(use_enable double-precision double) \
#		$(use_enable threads threading)
}

src_install() {
	cmake-utils_src_install
	#dodoc AUTHORS BUGS LINUX.DEV README
}
