Skip to content

Commit 2c66759

Browse files
author
Gabriele Nava
authored
Merge pull request #141 from traversaro/fix140
Install files under <src_dir>/library/simulink-library/MomentumVelocityControl/src in <install_prefix>/mex/+wbc/simulink/MomentumVelocityControl to simplify use from install
2 parents 6c354c3 + ab3fa9a commit 2c66759

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

library/simulink-library/CMakeLists.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ macro(INSTALL_SUBLIBMFILES curdir)
2424
if(IS_DIRECTORY ${curdir}/${child})
2525
# This applies to the folders inside this directory <sublib_dir>/src are assumed to contain matlab files
2626
file(GLOB m_files ${curdir}/${child}/*.m)
27-
install(FILES ${m_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc)
27+
get_filename_component(curdir_no_path ${curdir} NAME)
28+
install(FILES ${m_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc/simulink/${curdir_no_path})
2829
endif()
2930
endforeach()
3031
# The following applies to the matlab files inside this directory <sublib_dir>/src
3132
file(GLOB m_files_out ${curdir}/src/*.m)
32-
install(FILES ${m_files_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc)
33+
get_filename_component(curdir_no_path ${curdir} NAME)
34+
install(FILES ${m_files_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/mex/+wbc/simulink/${curdir_no_path})
3335
endmacro()
3436

3537
macro(INSTALL_SUBLIBS curdir)

library/simulink-library/MomentumVelocityControl/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Please download Casadi by following this [link](https://web.casadi.org/get/) and
99

1010
## How to run
1111

12+
### From source repo
13+
1214
Add this folder to your matlab path, the momentum velocity control library will be available in the simulink library browser.
1315

16+
### From installed files
1417

18+
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 commit comments

Comments
 (0)