-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
80 lines (63 loc) · 2.48 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
76
77
78
79
80
# Copyright (C) 2018 Istituto Italiano di Tecnologia (IIT). All rights reserved.
# This software may be modified and distributed under the terms of the
# GNU Lesser General Public License v2.1 or any later version.
cmake_minimum_required(VERSION 3.5)
set(PROJECT_VERSION "1.2.0")
project(Wearables VERSION ${PROJECT_VERSION}
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Export all symbols in Windows
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Add a postfix to Windows libraries compiled in debug
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
# Libraries type
if(MSVC)
option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" OFF)
else()
option(BUILD_SHARED_LIBS "Build libraries as shared as opposed to static" ON)
endif()
# Control where binaries and libraries are placed in the build folder.
# This simplifies tests running in Windows.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
include(InstallBasicPackageFiles)
# Tweak linker flags in Linux
if(UNIX AND NOT APPLE)
get_filename_component(LINKER_BIN ${CMAKE_LINKER} NAME)
if(${LINKER_BIN} STREQUAL "ld")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--unresolved-symbols=report-all")
endif()
endif()
if(WIN32)
option(XSENS_MVN_USE_SDK "Build the driver and the wrapper for the real MVN system using the MVN SDK" ON)
#Add compile definition to suppress warning related to header <experimental/filesystem>
add_compile_definitions(_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING)
if(XSENS_MVN_USE_SDK)
find_package(XsensXME REQUIRED)
if(NOT ${XsensXME_FOUND})
message("XSENS XME not found but option to use it is enabled.")
return()
else()
add_subdirectory(XSensMVN)
endif()
endif()
endif()
add_subdirectory(interfaces)
add_subdirectory(impl)
# Prepare YARP wrapper and devices
find_package(YARP 3.2 REQUIRED)
set(YARP_FORCE_DYNAMIC_PLUGINS ON)
yarp_configure_plugins_installation(wearable)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(msgs)
add_subdirectory(devices)
add_subdirectory(wrappers)
add_subdirectory(app)
# Flag to enable Paexo wearable device
option(ENABLE_Paexo "Flag that enables building Paexo wearable device" OFF)