]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/demos/rpp_build_demos.m
e46acefc64eacc5a9cac562afb034dfae3da162d
[pes-rpp/rpp-simulink.git] / rpp / demos / rpp_build_demos.m
1 % RPP_BUILD_DEMOS Builds all or selected demos in the demo folder\r
2 %     RPP_BUILD_DEMOS builds all demos in the demo directory.\r
3 %\r
4 %     RPP_BUILD_DEMOS DEMO1 DEMO2 ... builds only the demos\r
5 %     mentioned on the command line.\r
6 %\r
7 %     RPP_BUILD_DEMOS(CELLSTR) builds demos specified in the cell\r
8 %     array of strings CELLSTR.\r
9 \r
10 % Copyright (C) 2013-2015 Czech Technical University in Prague\r
11 %\r
12 % Authors:\r
13 %     - Michal Sojka <sojkam1@fel.cvut.cz>\r
14 %\r
15 % This document contains proprietary information belonging to Czech\r
16 % Technical University in Prague. Passing on and copying of this\r
17 % document, and communication of its contents is not permitted\r
18 % without prior written authorization.\r
19 %\r
20 % File : compile_blocks.m\r
21 % Abstract:\r
22 %     Build all demos in the demo folder\r
23 %\r
24 \r
25 function rpp_build_demos(varargin)\r
26     d = fullfile(getpref('rpp', 'TargetRoot'), '..', 'demos');\r
27     cd(d)\r
28 \r
29     if nargin == 1 && iscell(varargin{1}),\r
30         for i=1:length(varargin{1}),\r
31             build_demo(varargin{1}{i})\r
32         end\r
33     elseif nargin > 0,\r
34         for i=1:nargin,\r
35             build_demo(varargin{i});\r
36         end\r
37     else\r
38         for i=dir('*.slx')',\r
39             build_demo(i.name);\r
40         end\r
41     end\r
42 \r
43 function build_demo(file)\r
44     [p, n, e] = fileparts(file);\r
45     disp(['Building ', file]);\r
46     slbuild(n, 'StandaloneRTWTarget', 'ForceTopModelBuild', true);\r