|
|
@@ -93,6 +93,33 @@ behavior:
|
|
|
additional versions of Matlab for the automatic retrieval of the installed
|
|
|
versions.
|
|
|
|
|
|
+Imported targets
|
|
|
+^^^^^^^^^^^^^^^^
|
|
|
+
|
|
|
+.. versionadded:: 3.22
|
|
|
+
|
|
|
+This module defines the following :prop_tgt:`IMPORTED` targets:
|
|
|
+
|
|
|
+``Matlab::mex``
|
|
|
+ The ``mex`` library, always available.
|
|
|
+
|
|
|
+``Matlab::mx``
|
|
|
+ The mx library of Matlab (arrays), always available.
|
|
|
+
|
|
|
+``Matlab::eng``
|
|
|
+ Matlab engine library. Available only if the ``ENG_LIBRARY`` component
|
|
|
+ is requested.
|
|
|
+
|
|
|
+``Matlab::mat``
|
|
|
+ Matlab matrix library. Available only if the ``MAT_LIBRARY`` component
|
|
|
+ is requested.
|
|
|
+
|
|
|
+``Matlab::MatlabEngine``
|
|
|
+ Matlab C++ engine library, always available for R2018a and newer.
|
|
|
+
|
|
|
+``Matlab::MatlabDataArray``
|
|
|
+ Matlab C++ data array library, always available for R2018a and newer.
|
|
|
+
|
|
|
Variables defined by the module
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
@@ -1865,6 +1892,32 @@ if(Matlab_DATAARRAY_LIBRARY)
|
|
|
list(APPEND Matlab_LIBRARIES ${Matlab_DATAARRAY_LIBRARY})
|
|
|
endif()
|
|
|
|
|
|
+# internal
|
|
|
+# This small stub permits to add imported targets for the found MATLAB libraries
|
|
|
+function(_Matlab_add_imported_target _matlab_library_variable_name _matlab_library_target_name)
|
|
|
+ if(Matlab_${_matlab_library_variable_name}_LIBRARY)
|
|
|
+ if(NOT TARGET Matlab::${_matlab_library_target_name})
|
|
|
+ add_library(Matlab::${_matlab_library_target_name} UNKNOWN IMPORTED)
|
|
|
+ set_target_properties(Matlab::${_matlab_library_target_name} PROPERTIES
|
|
|
+ INTERFACE_INCLUDE_DIRECTORIES "${Matlab_INCLUDE_DIRS}"
|
|
|
+ IMPORTED_LOCATION "${Matlab_${_matlab_library_variable_name}_LIBRARY}")
|
|
|
+ if(_matlab_library_target_name STREQUAL "mex" OR
|
|
|
+ _matlab_library_target_name STREQUAL "eng" OR
|
|
|
+ _matlab_library_target_name STREQUAL "mat")
|
|
|
+ set_target_properties(Matlab::${_matlab_library_target_name} PROPERTIES
|
|
|
+ INTERFACE_LINK_LIBRARIES Matlab::mx)
|
|
|
+ endif()
|
|
|
+ endif()
|
|
|
+ endif()
|
|
|
+endfunction()
|
|
|
+
|
|
|
+_Matlab_add_imported_target(MX mx)
|
|
|
+_Matlab_add_imported_target(MEX mex)
|
|
|
+_Matlab_add_imported_target(ENG eng)
|
|
|
+_Matlab_add_imported_target(MAT mat)
|
|
|
+_Matlab_add_imported_target(ENGINE MatlabEngine)
|
|
|
+_Matlab_add_imported_target(DATAARRAY MatlabDataArray)
|
|
|
+
|
|
|
find_package_handle_standard_args(
|
|
|
Matlab
|
|
|
FOUND_VAR Matlab_FOUND
|