-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
71 lines (58 loc) · 2.12 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
cmake_minimum_required(VERSION 3.5)
project(mocap_nokov)
# Require c++11
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "-std=c++11")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
set (nokov_sdk_INCLUDE_DIRS deps/nokov_sdk/include)
set (nokov_sdk_LIB_DIRS deps/nokov_sdk/lib)
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs
nav_msgs
dynamic_reconfigure
tf
)
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE )
message( STATUS "Architecture: ${ARCHITECTURE}" )
if (${ARCHITECTURE} MATCHES "arm")
set(nokov_sdk_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/${nokov_sdk_LIB_DIRS}/armhf/libnokov_sdk.so)
elseif (${ARCHITECTURE} MATCHES "aarch")
set(nokov_sdk_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/${nokov_sdk_LIB_DIRS}/aarch64/libnokov_sdk.so)
else()
set(nokov_sdk_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/${nokov_sdk_LIB_DIRS}/x64/libnokov_sdk.so)
endif()
message(STATUS ${nokov_sdk_LIBRARIES})
# dynamic reconfigure
generate_dynamic_reconfigure_options(
cfg/MocapNokov.cfg
)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp
dynamic_reconfigure
)
include_directories(include
${catkin_INCLUDE_DIRS}
${nokov_sdk_INCLUDE_DIRS}
)
add_subdirectory(src)
install(DIRECTORY launch config deps/nokov_sdk/include deps/nokov_sdk/lib/x64
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
if (${ARCHITECTURE} MATCHES "arm")
install(DIRECTORY launch config deps/nokov_sdk/include deps/nokov_sdk/lib/armhf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
elseif (${ARCHITECTURE} MATCHES "aarch")
install(DIRECTORY launch config deps/nokov_sdk/include deps/nokov_sdk/lib/aarch64
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
else()
install(DIRECTORY launch config deps/nokov_sdk/include deps/nokov_sdk/lib/x64
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
endif()