-
Notifications
You must be signed in to change notification settings - Fork 286
/
Findfcl.cmake
54 lines (47 loc) · 1.34 KB
/
Findfcl.cmake
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
# Copyright (c) 2011-2019, The DART development contributors
# All rights reserved.
#
# The list of contributors can be found at:
# https://github.com/dartsim/dart/blob/master/LICENSE
#
# This file is provided under the "BSD-style" License
# Find FCL
#
# This sets the following variables:
# FCL_FOUND
# FCL_INCLUDE_DIRS
# FCL_LIBRARIES
# FCL_VERSION
find_package(PkgConfig QUIET)
# Check to see if pkgconfig is installed.
pkg_check_modules(PC_FCL fcl QUIET)
# Include directories
find_path(FCL_INCLUDE_DIRS
NAMES fcl/collision.h # for FCL < 0.6
NAMES fcl/narrowphase/collision.h
HINTS ${PC_FCL_INCLUDEDIR}
PATHS "${CMAKE_INSTALL_PREFIX}/include")
# Libraries
if(MSVC)
set(FCL_LIBRARIES "fcl$<$<CONFIG:Debug>:d>")
else()
# Give explicit precedence to ${PC_FCL_LIBDIR}
find_library(FCL_LIBRARIES
NAMES fcl
HINTS ${PC_FCL_LIBDIR}
NO_DEFAULT_PATH
NO_CMAKE_PATH
NO_CMAKE_ENVIRONMENT_PATH
NO_SYSTEM_ENVIRONMENT_PATH)
find_library(FCL_LIBRARIES
NAMES fcl
HINTS ${PC_FCL_LIBDIR})
endif()
# Version
set(FCL_VERSION ${PC_FCL_VERSION})
# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(fcl
FAIL_MESSAGE DEFAULT_MSG
REQUIRED_VARS FCL_INCLUDE_DIRS FCL_LIBRARIES
VERSION_VAR FCL_VERSION)