This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
192 lines (154 loc) · 7.11 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
cmake_minimum_required(VERSION 2.8.11)
project(codyco-superbuild NONE)
## we have to enable C because it is currently used
## by CMake to describe packages (in Config*.cmake files)
enable_language(C)
# Disable in source build
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "In-source builds of codyco-superbuild are not allowed. "
"Please remove CMakeCache.txt and the CMakeFiles/ directory, then build out-of-source. "
"If you really want to do an in-source build, feel free to comment out this error.")
endif("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CODYCO-SUPERBUILD_MAJOR_VERSION 0)
set(CODYCO-SUPERBUILD_MINOR_VERSION 2)
set(CODYCO-SUPERBUILD_PATCH_VERSION 0)
set(CODYCO-SUPERBUILD_VERSION ${CODYCO-SUPERBUILD_MAJOR_VERSION}.${CODYCO-SUPERBUILD_MINOR_VERSION}.${CODYCO-SUPERBUILD_PATCH_VERSION})
include(CTest)
include(FeatureSummary)
set(YCM_USE_CMAKE_PROPOSED TRUE CACHE BOOL "Use files including unmerged cmake patches")
# Compilation options
# Matlab related options
option(CODYCO_USES_MATLAB "Enable compilation of software that depend on Matlab and Simulink" FALSE)
option(CODYCO_NOT_USE_SIMULINK "Disable compilation of software that depend on Simulink" FALSE)
mark_as_advanced(CODYCO_NOT_USE_SIMULINK)
#temporary option, useful to disable compilation of yarp-matlab-bindings
option(CODYCO_NOT_USE_YARP_MATLAB_BINDINGS "Disable compilation of yarp-matlab-bindings" FALSE)
mark_as_advanced(CODYCO_NOT_USE_YARP_MATLAB_BINDINGS)
option(CODYCO_USES_WBI_TOOLBOX "Legacy version of Whole Body Interface Toolbox 1.0 - Simulink library" FALSE)
option(CODYCO_USES_WBI_TOOLBOX_CONTROLLERS "Controllers and Simulink models created/used with the WBI-Toolbox" FALSE)
option(CODYCO_USES_MEX_WHOLEBODYMODEL "Enable compilation of mex-wholebodymodel software" FALSE)
# Other dynamic languages options
option(CODYCO_USES_LUA "Enable compilation of software that depend on Lua" FALSE)
option(CODYCO_USES_PYTHON "Enable compilation of software that depend on Python" FALSE)
option(CODYCO_USES_OCTAVE "Enable compilation of software that depend on Octave" FALSE)
# Options related to optional dependencies
option(CODYCO_USES_OROCOS_BFL_BERDY "Forked Orocos Bayesian Filtering Library" FALSE)
option(CODYCO_USES_KDL "Enable compilation of software that depends on KDL" FALSE)
mark_as_advanced(CODYCO_USES_KDL)
option(CODYCO_BUILD_ICUB_MODEL_GENERATOR "Enable compilation of the icub-model-generator" FALSE)
option(CODYCO_BUILD_OCRA_MODULES "Enable compilation of ISIR controllers" FALSE)
option(CODYCO_BUILD_QPOASES "Enable compilation of qpOASES" TRUE)
# Enable packages that depend on the Gazebo simulator
option(CODYCO_USES_GAZEBO "Enable compilation of software that depends on Gazebo" FALSE)
# Users are confused by this option:
# https://github.com/robotology/codyco-superbuild/issues/135
# https://github.com/robotology/codyco-superbuild/issues/138
# Mark as advanced until we fully support it
mark_as_advanced(CODYCO_USES_GAZEBO)
#set default build type to "Release" in single-config generators
if(NOT CMAKE_CONFIGURATION_TYPES)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, recommanded options are: Debug or Release" FORCE)
endif()
set(CODYCO_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CODYCO_BUILD_TYPES})
endif()
#options for testing
option(CODYCO_COMPILE_TESTS "Compile tests using the robot testing framework" FALSE)
option(CODYCO_TRAVIS_CI "Set if build is done with Travis-CI flags" FALSE)
# Optionally load a file named ProjectsTags
# for overwriting the desired branch/tag/commit
# of the included subprojects of the superbuild
# Useful for having superbuild "branches"
include(ProjectsTags OPTIONAL)
#Set CMake policies
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0045 NEW)
cmake_policy(SET CMP0046 NEW)
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
cmake_policy(SET CMP0054 NEW)
endif()
# Bootstrap YCM
# Version working after https://github.com/robotology/ycm/issues/108
set(YCM_TAG 9ffc3a48d99dd1bed603e796ec61638463c4790d)
# Workaround disabling hash warning until we fix https://github.com/robotology/codyco-superbuild/issues/162
set(YCM_SKIP_HASH_CHECK TRUE)
include(YCMBootstrap)
include(FindOrBuildPackage)
include(YCMEPHelper)
if(MSVC)
find_or_build_package(Eigen3)
else()
find_package(Eigen3 3.2 REQUIRED)
endif()
find_or_build_package(YARP 2.3.66)
find_or_build_package(ICUB)
find_or_build_package(yarpWholeBodyInterface)
find_or_build_package(codyco-modules)
#STARTUP MATLAB TOOLBOX
if (${CODYCO_USES_MATLAB})
# The following line is to properly configure the installation script of the MATLAB toolbox
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/.startup_codyco_superbuild.m.in ${CMAKE_BINARY_DIR}/startup_codyco_superbuild.m)
# Install configuration files
install(FILES ${CMAKE_BINARY_DIR}/startup_codyco_superbuild.m DESTINATION ${CMAKE_BINARY_DIR})
endif()
#codyco isir modules
if(${CODYCO_USES_KDL} AND ${CODYCO_BUILD_OCRA_MODULES} )
find_or_build_package(ocra-wbi-plugins)
endif()
#yarp-matlab-bindings
if ((${CODYCO_USES_MATLAB} OR ${CODYCO_USES_OCTAVE}) AND NOT ${CODYCO_NOT_USE_YARP_MATLAB_BINDINGS})
find_or_build_package(yarp-matlab-bindings)
endif()
#WB-Toolbox
if (${CODYCO_USES_MATLAB} AND NOT ${CODYCO_NOT_USE_SIMULINK})
find_or_build_package(WBToolbox)
endif()
#WBI-Toolbox
if (${CODYCO_USES_KDL} AND ${CODYCO_USES_WBI_TOOLBOX})
find_or_build_package(WBIToolbox)
endif()
#WBI-Toolbox-controllers
if (${CODYCO_USES_WBI_TOOLBOX_CONTROLLERS})
find_or_build_package(WBIToolboxControllers)
endif()
#Orocos BFL-BERDY
if (${CODYCO_USES_OROCOS_BFL_BERDY})
find_or_build_package(orocosBFLBerdy)
endif()
#mex wholeBodyModel interface
if (${CODYCO_USES_MEX_WHOLEBODYMODEL})
find_or_build_package(mexWholeBodyModel)
endif()
#icub-model-generator
if (${CODYCO_BUILD_ICUB_MODEL_GENERATOR})
find_or_build_package(icub-model-generator)
endif()
#qpOASES
if (${CODYCO_BUILD_QPOASES})
find_or_build_package(qpOASES)
endif()
# adding test related subprojces
if (${CODYCO_COMPILE_TESTS})
find_or_build_package(RTF)
find_or_build_package(icub-tests)
endif()
# Gazebo related projects
if(${CODYCO_USES_GAZEBO})
find_or_build_package(GazeboYARPPlugins)
find_or_build_package(icub-gazebo)
find_or_build_package(icub-gazebo-wholebody)
endif()
#Documentation
add_subdirectory(doc)
set_package_properties(Git PROPERTIES TYPE RUNTIME)
set_package_properties(Subversion PROPERTIES TYPE RUNTIME)
set_package_properties(PkgConfig PROPERTIES TYPE RUNTIME)
set_package_properties(Doxygen PROPERTIES TYPE RUNTIME)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
# Deprecation warning (at the end as user tend to read only the last part of the cmake output
message(WARNING "WARNING: The codyco-superbuild is being deprecated, and all users are recommended to "
"migrate to the robotology-superbuild. See https://github.com/robotology/codyco-superbuild/issues/198 .")