-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
108 lines (88 loc) · 4.24 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_MATH_DISABLE_FLOAT128")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
INCLUDE(CMakeColors)
PROJECT(MotionExplorer VERSION 0.3)
execute_process(COMMAND whoami OUTPUT_VARIABLE current_user OUTPUT_STRIP_TRAILING_WHITESPACE)
MESSAGE("USER: ${current_user}")
###############################################################################
#CHANGE HERE FOR CORRECT KLAMPT DIRECTORY
###############################################################################
SET(KLAMPT_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/libs/Klampt/")
LIST(APPEND CMAKE_MODULE_PATH "${KLAMPT_ROOT}/CMakeModules")
IF(EXISTS ${KLAMPT_ROOT})
MESSAGE("FOUND KLAMPT AT: ${KLAMPT_ROOT}")
ELSE()
MESSAGE( FATAL_ERROR "COULD NOT FIND KLAMPT AT ${KLAMPT_ROOT}")
ENDIF()
MESSAGE(COLOR_WHITE ${DEPENDENCIES})
SET(CMAKE_BUILD_TYPE Debug)
###############################################################################
MESSAGE("${CMAKE_MODULE_PATH}")
###############################################################################
### OMPL REquirements: CMAKE 2.8.7, Eigen 3.3, Boost 1.55
ADD_SUBDIRECTORY(libs/ompl)
SET(OMPL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/libs/ompl/src/ompl/")
INCLUDE_DIRECTORIES(SYSTEM "${OMPL_INCLUDE_DIRS}")
SET(OMPL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/libs/ompl/src/")
INCLUDE_DIRECTORIES(SYSTEM "${OMPL_INCLUDE_DIRS}")
### KLAMPT
FIND_PACKAGE(Klampt REQUIRED QUIET)
SET(DEPENDENCIES ${DEPENDENCIES} KLAMPT)
find_package(PkgConfig)
pkg_search_module(Eigen3 3.3 REQUIRED eigen3)
SET(DEPENDENCIES ${DEPENDENCIES} Eigen3)
FIND_PACKAGE(Boost 1.55.0 REQUIRED COMPONENTS filesystem thread serialization system)
SET(DEPENDENCIES ${DEPENDENCIES} Boost)
MESSAGE(COLOR_WHITE "-------------------------------------")
MESSAGE(COLOR_WHITE "-- INCLUDING DEPENDENCIES")
MESSAGE(COLOR_WHITE "-------------------------------------")
MESSAGE(COLOR_WHITE "")
FOREACH(DEPENDENCY ${DEPENDENCIES})
MESSAGE(COLOR_WHITE "-- ${DEPENDENCY}")
MESSAGE("VERSION : ${${DEPENDENCY}_VERSION}")
MESSAGE("LIBRARIES : ${${DEPENDENCY}_LIBRARIES} ${${DEPENDENCY}_LIBS}")
SET(MOTION_EXPLORER_LIBRARIES ${MOTION_EXPLORER_LIBRARIES} ${${DEPENDENCY}_LIBRARIES} ${${DEPENDENCY}_LIBS})
MESSAGE("INCLUDE : ${${DEPENDENCY}_INCLUDE_DIRS} ${${DEPENDENCY}_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(SYSTEM ${${DEPENDENCY}_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(SYSTEM ${${DEPENDENCY}_INCLUDE_DIR})
ADD_DEFINITIONS(${${DEPENDENCY}_DEFINITIONS})
ENDFOREACH(DEPENDENCY)
INCLUDE_DIRECTORIES(SYSTEM src)
FOREACH(SOURCETYPE cpp cc C cxx c)
FILE(GLOB_RECURSE SUBDIR_SRC src/*.${SOURCETYPE})
SET(MOTION_EXPLORER_SRC ${MOTION_EXPLORER_SRC} ${SUBDIR_SRC})
ENDFOREACH(SOURCETYPE)
MESSAGE(COLOR_WHITE "-------------------------------------")
MESSAGE(COLOR_WHITE "-- BUILDING EXECUTABLES")
MESSAGE(COLOR_WHITE "-------------------------------------")
MESSAGE(COLOR_WHITE "")
#### MAIN EXECUTABLES
FILE(GLOB EXECUTABLES_SOURCES test/*.cpp)
LIST(SORT EXECUTABLES_SOURCES)
FOREACH(EXEC_FILENAME ${EXECUTABLES_SOURCES})
GET_FILENAME_COMPONENT(EXEC ${EXEC_FILENAME} NAME_WE)
MESSAGE(COLOR_WHITE "-- ${EXEC}")
ADD_EXECUTABLE(${EXEC} ${EXEC_FILENAME} ${MOTION_EXPLORER_SRC})
TARGET_LINK_LIBRARIES(${EXEC} ${MOTION_EXPLORER_LIBRARIES})
TARGET_LINK_LIBRARIES(${EXEC} qhull)
TARGET_LINK_LIBRARIES(${EXEC} ompl)
ENDFOREACH(EXEC_FILENAME)
MESSAGE("-------------------------------------")
#### STANDALONE EXECUTABLES
FILE(GLOB EXECUTABLES_SOURCES standalone/*.cpp)
LIST(SORT EXECUTABLES_SOURCES)
FOREACH(EXEC_FILENAME ${EXECUTABLES_SOURCES})
GET_FILENAME_COMPONENT( EXEC ${EXEC_FILENAME} NAME_WE)
MESSAGE(COLOR_WHITE "-- ${EXEC}")
ADD_EXECUTABLE( ${EXEC} ${EXEC_FILENAME})
TARGET_LINK_LIBRARIES(${EXEC} ${MOTION_EXPLORER_LIBRARIES})
TARGET_LINK_LIBRARIES(${EXEC} ompl)
ENDFOREACH(EXEC_FILENAME)
MESSAGE("-------------------------------------")
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdeprecated-declarations -std=c++14 -g -Wall -Werror -O3 -fmax-errors=10" )
#SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdeprecated-declarations -std=c++11 -g -O3 -fmax-errors=10" )
MESSAGE("Compilers: ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}")
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"