forked from robotology/robots-configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
96 lines (87 loc) · 3.82 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Copyright: (C) 2016 iCub Facility - Istituto Italiano di Tecnologia
# Authors: Ugo Pattacini
# CopyPolicy: Released under the terms of the GNU GPL v2.0.
cmake_minimum_required(VERSION 2.8.9)
project(robots-configuration)
find_package(YARP REQUIRED)
find_package(ICUBcontrib REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${ICUBCONTRIB_MODULE_PATH})
include(YarpInstallationHelpers)
include(ICUBcontribOptions)
include(ICUBcontribHelpers)
option(INSTALL_ALL_ROBOTS "Enable installation of all robots" OFF)
set(ROBOT_NAME "$ENV{YARP_ROBOT_NAME}" CACHE PATH "Name of your robot")
set(ROBOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${ROBOT_NAME}")
icubcontrib_set_default_prefix()
if(INSTALL_ALL_ROBOTS)
add_subdirectory(iCubAberystwyth01)
add_subdirectory(iCubAbuDhabi01)
add_subdirectory(iCubAnkara01)
add_subdirectory(iCubBarcelona01)
add_subdirectory(iCubBielefeld01)
add_subdirectory(iCubBielefeld02)
add_subdirectory(iCubBielefeld03)
add_subdirectory(iCubChemnitz01)
add_subdirectory(iCubDaejeon01)
add_subdirectory(iCubEdinburgh01)
add_subdirectory(iCubFrankfurt01)
add_subdirectory(iCubGenova01)
add_subdirectory(iCubGenova03)
add_subdirectory(iCubGenova04)
add_subdirectory(iCubNancy01)
add_subdirectory(iCubGrenoble01)
add_subdirectory(iCubHamburg01)
add_subdirectory(iCubHertfordshire01)
add_subdirectory(iCubHertfordshire02)
add_subdirectory(iCubKarlsruhe01)
add_subdirectory(iCubLausanne01)
add_subdirectory(iCubLisboa01)
add_subdirectory(iCubLisboa02)
add_subdirectory(iCubLondon01)
add_subdirectory(iCubLugano01)
add_subdirectory(iCubLyon01)
add_subdirectory(iCubMunich01)
add_subdirectory(Nottingham01)
add_subdirectory(iCubOffenbach01)
add_subdirectory(iCubOffenbach02)
add_subdirectory(iCubOsaka01)
add_subdirectory(iCubParis01)
add_subdirectory(iCubParis02)
add_subdirectory(iCubPlymouth01)
add_subdirectory(iCubPlymouth02)
add_subdirectory(iCubPrototype01)
add_subdirectory(iCubRome01)
add_subdirectory(iCubRome02)
add_subdirectory(iCubSheffield01)
add_subdirectory(iCubTwente01)
add_subdirectory(iCubUrbana01)
add_subdirectory(iCubZurich01)
else()
if(ROBOT_NAME)
if(IS_DIRECTORY ${ROBOT_DIR})
add_subdirectory(${ROBOT_NAME})
endif()
endif()
endif()
# setup symbolic link (on UNIX...)
if("${ROBOT_NAME}" STREQUAL "")
message(STATUS "No robot name")
else()
if(EXISTS ${ROBOT_DIR})
if(UNIX)
message(STATUS "Setting up symbolic link for ${ROBOT_NAME}")
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${ROBOT_NAME})\n
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_INSTALL_PREFIX}/${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${ROBOT_NAME}\n
${CMAKE_INSTALL_PREFIX}/${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/default)")
add_custom_target(robotSymLink ALL COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${ROBOT_NAME}
${CMAKE_BINARY_DIR}/${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/default
DEPENDS ${CMAKE_BINARY_DIR}/${ICUBCONTRIB_ROBOTS_INSTALL_DIR}/${ROBOT_NAME})
else()
message(STATUS "Cannot set up symbolic link for ${ROBOT_NAME} on this OS, please set the YARP_ROBOT_NAME environment variable to ${ROBOT_NAME}")
endif()
else()
message(WARNING "ROBOT_NAME is set to ${ROBOT_NAME} but the ${ROBOT_DIR} directory does not exist")
endif()
endif()
icubcontrib_add_uninstall_target()