summaryrefslogtreecommitdiff
blob: b2467bf49be0c350a47d93e8ccb32962e61d0ca8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 2008-2012 Funtoo Technologies
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit base toolchain-funcs cmake-utils

MY_P=PCL-${PV}

DESCRIPTION="The Point Cloud Library (or PCL) is a large scale, open project for 3D point cloud processing."
HOMEPAGE="http://pointclouds.org"
SRC_URI="http://dev.pointclouds.org/attachments/download/610/${MY_P}-Source.tar.bz2"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cuda qhull sse sse2 sse3 ssse3"

RDEPEND="
	>=dev-libs/boost-1.46
	dev-cpp/eigen:3
	>=sci-libs/flann-1.7.1
	>=sci-libs/vtk-5.6.0
	cuda? ( >=dev-util/nvidia-cuda-toolkit-4 )
	qhull? ( >=media-libs/qhull-2011.1 )
"
DEPEND="${RDEPEND}"


CMAKE_BUILD_TYPE="Release"

S=${WORKDIR}/${MY_P}-Source

src_prepare() {
	base_src_prepare

	if has_version ">=sci-libs/vtk-5.8.0"; then
		epatch ${FILESDIR}/${P}-vtkio.patch
	fi
}

src_configure() {
	local mycmakeargs=(
		$(cmake-utils_use_enable sse SSE)
		$(cmake-utils_use_enable sse2 SSE2)
		$(cmake-utils_use_enable sse3 SSE3)
		$(cmake-utils_use_enable ssse3 SSSE3)
		$(cmake-utils_use_with qhull)
		$(cmake-utils_use_build test TESTS)
	)

	if use cuda; then
		if [[ "$(gcc-version)" > "4.4" ]]; then
			ewarn "CUDA and >=sys-devel/gcc-4.5 do not play well together. Disabling CUDA support."
			mycmakeargs+=( "-DWITH_CUDA=OFF" )
		else
			mycmakeargs+=( "-DWITH_CUDA=ON" )
		fi
	else
		mycmakeargs+=( "-DWITH_CUDA=OFF" )
	fi

	# no openni support yet
	mycmakeargs+=(
		"-DWITH_OPENNI=OFF"
	)

	cmake-utils_src_configure
}