]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Fix path generation to the Matlab root
authorMichal Horn <hornmich@fel.cvut.cz>
Tue, 18 Nov 2014 13:15:22 +0000 (14:15 +0100)
committerMichal Horn <hornmich@fel.cvut.cz>
Tue, 18 Nov 2014 13:15:22 +0000 (14:15 +0100)
On Windows the default installation path for Matlab is in "Program Files"
folder, which name contains spaces. This caused the compilation to fail.
Double quotes added to the begining and to the end of the path to avoid
wrong interpretation of the spaces in the directories names.

rpp/blocks/compile_blocks.m

index c04001aaebfefa1808f7d115b80576da62f9e6cc..4442e0d19b576d38b50e0b47e949639efe90be3f 100644 (file)
@@ -30,7 +30,9 @@ function compile_blocks()
     %           link step fully evaluated.
     % options = '-v -g';
     options = '';
-    mex = fullfile(matlabroot(), 'bin', 'mex');
+    matlabRootPath=strcat('"',matlabroot(),'"');
+    mex = fullfile(matlabRootPath, 'bin', 'mex');
+
     sources = dir('sfunction_*.c');
 
     for i = sources'
@@ -38,10 +40,10 @@ function compile_blocks()
         if strcmp(i.name, 'sfunction_canreceive.c') || ...
            strcmp(i.name, 'sfunction_cantransmit.c'),
             local_opts = [local_opts ' ' ...
-                '-I' matlabroot  '/toolbox/shared/can/src/scanutil ' ...
-               '-I' matlabroot  '/toolbox/rtw/targets/common/can/datatypes ' ...
-                matlabroot '/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c '...
-                matlabroot '/toolbox/rtw/targets/common/can/datatypes/can_msg.c'];
+                '-I' matlabRootPath '/toolbox/shared/can/src/scanutil ' ...
+               '-I' matlabRootPath '/toolbox/rtw/targets/common/can/datatypes ' ...
+                matlabRootPath '/toolbox/rtw/targets/common/can/datatypes/sfun_can_util.c '...
+                matlabRootPath '/toolbox/rtw/targets/common/can/datatypes/can_msg.c'];
         end
         command = [mex ' ' i.name ' ' local_opts];
         disp(command);