forked from topskychen/voxelizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (55 loc) · 1.95 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
project(voxelizer CXX)
find_package(PkgConfig) # pkg_check_modules
find_package(Boost COMPONENTS atomic thread date_time filesystem system unit_test_framework program_options REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIR})
else()
message(FATAL_ERROR "Boost is required by Voxelizer")
endif()
if(PKG_CONFIG_FOUND)
pkg_check_modules(FCL fcl)
# check to see if the pkg is installed under the libccd name
if(NOT FCL_FOUND)
pkg_check_modules(FCL libfcl)
endif()
endif()
if(NOT FCL_FOUND)
# if pkfconfig is not installed, then fall back on more fragile detection
# of fcl
find_path(FCL_INCLUDE_DIRS collision.h
PATH_SUFFIXES fcl)
find_path(FCL_LIBRARY_DIRS
${CMAKE_SHARED_LIBRARY_PREFIX}fcl${CMAKE_SHARED_LIBRARY_SUFFIX})
if(FCL_INCLUDE_DIRS AND FCL_LIBRARY_DIRS)
set(FCL_LIBRARIES ${CMAKE_SHARED_LIBRARY_PREFIX}fcl${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
message(FATAL_ERROR "Libfcl is required by Voxelizer")
endif()
endif()
include_directories(${FCL_INCLUDE_DIRS})
link_directories(${FCL_LIBRARY_DIRS})
find_package(ASSIMP)
if(NOT ASSIMP_FOUND)
pkg_check_modules(ASSIMP assimp)
endif()
if( ASSIMP_FOUND )
message(STATUS "Found assimp version ${ASSIMP_VERSION}, ${ASSIMP_PACKAGE_VERSION}, ${ASSIMP_INCLUDE_DIRS}")
# For older versions of libassimp2,
# like the one in Ubuntu 12.04
set(CMAKE_REQUIRED_LIBRARIES assimp)
find_path(ASSIMP_LIBRARY_DIRS
${CMAKE_SHARED_LIBRARY_PREFIX}assimp${CMAKE_SHARED_LIBRARY_SUFFIX})
if(ASSIMP_LIBRARY_DIRS)
#set(ASSIMP_LIBRARIES ${CMAKE_SHARED_LIBRARY_PREFIX}assimp${CMAKE_SHARED_LIBRARY_SUFFIX})
message(STATUS "Assimp library : " ${ASSIMP_LIBRARIES})
else()
message(FATAL_ERROR "Libassimp is required by Voxelizer")
endif()
if( ${ASSIMP_VERSION} STRGREATER "2.0.0" )
set(IS_ASSIMP3 1)
endif()
endif()
add_subdirectory(src bin)
enable_testing()
add_subdirectory(test)