-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (38 loc) · 1.34 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
cmake_minimum_required(VERSION 2.8)
project(rhoban_graphs)
option (RHOBAN_GRAPHS_BUILD_APPS "Build rhoban_graphs apps" OFF)
find_package(catkin REQUIRED COMPONENTS
rhoban_geometry
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES rhoban_graphs
CATKIN_DEPENDS rhoban_geometry
)
include_directories(include ${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
src/rhoban_graphs
)
#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 (rhoban_graphs ${ALL_SOURCES})
target_link_libraries(rhoban_graphs ${catkin_LIBRARIES})
if (RHOBAN_GRAPHS_BUILD_APPS)
add_executable (astarTest src/a_star_test.cpp)
target_link_libraries (astarTest rhoban_graphs ${catkin_LIBRARIES})
add_executable (graphTest src/test.cpp)
target_link_libraries (graphTest rhoban_graphs ${catkin_LIBRARIES})
endif()