-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
34 lines (29 loc) · 978 Bytes
/
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
cmake_minimum_required(VERSION 2.8)
project(DynamicWindowApproach)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(DWA_VERSION_MAJOR 1)
set(DWA_VERSION_MINOR 1)
set(DWA_VERSION_PATCH 0)
set(DWA_VERSION_STRING ${DWA_VERSION_MAJOR}.${DWA_VERSION_MINOR}.${DWA_VERSION_PATCH})
# Build demo executable
include_directories(src)
add_executable(demo examples/demo.c src/dwa.c)
set_target_properties(demo
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "../bin")
target_link_libraries(demo m SDL GL glut)
set_target_properties(demo PROPERTIES EXCLUDE_FROM_ALL TRUE)
# Build shared library
add_library(dwa SHARED src/dwa.c)
target_link_libraries(dwa m)
set_target_properties(dwa PROPERTIES PUBLIC_HEADER "src/dwa.h"
VERSION ${DWA_VERSION_STRING}
SOVERSION ${DWA_VERSION_MAJOR})
INSTALL(TARGETS dwa
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include)