This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
61 lines (47 loc) · 1.91 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
# Copyright (C) 2016 CoDyCo
# Author: Gabriele Nava
# CopyPolicy: Released under the terms of the GNU GPL v2.0.
cmake_minimum_required(VERSION 2.8)
PROJECT(mexWholeBodyModel)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Look for dependencies
find_package(Matlab REQUIRED
MX_LIBRARY
MAIN_PROGRAM)
if(NOT Matlab_FOUND)
message(FATAL_ERROR "Matlab not found")
endif()
find_package(ICUB REQUIRED)
find_package(YARP REQUIRED)
find_package(YCM REQUIRED)
find_package(TinyXML REQUIRED)
find_package(iDynTree 0.3.9 REQUIRED)
find_package(wholeBodyInterface REQUIRED)
find_package(yarpWholeBodyInterface REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${YARP_MODULE_PATH})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ICUB_MODULE_PATH})
include(YCMDefaultDirs)
include(YarpInstallationHelpers)
include(AddInstallRPATHSupport)
yarp_configure_external_installation(codyco)
### Settings for rpath
if(NOT MSVC)
#add the option to enable RPATH
option(MEXWHOLEBODYMODEL_ENABLE_RPATH "Enable RPATH installation" TRUE)
mark_as_advanced(MEXWHOLEBODYMODEL_ENABLE_RPATH)
endif(NOT MSVC)
add_install_rpath_support(BIN_DIRS ${CMAKE_INSTALL_PREFIX}/bin
LIB_DIRS ${CMAKE_INSTALL_PREFIX}/mex ${CMAKE_INSTALL_PREFIX}/lib
DEPENDS MEXWHOLEBODYMODEL_ENABLE_RPATH
USE_LINK_PATH)
# Enable testing and generate test target
include(CTest)
enable_testing()
# Subdirectories
add_subdirectory(mex-wholebodymodel)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
# STARTUP mexWholeBodyModel
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/.startup_mexWholeBodyModel.m.in ${CMAKE_BINARY_DIR}/startup_mexWholeBodyModel.m)
install(FILES ${CMAKE_BINARY_DIR}/startup_mexWholeBodyModel.m DESTINATION share/mexWholeBodyModel)