-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
75 lines (62 loc) · 1.65 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
cmake_minimum_required(VERSION 2.8)
project(RhobanUtils)
find_package(catkin REQUIRED COMPONENTS
jsoncpp Eigen
)
find_package(model)
catkin_package(
INCLUDE_DIRS .
LIBRARIES RhobanUtils
CATKIN_DEPENDS jsoncpp
)
option (RHOBANUTILS_BUILD_APPS "Build Rhoban utils apps" OFF)
include_directories(. ${catkin_INCLUDE_DIRS})
#Enable C++11
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
#Enable Weird option linker
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
#List Sources sub source directories
set(SOURCES_DIRECTORIES
.
timing
geometry
spline
sockets
logging
history
threading
trajectory
astar
graph
nominal
random
)
if (model_FOUND)
message("Rhoban Model found!")
include_directories(${model_INCLUDE_DIRS})
set (SOURCES_DIRECTORIES
${SOURCES_DIRECTORIES}
moves
)
endif ()
#Include Sources sub sources
foreach (DIRECTORY ${SOURCES_DIRECTORIES})
message(STATUS "-- Sources: Adding ${DIRECTORY}/")
include (${DIRECTORY}/Sources.cmake)
set (PREFIXED_SOURCES)
foreach (SOURCE ${SOURCES})
set (PREFIXED_SOURCES ${PREFIXED_SOURCES} ${DIRECTORY}/${SOURCE})
endforeach (SOURCE)
set (ALL_SOURCES ${ALL_SOURCES} ${PREFIXED_SOURCES})
endforeach (DIRECTORY)
add_library (RhobanUtils ${ALL_SOURCES})
target_link_libraries(RhobanUtils ${catkin_LIBRARIES})
if (model_FOUND)
target_link_libraries(RhobanUtils ${model_LIBRARIES})
endif ()
if (RHOBANUTILS_BUILD_APPS)
add_executable (astarTest astar/main.cpp)
target_link_libraries (astarTest RhobanUtils)
add_executable (graphTest graph/main.cpp)
target_link_libraries (graphTest RhobanUtils)
endif ()