summaryrefslogtreecommitdiff
blob: 6d8c46a0c5cd4a826a2974f089d529890f32486f (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cmake

if [ "${PV}" = "9999" ]; then
	EGIT_REPO_URI="https://github.com/flexible-collision-library/${PN}.git"
	inherit git-r3
else
	SRC_URI="https://github.com/flexible-collision-library/fcl/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~arm"
fi

DESCRIPTION="The Flexible Collision Library"
HOMEPAGE="http://gamma.cs.unc.edu/FCL/"

LICENSE="BSD"
SLOT="0/6"
IUSE="cpu_flags_x86_sse doc +octomap profiling test"
RESTRICT="!test? ( test )"

RDEPEND="
	dev-cpp/eigen:3
	dev-libs/boost:=[threads(+)]
	sci-libs/flann
	sci-libs/libccd[double-precision]
	octomap? ( sci-libs/octomap:= )"

DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )
	test? ( dev-cpp/gtest )"

BDEPEND="${RDEPEND}
	virtual/pkgconfig"

src_configure() {
	sed -i -e "s/include(CompilerSettings)//" "${S}"/CMakeLists.txt || die "failed to remove compiler flags override"

	local mycmakeargs=(
		-DBUILD_TESTING=$(usex test ON OFF)
		-DFCL_COVERALLS=OFF
		-DFCL_COVERALLS_UPLOAD=OFF
		-DFCL_ENABLE_PROFILING=$(usex profiling ON OFF)
		-DFCL_TREAT_WARNINGS_AS_ERRORS=OFF
		-DFCL_USE_HOST_NATIVE_ARCH=OFF
		-DFCL_USE_X64_SSE=$(usex cpu_flags_x86_sse ON OFF)
		-DFCL_WITH_OCTOMAP=$(usex octomap ON OFF)
	)
	local CMAKE_BUILD_TYPE="Release"
	cmake_src_configure
}

src_compile() {
	cmake_src_compile

	use doc && cmake_src_compile docs
}

src_install() {
	cmake_src_install

	use doc && HTML_DOCS=( "${S}"/doc/doxygen/html )
	einstalldocs
}