CMakeLists.txt 1.48 KB
Newer Older
sachinc's avatar
sachinc committed
1
cmake_minimum_required(VERSION 2.4.6)
isucan's avatar
isucan committed
2
project(fcl CXX C)
sachinc's avatar
sachinc committed
3
4
5
6
7
8
9
10

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries

isucan's avatar
isucan committed
11
set(CMAKE_BUILD_TYPE Release)
isucan's avatar
isucan committed
12

isucan's avatar
isucan committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")

# Check for SSE flags
set(FCL_HAVE_SSE 0)
include(FCLCheckSSE)
fcl_check_for_sse()
if (SSE_FLAGS)
  message(STATUS "FCL uses SSE")
  add_definitions(${SSE_FLAGS})
  set(FCL_HAVE_SSE 0)
  # waiting for Jia to fix this; not using sse anyway
else()
  message(STATUS "FCL does not use SSE")
endif()
sachinc's avatar
sachinc committed
27

isucan's avatar
isucan committed
28
# make sure we know what flag we used for SSE 
isucan's avatar
isucan committed
29
30
31
include_directories("include")

find_package(PkgConfig)
isucan's avatar
isucan committed
32
33
34
35
pkg_check_modules(CCD REQUIRED ccd)
include_directories(${CCD_INCLUDE_DIRS})
link_directories(${CCD_LIBRARY_DIRS})

isucan's avatar
isucan committed
36
37
38
39
40
pkg_check_modules(OCTOMAP QUIET octomap)
if(OCTOMAP_FOUND)
    include_directories(${OCTOMAP_INCLUDE_DIRS})
    link_directories(${OCTOMAP_LIBRARY_DIRS})
endif()
jpan's avatar
jpan committed
41

isucan's avatar
isucan committed
42

isucan's avatar
isucan committed
43
44
add_subdirectory(include/fcl)
add_subdirectory(src)
isucan's avatar
isucan committed
45
46
47
48
49
50

set(pkg_conf_file "${CMAKE_CURRENT_SOURCE_DIR}/fcl.pc")
configure_file("${pkg_conf_file}.in" "${pkg_conf_file}" @ONLY)

install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
install(FILES "${pkg_conf_file}" DESTINATION lib/pkgconfig/ COMPONENT pkgconfig)