Skip to content

Commit da74420

Browse files
authored
Merge pull request #77
Automatic Code Generation Support
2 parents 755187d + 3960ed4 commit da74420

File tree

104 files changed

+9644
-3754
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+9644
-3754
lines changed

.appveyor.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
version: appveyor.{build}
2+
clone_folder: c:\dev\wb-toolbox
3+
clone_depth: 1
4+
5+
platform: x64
6+
configuration: Release
7+
8+
image:
9+
- Visual Studio 2015
10+
- Visual Studio 2017
11+
12+
skip_tags: true
13+
skip_branch_with_pr: true
14+
15+
build:
16+
parallel: true
17+
verbosity: detailed
18+
19+
matrix:
20+
fast_finish: true
21+
22+
pull_requests:
23+
do_not_increment_build_number: true
24+
25+
init:
26+
- ps: $YARP_LATEST = "2.3.72"
27+
- ps: $ICUB_LATEST = "1.10.0"
28+
- ps: $ROBOTOLOGY_VS = "v14"
29+
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2015') { $GENERATOR = "Visual Studio 14 2015 Win64" }
30+
- ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2017') { $GENERATOR = "Visual Studio 15 2017 Win64" }
31+
32+
install:
33+
- ps: Start-FileDownload https://github.com/robotology/yarp/releases/download/v${YARP_LATEST}/yarp_${YARP_LATEST}_${ROBOTOLOGY_VS}_x86_amd64_1.exe -FileName c:\dev\yarp.exe -Timeout 300000
34+
- ps: Start-FileDownload https://github.com/robotology/icub-main/releases/download/v${ICUB_LATEST}/iCub_${ICUB_LATEST}_${ROBOTOLOGY_VS}_x86_amd64_1.exe -FileName c:\dev\icub.exe -Timeout 300000
35+
- ps: Start-Process -FilePath "c:\dev\yarp.exe" -ArgumentList "/S" -Wait -NoNewWindow -PassThru
36+
- ps: Start-Process -FilePath "c:\dev\icub.exe" -ArgumentList "/S" -Wait -NoNewWindow -PassThru
37+
38+
- ps: |
39+
# From: https://www.michaelmiklis.de/update-environment-variables-in-current-process/
40+
# Modified to append appveyor's path
41+
$ENV_MACHINE = ([Environment]::GetEnvironmentVariables('Machine'))
42+
foreach ($EnvVar in $ENV_MACHINE.keys) {
43+
Set-Item "Env:$($EnvVar)" -Value $ENV_MACHINE[$EnvVar]
44+
}
45+
$ENV_USER = ([Environment]::GetEnvironmentVariables('User'))
46+
foreach ($EnvVar in $ENV_USER.keys) {
47+
if ($EnvVar -ne 'Path') {
48+
Set-Item "Env:$($EnvVar)" -Value $ENV_USER[$EnvVar]
49+
}
50+
}
51+
if ($ENV_USER.ContainsKey('Path')) {
52+
Set-Item Env:Path -Value ((($env:Path -split ";") + ($ENV_USER.Path -split ";") + ($ENV_MACHINE.Path -split ";") | select -Unique) -join ";")
53+
}
54+
55+
- ps: git clone -q --depth 1 https://github.com/robotology/idyntree.git c:\dev\idyntree
56+
- ps: cd c:\dev\idyntree
57+
- ps: mkdir build
58+
- ps: cd build
59+
- ps: cmake -G"$GENERATOR" -DIDYNTREE_USES_QT5:BOOL=OFF ..
60+
- ps: cmake --build . --config $env:CONFIGURATION --target INSTALL
61+
62+
- ps: git clone -q --depth 1 https://github.com/robotology/ycm.git c:\dev\ycm
63+
- ps: mkdir "c:\Program Files\robotology\ycm"
64+
- ps: $env:YCM_DIR = "C:/Program Files/robotology/ycm/share/YCM/cmake/"
65+
- ps: cd c:\dev\ycm
66+
- ps: mkdir build
67+
- ps: cd build
68+
- ps: cmake -Wno-dev -G"$GENERATOR" -DCMAKE_INSTALL_PREFIX:PATH="c:\Program Files\robotology\ycm" ..
69+
- ps: cmake --build . --config $env:CONFIGURATION --target INSTALL
70+
71+
build_script:
72+
- ps: cd $env:APPVEYOR_BUILD_FOLDER
73+
- ps: mkdir build
74+
- ps: cd build
75+
- ps: cmake -G"$GENERATOR" ..
76+
- ps: cmake --build . --config $env:CONFIGURATION

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AlignConsecutiveDeclarations: false
88
AlignEscapedNewlines: Left
99
AlignOperands: true
1010
AlignTrailingComments: false
11-
AllowAllParametersOfDeclarationOnNextLine: true
11+
AllowAllParametersOfDeclarationOnNextLine: false
1212
AllowShortBlocksOnASingleLine: false
1313
AllowShortCaseLabelsOnASingleLine: false
1414
AllowShortFunctionsOnASingleLine: Inline

