Browse Source

FindMatlab: Add SIMULINK component

Jamie Snape 9 years ago
parent
commit
ccd1341ac9
1 changed files with 16 additions and 0 deletions
  1. 16 0
      Modules/FindMatlab.cmake

+ 16 - 0
Modules/FindMatlab.cmake

@@ -19,6 +19,7 @@
 #   ENG and MAT libraries of Matlab
 # * ``MAIN_PROGRAM`` the Matlab binary program.
 # * ``MEX_COMPILER`` the MEX compiler.
+# * ``SIMULINK`` the Simulink environment.
 #
 # .. note::
 #
@@ -1464,6 +1465,21 @@ if(_matlab_find_mat GREATER -1)
 endif()
 unset(_matlab_find_mat)
 
+# Component Simulink
+list(FIND Matlab_FIND_COMPONENTS SIMULINK _matlab_find_simulink)
+if(_matlab_find_simulink GREATER -1)
+  find_path(
+    Matlab_SIMULINK_INCLUDE_DIR
+    simstruc.h
+    PATHS "${Matlab_ROOT_DIR}/simulink/include"
+    NO_DEFAULT_PATH
+    )
+  if(Matlab_SIMULINK_INCLUDE_DIR)
+    set(Matlab_SIMULINK_FOUND TRUE)
+    list(APPEND Matlab_INCLUDE_DIRS "${Matlab_SIMULINK_INCLUDE_DIR}")
+  endif()
+endif()
+unset(_matlab_find_simulink)
 
 unset(_matlab_lib_dir_for_search)