Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation of IDYNTREE_USES_MATLAB when SWIG is not found #790

Merged
merged 3 commits into from
Dec 4, 2020

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented Dec 4, 2020

This is particularly convenient on Windows, where install SWIG (when not using conda-forge) is not obvious. In particular, ${SWIG_USE_FILE} is defined only when SWIG is found, so the current version fails as ${SWIG_USE_FILE} is empty.

As additional cleanup, modify find_package(MATLAB) calls to only ask for the required components, i.e. MEX_LIBRARY normally and MAIN_PROGRAM only when tests are enabled.

Furthermore, while testing I noticed that the MATLAB bindings were not working on Windows for the "Gateway function not found error", I fixed it by switching to use matlab_add_mex. This in particular could impact @AngeloRendiniello @singhbal-baljinder @AlbertoRemusIIT , so once this is merged I will release 2.0.2 .

This is particularly convenient on Windows, where install SWIG
(when not using conda-forge) is not obvious.

As additional cleanup, modify find_package(MATLAB) calls to only
ask for the required components, and use matlab_add_mex to ensure
that visibility is properly addressed for on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants