-
Notifications
You must be signed in to change notification settings - Fork 48
/
BuildYARP.cmake
116 lines (103 loc) · 5.88 KB
/
BuildYARP.cmake
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (C) 2017 iCub Facility, Istituto Italiano di Tecnologia
# Authors: Daniele E. Domenichelli <ddomenichelli@drdanz.it>, Silvio Traversaro <silvio.traversaro@iit.it>
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
include(YCMEPHelper)
include(FindOrBuildPackage)
find_or_build_package(YCM QUIET)
set(YARP_OPTIONAL_DEPS "")
if(ROBOTOLOGY_ENABLE_ROBOT_TESTING)
find_or_build_package(RobotTestingFramework QUIET)
list(APPEND YARP_OPTIONAL_DEPS RobotTestingFramework)
endif()
set(YARP_OPTIONAL_CMAKE_ARGS "")
if(ROBOTOLOGY_USES_PYTHON OR ROBOTOLOGY_USES_LUA OR ROBOTOLOGY_USES_CSHARP)
set(YARP_COMPILE_BINDINGS ON)
else()
set(YARP_COMPILE_BINDINGS OFF)
endif()
if (APPLE OR WIN32)
set(ENABLE_USBCAMERA OFF)
else()
set(ENABLE_USBCAMERA ON)
endif()
# I2C is only enabled on Linux
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${ROBOTOLOGY_ENABLE_ICUB_HEAD})
set(YARP_USE_I2C ON)
else()
set(YARP_USE_I2C OFF)
endif()
if(ROBOTOLOGY_USES_PYTHON)
# Differently from other libraries, the `CMAKE_INSTALL_PYTHON3DIR` is a PATH CACHE variable,
# so if we pass a relative path, it gets automatically expanded to the absolute path w.r.t.
# to the current work directory where cmake is invoked, while we want it to be relative w.r.t.
# ${YCM_EP_INSTALL_DIR} (i.e. the variable that is passed as `CMAKE_INSTALL_PREFIX` to all projects)
file(TO_NATIVE_PATH "${YCM_EP_INSTALL_DIR}/${ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR}" ROBOTOLOGY_SUPERBUILD_PYTHON_FULL_INSTALL_DIR)
list(APPEND YARP_OPTIONAL_CMAKE_ARGS "-DCMAKE_INSTALL_PYTHON3DIR=${ROBOTOLOGY_SUPERBUILD_PYTHON_FULL_INSTALL_DIR}")
endif()
# Workaround for graphviz==9 failures with YARP <= 3.9
# See https://github.com/robotology/robotology-superbuild/issues/1604
if(ROBOTOLOGY_CONFIGURING_UNDER_CONDA)
list(APPEND YARP_OPTIONAL_CMAKE_ARGS "-DYARP_COMPILE_yarpviz:BOOL=OFF")
endif()
if(ROBOTOLOGY_SUPERBUILD_USING_LOCAL_SWIG_4_2_1_WORKAROUND_ON_NOBLE)
list(APPEND YARP_OPTIONAL_CMAKE_ARGS "-DSWIG_EXECUTABLE=${robotology_superbuild_local_noble_swig_4_2_1_SOURCE_DIR}/bin/swig")
list(APPEND YARP_OPTIONAL_CMAKE_ARGS "-DSWIG_DIR=${robotology_superbuild_local_noble_swig_4_2_1_SOURCE_DIR}/share/swig/4.2.1")
endif()
if(LSB_RELEASE_CODENAME STREQUAL "noble" AND NOT ROBOTOLOGY_CONFIGURING_UNDER_CONDA)
# Workaround for https://github.com/robotology/yarp/pull/3108
list(APPEND YARP_OPTIONAL_CMAKE_ARGS "-DYARP_USE_Lua=OFF")
endif()
ycm_ep_helper(YARP TYPE GIT
STYLE GITHUB
REPOSITORY robotology/yarp.git
TAG master
COMPONENT core
FOLDER src
DEPENDS YCM
${YARP_OPTIONAL_DEPS}
CMAKE_ARGS -DYARP_COMPILE_GUIS:BOOL=ON
-DYARP_USE_SYSTEM_SQLite:BOOL=ON
-DYARP_COMPILE_libYARP_math:BOOL=ON
-DYARP_COMPILE_CARRIER_PLUGINS:BOOL=ON
# Workaround for https://github.com/robotology/robotology-superbuild/issues/1091
-DYARP_DISABLE_MACOS_BUNDLES:BOOL=ON
-DENABLE_yarpcar_bayer:BOOL=ON
-DENABLE_yarpcar_tcpros:BOOL=ON
-DENABLE_yarpcar_xmlrpc:BOOL=ON
-DENABLE_yarpcar_priority:BOOL=ON
-DENABLE_yarpcar_bayer:BOOL=ON
-DENABLE_yarpcar_mjpeg:BOOL=ON
-DENABLE_yarpcar_portmonitor:BOOL=ON
-DENABLE_yarppm_bottle_compression_zlib:BOOL=ON
-DENABLE_yarppm_depthimage_compression_zlib:BOOL=ON
-DENABLE_yarppm_image_compression_ffmpeg:BOOL=ON
-DENABLE_yarppm_depthimage_to_mono:BOOL=ON
-DENABLE_yarppm_depthimage_to_rgb:BOOL=ON
-DENABLE_yarpidl_thrift:BOOL=ON
-DYARP_COMPILE_DEVICE_PLUGINS:BOOL=ON
-DENABLE_yarpcar_human:BOOL=ON
-DENABLE_yarpcar_rossrv:BOOL=ON
-DENABLE_yarpmod_fakebot:BOOL=ON
-DENABLE_yarpmod_imuBosch_BNO055:BOOL=${ROBOTOLOGY_ENABLE_ICUB_HEAD}
-DENABLE_yarpmod_SDLJoypad:BOOL=ON
-DENABLE_yarpmod_serialport:BOOL=${ROBOTOLOGY_ENABLE_ICUB_HEAD}
-DENABLE_yarpmod_AudioPlayerWrapper:BOOL=ON
-DENABLE_yarpmod_AudioRecorderWrapper:BOOL=ON
-DENABLE_yarpmod_portaudio:BOOL=ON
-DENABLE_yarpmod_portaudioPlayer:BOOL=ON
-DENABLE_yarpmod_portaudioRecorder:BOOL=ON
-DENABLE_yarpmod_opencv_grabber:BOOL=ON
# Enable all "fake" devices in YARP, as they are quite useful for tutorials
-DYARP_COMPILE_ALL_FAKE_DEVICES:BOOL=ON
-DYARP_COMPILE_RobotTestingFramework_ADDONS:BOOL=${ROBOTOLOGY_ENABLE_ROBOT_TESTING}
-DYARP_COMPILE_BINDINGS:BOOL=${YARP_COMPILE_BINDINGS}
-DYARP_USE_I2C:BOOL=${YARP_USE_I2C}
-DYARP_USE_SDL:BOOL=ON
-DCREATE_PYTHON:BOOL=${ROBOTOLOGY_USES_PYTHON}
-DCREATE_LUA:BOOL=${ROBOTOLOGY_USES_LUA}
-DCREATE_CSHARP:BOOL=${ROBOTOLOGY_USES_CSHARP}
-DENABLE_yarpmod_usbCamera:BOOL=${ENABLE_USBCAMERA}
-DENABLE_yarpmod_usbCameraRaw:BOOL=${ENABLE_USBCAMERA}
${YARP_OPTIONAL_CMAKE_ARGS})
set(YARP_CONDA_PKG_NAME libyarp)
set(YARP_CONDA_PKG_CONDA_FORGE_OVERRIDE ON)