-
Notifications
You must be signed in to change notification settings - Fork 47
/
CMakeLists.txt
67 lines (55 loc) · 1.8 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
66
cmake_minimum_required(VERSION 3.2)
enable_testing()
include(GNUInstallDirs)
include(CheckCXXCompilerFlag)
project(boundingmesh)
set(VERSION 0.2)
add_definitions(-DBOUNDINGMESH_VERSION="${VERSION}")
find_package(GTest)
cmake_policy(SET CMP0057 NEW)
option(BOUNDINGMESH_VECTORIZE "use faster vectorized math (recommended unless build fails with Eigen errors)" ON)
if(NOT ${BOUNDINGMESH_VECTORIZE})
add_definitions(-DEIGEN_DONT_VECTORIZE -DEIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT)
endif()
if(WIN32)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
-D_USE_MATH_DEFINES
-D_WIN32_WINNT=0x501
-DNOMINMAX
-DWIN32_LEAN_AND_MEAN
)
else()
check_cxx_compiler_flag("-std=c++0x" HAS_CXX_COMPILER_FLAG_STDCXX0X)
if(HAS_CXX_COMPILER_FLAG_STDCXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
option(MORE_COMPILE_ERRORS "compile with strict error settings" ON)
if(MORE_COMPILE_ERRORS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=reorder -Werror=uninitialized -Wformat -Werror=return-type -Werror=missing-braces -Werror=switch -Wpedantic")
endif(MORE_COMPILE_ERRORS)
endif()
option(USE_EIGENQUADPROG "use QuadProg++ Eigen fork (forces us to LGPL)" ON)
if(USE_EIGENQUADPROG)
add_definitions(
-DUSE_EIGENQUADPROG=1
)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty
${EIGEN_INCLUDE_DIRS}
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
add_subdirectory(src/boundingmesh)
add_subdirectory(src/boundingmesh-bin)
add_subdirectory(src/boundingmesh-gui)
install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/README.md
${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
DESTINATION ${CMAKE_INSTALL_DATADIR}/boundingmesh
)