.travis.yml

Lines changed: 213 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,220 @@ language: cpp
55
os:
66
- linux
77

8-
matrix:
8+
cache:
9+
directories:
10+
- $HOME/cache
11+
- $HOME/.ccache
12+
- $HOME/Library/Caches/Homebrew
13+
14+
stages:
15+
- prepare linux
16+
- test # Default stage with matrix
17+
- osx
18+
- deploy
19+
20+
addons:
21+
apt:
22+
sources:
23+
- sourceline: 'ppa:nschloe/eigen-backports'
24+
- sourceline: 'deb http://www.icub.org/ubuntu trusty contrib/science'
25+
packages:
26+
- cmake3
27+
- ninja-build
28+
# YARP / iCub / wb-toolbox
29+
- icub-common
30+
- libqt5opengl5-dev
31+
- libeigen3-dev
32+
33+
compiler:
34+
- gcc
35+
- clang
36+
37+
env:
38+
global: TRAVIS_CMAKE_GENERATOR="Ninja"
39+
matrix:
40+
- TRAVIS_BUILD_TYPE="Release"
41+
- TRAVIS_BUILD_TYPE="Debug"
42+
43+
# ==============
44+
# STAGE: prepare
45+
# ==============
46+
47+
stage_prepare:
48+
script: &prepare_script
49+
# Clean the dependencies cache from previous builds (ccache is instead kept)
50+
- rm -rf $DEPS_CACHE
51+
- mkdir -p $DEPS_CACHE
52+
53+
# Install dependencies
54+
# --------------------
55+
56+
# Limit concurrency for some project in order to avoid let the CI fail
57+
- if [ "$TRAVIS_OS_NAME" == "linux" ] ; then CMAKE_BUILD_OPTIONS="-- -j4" ; fi
58+
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then CMAKE_BUILD_OPTIONS="" ; fi
59+
60+
- mkdir $HOME/git
61+
- export CXXFLAGS="-Wno-unused-command-line-argument"
62+
63+
# Install YCM
64+
- cd $HOME/git
65+
- git clone --depth 1 https://github.com/robotology/ycm.git
66+
- cd ycm
67+
- mkdir build && cd build
68+
- >-
69+
cmake .. \
70+
-G"$TRAVIS_CMAKE_GENERATOR" \
71+
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
72+
- cmake --build . --target install
73+
74+
# Install Yarp
75+
- cd $HOME/git
76+
- git clone --depth 1 https://github.com/robotology/yarp.git
77+
- cd yarp
78+
- mkdir build && cd build
79+
- >-
80+
cmake .. \
81+
-G"$TRAVIS_CMAKE_GENERATOR" \
82+
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
83+
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE \
84+
-DCREATE_LIB_MATH=ON
85+
- cmake --build . --config $TRAVIS_BUILD_TYPE --target install
86+
87+
# Install icub-main
88+
- cd $HOME/git
89+
- git clone --depth 1 https://github.com/robotology/icub-main.git
90+
- cd icub-main
91+
- mkdir build && cd build
92+
- >-
93+
cmake .. \
94+
-G"$TRAVIS_CMAKE_GENERATOR" \
95+
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
96+
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
97+
- cmake --build . --config $TRAVIS_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS
98+
99+
# Install iDynTree
100+
- cd $HOME/git
101+
- git clone --depth 1 https://github.com/robotology/idyntree.git
102+
- cd idyntree
103+
- mkdir build && cd build
104+
- >-
105+
cmake .. \
106+
-G"$TRAVIS_CMAKE_GENERATOR" \
107+
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
108+
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
109+
- cmake --build . --config $TRAVIS_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS
110+
111+
# ===================
112+
# STAGE: test (linux)
113+
# ===================
114+
115+
before_install: &before_install
116+
# Prepare ccache
117+
- mkdir -p $HOME/.local/bin
118+
- ln -s $(which ccache) $HOME/.local/bin/$CC
119+
- ln -s $(which ccache) $HOME/.local/bin/$CXX
120+
- export PATH=/$HOME/.local/bin:$PATH
121+
- echo "max_size = 1.0G" > $HOME/.ccache/ccache.conf
122+
# Setup the dependencies cache
123+
- export DEPS_CACHE=$HOME/cache/$TRAVIS_OS_NAME/$TRAVIS_BUILD_TYPE
124+
- export PATH=$PATH:$DEPS_CACHE/bin
125+
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEPS_CACHE/lib
126+
- export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
127+
128+
script: &script
129+
- cd $TRAVIS_BUILD_DIR
130+
- mkdir build && cd build
131+
- cmake -G"$TRAVIS_CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE ..
132+
- cmake --build . --config $TRAVIS_BUILD_TYPE
133+
134+
before_cache: &before_cache
135+
- before_cache: rm -rf $DEPS_CACHE
136+
137+
# ==========
138+
# STAGE: osx
139+
# ==========
140+
141+
stage_osx:
142+
before_install: &osx_before_install
143+
# Setup the dependencies cache
144+
- export DEPS_CACHE=$HOME/cache/$TRAVIS_OS_NAME/$TRAVIS_BUILD_TYPE
145+
- export PATH=$PATH:$DEPS_CACHE/bin
146+
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DEPS_CACHE/lib
147+
- export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
148+
install: &osx_install
149+
# Setup ccache
150+
- brew install ccache
151+
- export PATH="/usr/local/opt/ccache/libexec:$PATH"
152+
# Install dependencies
153+
- brew install eigen ace tinyxml gsl
154+
155+
# =============
156+
# STAGE: deploy
157+
# =============
158+
159+
stage_deploy:
160+
install: &deploy_install
161+
- pip3 install --user Pygments mkdocs mkdocs-material
162+
- export PATH=$HOME/.local/bin:$PATH
163+
script: &deploy_script
164+
- ./$TRAVIS_BUILD_DIR/.ci/generateDocumentation.sh
165+
166+
#after_success: &after_success_deploy
167+
#- ./$PROJECT_DIR_ABS/.ci/generateDocumentation.sh || travis_terminate 1
168+
169+
# ======================
170+
# BUILD JOBS FROM STAGES
171+
# ======================
172+
173+
jobs:
9174
include:
10-
# Enable a job for building the documentation
11-
- os: linux
175+
- &prepare_template
176+
stage: prepare linux
177+
before_install: *before_install
178+
install: skip
179+
script: *prepare_script
180+
before_cache: skip
181+
compiler: clang
182+
env:
183+
TRAVIS_BUILD_TYPE="Release"
184+
- <<: *prepare_template
185+
compiler: gcc
186+
- <<: *prepare_template
187+
compiler: clang
188+
env:
189+
TRAVIS_BUILD_TYPE="Debug"
190+
- <<: *prepare_template
191+
compiler: gcc
192+
env:
193+
TRAVIS_BUILD_TYPE="Debug"
194+
- &osx_template
195+
stage: osx
196+
os: osx
197+
compiler: clang
198+
osx_image: xcode9.3
199+
before_install: *osx_before_install
200+
install: *osx_install
201+
before_script: *prepare_script
202+
script: *script
203+
before_cache: skip
204+
env:
205+
TRAVIS_CMAKE_GENERATOR="Xcode"
206+
TRAVIS_BUILD_TYPE="Debug"
207+
- <<: *osx_template
208+
env:
209+
TRAVIS_CMAKE_GENERATOR="Unix Makefiles"
210+
TRAVIS_BUILD_TYPE="Debug"
211+
- stage: deploy
212+
compiler:
213+
cache:
214+
if: ((branch = master) AND (type != pull_request))
215+
before_install: skip
216+
install: *deploy_install
217+
before_script: skip
218+
script: *deploy_script
219+
before_cache: skip
220+
#after_success: &deploy_after_success
221+
after_success: skip
12222
env:
13223
TRAVIS_BUILD_DOCS=true
14224
GIT_COMMITTER_USERNAME=LOC2Bot
@@ -25,26 +235,6 @@ matrix:
25235
- graphviz
26236
- python3-pip
27237

