From a808bec3b20a28f869ad439d6d605fa0ed49633b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 20 May 2021 10:00:12 +0200 Subject: [PATCH] Add casadi-matlab-bindings if ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS is ON and ROBOTOLOGY_USES_MATLAB is ON (#747) --- cmake/Buildcasadi-matlab-bindings.cmake | 15 +++++++++++++++ cmake/RobotologySuperbuildLogic.cmake | 3 +++ .../casadi-matlab-bindings_activate.msh | 5 +++++ .../casadi-matlab-bindings_deactivate.msh | 5 +++++ releases/latest.releases.yaml | 4 ++++ 5 files changed, 32 insertions(+) create mode 100644 cmake/Buildcasadi-matlab-bindings.cmake create mode 100644 conda/multisheller/casadi-matlab-bindings_activate.msh create mode 100644 conda/multisheller/casadi-matlab-bindings_deactivate.msh diff --git a/cmake/Buildcasadi-matlab-bindings.cmake b/cmake/Buildcasadi-matlab-bindings.cmake new file mode 100644 index 000000000..0bf3851f7 --- /dev/null +++ b/cmake/Buildcasadi-matlab-bindings.cmake @@ -0,0 +1,15 @@ +# Copyright (C) Fondazione Istituto Italiano di Tecnologia +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +include(YCMEPHelper) +include(FindOrBuildPackage) + +find_or_build_package(casadi QUIET) + +ycm_ep_helper(casadi-matlab-bindings TYPE GIT + STYLE GITHUB + REPOSITORY dic-iit/casadi-matlab-bindings.git + TAG main + COMPONENT dynamics + FOLDER src + CMAKE_ARGS -DCASADI_MATLAB_BINDINGS_USES_MATLAB:BOOL=${ROBOTOLOGY_USES_MATLAB} + DEPENDS casadi) diff --git a/cmake/RobotologySuperbuildLogic.cmake b/cmake/RobotologySuperbuildLogic.cmake index 97fe3de9f..902b07b18 100644 --- a/cmake/RobotologySuperbuildLogic.cmake +++ b/cmake/RobotologySuperbuildLogic.cmake @@ -54,6 +54,9 @@ if(ROBOTOLOGY_ENABLE_DYNAMICS) endif() if(ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS) find_or_build_package(bipedal-locomotion-framework) + if(ROBOTOLOGY_USES_MATLAB) + find_or_build_package(casadi-matlab-bindings) + endif() endif() endif() diff --git a/conda/multisheller/casadi-matlab-bindings_activate.msh b/conda/multisheller/casadi-matlab-bindings_activate.msh new file mode 100644 index 000000000..32825b3ac --- /dev/null +++ b/conda/multisheller/casadi-matlab-bindings_activate.msh @@ -0,0 +1,5 @@ +if_(is_set("COMSPEC")).then_([ + sys.list_append("MATLABPATH", path.join(env("CONDA_PREFIX"), "Library\\mex")) +]).else_([ + sys.list_append("MATLABPATH", path.join(env("CONDA_PREFIX"), "mex")) +]) diff --git a/conda/multisheller/casadi-matlab-bindings_deactivate.msh b/conda/multisheller/casadi-matlab-bindings_deactivate.msh new file mode 100644 index 000000000..96b2936f2 --- /dev/null +++ b/conda/multisheller/casadi-matlab-bindings_deactivate.msh @@ -0,0 +1,5 @@ +if_(is_set("COMSPEC")).then_([ + sys.list_remove("MATLABPATH", path.join(env("CONDA_PREFIX"), "Library\\mex")) +]).else_([ + sys.list_remove("MATLABPATH", path.join(env("CONDA_PREFIX"), "mex")) +]) diff --git a/releases/latest.releases.yaml b/releases/latest.releases.yaml index 8e2ed8814..75a0f4244 100644 --- a/releases/latest.releases.yaml +++ b/releases/latest.releases.yaml @@ -199,3 +199,7 @@ repositories: type: git url: https://github.com/dic-iit/matlab-whole-body-simulator.git version: v2.0.0 + casadi-matlab-bindings: + type: git + url: https://github.com/dic-iit/casadi-matlab-bindings.git + version: v3.5.5.0