cmake-basis / legacy

Legacy CMake BASIS project for versions 3.2 and older. For newer versions, go to
https://github.com/cmake-basis/BASIS
Other
13 stars 11 forks source link

Include MatlabTools by default only when MATLAB declared as dependency and found #487

Closed schuhschuh closed 9 years ago

schuhschuh commented 9 years ago

The MatlabTools.cmake module adds a number of advanced CMake configuration options to the project which are only meaningful to projects which use MATLAB. Others should not be polluted with these options.

schuhschuh commented 9 years ago

The basis_add_executable and basis_add_library commands should raise a proper error message when a project that did not declare MATLAB as (required) dependency attempts to add a MATLAB Compiler or MEX-file build target.

schuhschuh commented 9 years ago

Instead of conditionally including all tools, the global MCC/MEX options are added to the CMake cache only by the respective basis_add_mex_target and basis_add_mcc_target functions when such target is added by the project. Moreover, a dependency on MATLAB{mcc} must now be declared in the BasisProject.cmake file if needed to build any target.