aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 2fd3b8e18902fa110a1e6b6701b71cb16865fb38 (plain)
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
############################################
#
# libdyntree uses cmake because it's simple
#   Build instructions can be found in the README
#
############################################

# Set some flags
cmake_minimum_required(VERSION 2.8.11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c11")
set(CMAKE_BUILD_TYPE Debug)

# Create our project for further reference
project(libdyntree)
set(DYN_TREE_SRC lib/dtree.c lib/dyn_utils.c)

# Define our library in cmake
add_library(libdyntree SHARED ${DYN_TREE_SRC})

# Include the subdirectories to search for headers
target_include_directories(libdyntree PUBLIC "include")
target_include_directories(libdyntree PRIVATE "lib")

# since the name starts with 'lib' dont add it again
set_target_properties(libdyntree PROPERTIES PREFIX "")

################### TESTING CODE BELOW ###################

set(TEST_SRC test/main.c include/dtree/eztree.h)
add_executable(dyntree_test ${TEST_SRC})

# Library dependencies for the http extention
target_link_libraries(dyntree_test libdyntree)