Skip to content

Commit

Permalink
Merge pull request #141 from traversaro/fix140
Browse files Browse the repository at this point in the history
Install files under <src_dir>/library/simulink-library/MomentumVelocityControl/src in <install_prefix>/mex/+wbc/simulink/MomentumVelocityControl to simplify use from install
  • Loading branch information
Gabriele Nava authored Dec 16, 2021
2 parents 6c354c3 + ab3fa9a commit 2c66759
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/simulink-library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ macro(INSTALL_SUBLIBMFILES curdir)
if(IS_DIRECTORY ${curdir}/${child})
# This applies to the folders inside this directory <sublib_dir>/src are assumed to contain matlab files
file(GLOB m_files ${curdir}/${child}/*.m)
install(FILES ${m_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc)
get_filename_component(curdir_no_path ${curdir} NAME)
install(FILES ${m_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc/simulink/${curdir_no_path})
endif()
endforeach()
# The following applies to the matlab files inside this directory <sublib_dir>/src
file(GLOB m_files_out ${curdir}/src/*.m)
install(FILES ${m_files_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc)
get_filename_component(curdir_no_path ${curdir} NAME)
install(FILES ${m_files_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc/simulink/${curdir_no_path})
endmacro()

macro(INSTALL_SUBLIBS curdir)
Expand Down
4 changes: 4 additions & 0 deletions library/simulink-library/MomentumVelocityControl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Please download Casadi by following this [link](https://web.casadi.org/get/) and

## How to run

### From source repo

Add this folder to your matlab path, the momentum velocity control library will be available in the simulink library browser.

### From installed files

Add the `<install_prefix>/mex/+wbc/simulink` and `<install_prefix>/mex/+wbc/simulink/MomentumVelocityControl` to the matlab path, the momentum velocity control library will be available in the simulink library browser.

0 comments on commit 2c66759

Please sign in to comment.