Skip to content

FindMatlab: in matlab_add_mex use the correct version file

Silvio Traversaro requested to merge (removed):patch-2 into master

Before this modification, the c_mexapi_version.c file was added to all mex libraries. However, if the C language was not enabled in the CMake project configuration, the c_mexapi_version.c file was ignored, creating linking errors in Windows and macOS.

This commit ensures that in the case only the CXX languages is enabled, the correct version is passed.

See #19382 (comment 679312) for a longer explanation of the issue.

Fixes: #19382 (closed)
Topic-rename: FindMatlab-only-CXX
Backport: release

Edited by Brad King

Merge request reports