28-
before_install:
29-
# Install documentation dependencies
30-
- >-
31-
if [[ "$TRAVIS_BRANCH" = "master" && -n "$TRAVIS_BUILD_DOCS" && "$TRAVIS_PULL_REQUEST" = "false" ]] ; then
32-
pip3 install --user Pygments mkdocs mkdocs-material || travis_terminate 1
33-
export PATH=$HOME/.local/bin:$PATH
34-
fi
35-
36-
# before_script:
37-
script:
38-
# Right now Travis only builds the documentation
39-
- true
40-
41-
after_success:
42-
# Generate the docs only if master, the TRAVIS_BUILD_DOCS is true and we can use secure variables
43-
- >-
44-
if [[ "$TRAVIS_BRANCH" = "master" && -n "$TRAVIS_BUILD_DOCS" && "$TRAVIS_PULL_REQUEST" = "false" ]] ; then
45-
./$PROJECT_DIR_ABS/.ci/generateDocumentation.sh || travis_terminate 1
46-
fi
47-
48238
# notifications:
49239
# email:
50240

CMakeLists.txt

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
# Copyright (C) 2013-2017 iCub Facility - Istituto Italiano di Tecnologia
2-
# Author: Jorhabib Eljaik, Francesco Romano, Diego Ferigo
3-
# CopyPolicy: Released under the terms of the GNU GPL v2.0.
1+
# Copyright (C) 2018 Istituto Italiano di Tecnologia (IIT). All rights reserved.
2+
# This software may be modified and distributed under the terms of the
3+
# GNU Lesser General Public License v2.1 or any later version.
44

5-
cmake_minimum_required(VERSION 3.3)
6-
project(WB-Toolbox)
5+
cmake_minimum_required(VERSION 3.5)
6+
project(WB-Toolbox LANGUAGES CXX VERSION 3.1)
77

88
set(CMAKE_CXX_STANDARD 11)
99
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1010

11+
# Add custom functions / macros
12+
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
13+
1114
find_package(YCM REQUIRED)
1215
include(YCMDefaultDirs)
1316

14-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
15-
set(WB-TOOLBOX_SHARE_DIR "${CMAKE_INSTALL_PREFIX}/share/WB-Toolbox")
17+
find_package(Matlab QUIET COMPONENTS
18+
MX_LIBRARY
19+
ENG_LIBRARY
20+
MAIN_PROGRAM
21+
# SIMULINK # Requires CMake > 3.7
22+
)
1623

17-
add_subdirectory(MxAnyType)
18-
add_subdirectory(toolbox)
24+
if(NOT WBTOOLBOX_USES_MATLAB)
25+
option(WBTOOLBOX_USES_MATLAB "Compile also Matlab-related components" ${Matlab_FOUND})
26+
endif()
1927

20-
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images DESTINATION ${WB-TOOLBOX_SHARE_DIR})
28+
if(WBTOOLBOX_USES_MATLAB)
29+
add_subdirectory(MxAnyType)
30+
endif()
31+
32+
add_subdirectory(toolbox)
2133

2234
include(AddUninstallTarget)

0 commit comments

Comments
 (0)