Subversion Repositories gelsvn

Rev

Rev 217 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 bj 1
Running the Workspace Generator
2
-------------------------------
3
 
4
The most common way to use the Make Project Creator is to run the
5
workspace generator (mwc.pl).  This script will generate projects and a
6
single workspace that contains the generated projects.  If no input file
7
(.mwc file) is specified, it will recurse into the directory in which the
8
script was started.  It looks for .mpc files and generates a project or
9
projects for each one found.
10
 
11
 
12
Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse]
13
              [-ti <dll | lib | dll_exe | lib_exe>:<file>] [-hierarchy]
14
              [-template <file>] [-relative NAME=VAR] [-base <project>]
15
              [-noreldefs] [-notoplevel] [-static] [-genins] [-use_env]
16
              [-value_template <NAME+=VAL | NAME=VAL | NAME-=VAL>]
17
              [-value_project <NAME+=VAL | NAME=VAL | NAME-=VAL>]
18
              [-make_coexistence] [-feature_file <file name>]
19
              [-expand_vars] [-features <feature definitions>]
20
              [-exclude <directories>] [-name_modifier <pattern>]
21
              [-apply_project] [-version] [-into <directory>]
217 bj 22
              [-gfeature_file <file name>]
107 bj 23
              [-language <cplusplus | csharp | java | vb>]
217 bj 24
              [-type <automake | bds | bmake | em3 | ghs | html |
107 bj 25
                      make | nmake | sle | vc6 | vc7 | vc71 |
26
                      vc8>]
27
              [files]
28
 
29
       -base           Add <project> as a base project to each generated
30
                       project file.  Do not provide a file extension, the
31
                       .mpb extension will be tried first; if that fails the
32
                       .mpc extension will be tried.
33
       -exclude        Use this option to exclude directories when searching
34
                       for input files.
35
       -expand_vars    Perform direct expansion, instead of performing relative
36
                       replacement with either -use_env or -relative options.
37
       -feature_file   Specifies the feature file to read before processing.
38
                       The default feature file is default.features under the
39
                       config directory.
40
       -features       Specifies the feature list to set before processing.
41
       -genins         Generate .ins files for use with prj_install.pl.
217 bj 42
       -gfeature_file  Specifies the global feature file.  The
43
                       default value is global.features under the
44
                       config directory.
107 bj 45
       -global         Specifies the global input file.  Values stored
46
                       within this file are applied to all projects.
47
       -hierarchy      Generate a workspace in a hierarchical fashion.
48
       -include        Specifies a directory to search when looking for base
49
                       projects, template input files and templates.  This
50
                       option can be used multiple times to add directories.
51
       -into           Place all output files in a mirrored directory
52
                       structure starting at <directory>.
217 bj 53
       -language       Specify the language preference; possible values are
54
                       [cplusplus csharp java vb].  The default is
107 bj 55
                       cplusplus.
56
       -make_coexistence If multiple 'make' based project types are
57
                       generated, they will be named such that they can coexist.
58
       -name_modifier  Modify output names.  The pattern passed to this
59
                       parameter will have the '*' portion replaced with the
60
                       actual output name.  Ex. *_Static
61
       -apply_project  When used in conjunction with -name_modifier, it applies
62
                       the name modifier to the project name also.
63
       -noreldefs      Do not try to generate default relative definitions.
64
       -notoplevel     Do not generate the top level target file.  Files
65
                       are still process, but no top level file is created.
66
       -recurse        Recurse from the current directory and generate from
67
                       all found input files.
68
       -relative       Any $() variable in an mpc file that is matched to NAME
69
                       is replaced by VAR only if VAR can be made into a
70
                       relative path based on the current working directory.
71
       -static         Specifies that only static projects will be generated.
72
                       By default, only dynamic projects are generated.
73
       -ti             Specifies the template input file (with no extension)
74
                       for the specific type (ex. -ti dll_exe:vc8exe).
75
       -template       Specifies the template name (with no extension).
76
       -type           Specifies the type of project file to generate.  This
77
                       option can be used multiple times to generate multiple
78
                       types.  If -type is not used, it defaults to 'make'.
79
       -use_env        Use environment variables for all uses of $() instead
80
                       of the relative replacement values.
81
       -value_project  This option allows modification of a project variable
82
                       assignment .  Use += to add VAL to the NAME's value.
83
                       Use -= to subtract and = to override the value.
84
                       This can be used to introduce new name value pairs to
85
                       a project.  However, it must be a valid project
86
                       assignment.
87
       -value_template This option allows modification of a template input
88
                       name value pair.  Use += to add VAL to the NAME's
89
                       value.  Use -= to subtract and = to override the value.
90
       -version        Print the MPC version and exit.
91
 
92
The default global input file (config/global.mpb) is used if -global
93
is not specified on the command line.
94
 
95
Two include directories are used by default (config and templates).
96
 
97
Each project creator has a default template input file for each type of
98
project (dll_exe, lib_exe, dll, lib).  You can override the default template
99
input file name with the -ti option.  The file must have a 'mpt' extension
100
and must reside within the include search directories.  NOTE: the 'lib' and
101
the 'lib_exe' template input files are only used if the project creator makes
102
a separate project file for dynamic libraries and static libraries.
103
 
104
The -exclude option is used to exclude directories when searching for input
105
files.  NOTE: This option has no effect when used with mpc.pl.
106
 
107
The -genins option will cause MPC to generate an "install" file after
108
processing each project that can be used in conjunction with the
109
prj_install.pl script to install different parts of the project (such as
110
header files) into an alternate location.
111
 
112
The -hierarchy option is used to force the generation of a hierarchical
113
workspace at each directory level in between the toplevel directory and the
114
location of the mpc file that is being processed.  This is the default for
115
"make" based workspace creators.  NOTE: This option only has an effect when
116
passed to mwc.pl.
117
 
118
The -template option is used to override the default template name.  This
119
file should have a .mpd extension and sit in one of the include search
120
directories.  NOTE: The -template option overrides the template file for all
121
types specified.
122
 
123
The -static option can be used to generate only static project files.
124
 
125
The -static_only option has been replaced by the -static option.  Currently,
126
MPC only supports generating dynamic projects or static projects, but not
127
both during the same run.  To generate them both you must run MPC twice, once
128
with the -static option and once without.  Additionally, the vc6, em3, vc7,
129
vc71 and vc8 project names will no longer automatically have _Static
130
appended to the project name when generating static projects.  This can
131
still be achieved by using the -name_modifier option.
132
 
133
When generating static projects, inter-project dependencies will not be
134
generated for libraries within vc6, em3, vc7, vc71 and vc8 workspaces.  The
135
reason is due to the fact that each static library that depended upon another
136
would be combined at the library creation stage, resulting in extremely large
137
libraries.
138
 
139
This behavior can be modified by setting the
140
MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY environment variable.  It will force
141
MPC to generate inter-project dependencies for libraries within a single
142
workspace.
143
 
144
The -name_modifier option can be used to modify the generated workspace or
145
project name.  The parameter to the -name_modifier option is a pattern where
146
an asterisk (*) within the pattern is replaced by the actual workspace or
147
project name.  Thus, passing -name_modifier '*_Static' to mwc.pl will result
148
in all workspace and project names ending in _Static. (Ex. FOO_Static.dsw,
149
FOO_Static.dsp, etc.)
150
 
151
The -apply_project option, when used in conjunction with the -name_modifier
152
option, causes MPC to apply the name modifier to the project name in
153
addition to the workspace and project file names.  This option has no effect
154
outside the scope of the -name_modifier option.
155
 
156
The -noreldefs option says not to generate default relative definitions for
157
*_ROOT (which comes from environment variables).
158
 
159
The -notoplevel option tells mwc.pl to generate all projects for a
160
workspace, but do not generate the top level workspace file.  For mpc.pl, it
161
says process the mpc files, but do not generate the project files.
162
 
163
The -recurse option is used to search for all files that could be processed
164
from the current directory and its sub-directories.  If directories are
165
passed in a comma separated list (e.g -recurse=examples,apps,TAO), then
166
those directories will be excluded when searching for project or workspace
167
files.
168
 
169
The -type option can be used multiple times on the same command line to
170
generate projects of different types per mpc file.  The default type for
171
this version of MPC is 'make'.  NOTE: The -ti option overrides the template
172
input file for all types specified.
173
 
174
The -feature_file specifies a file to be read that enables or disables
175
features.  These feature names can be anything, but they should correspond
176
to values used for the 'requires' and 'avoids' keywords.  If a feature is
177
required and is not enable then the project will not be created.  If a
178
feature is to be avoided and it is enabled then the project will not be
179
created.
180
 
181
The -features specifies additional list of features values. Values
182
specified by this option overwrite values from features files.
183
Example:
184
mwc.pl -features "qos=1,ssl=0" ace.mwc
185
 
217 bj 186
The -value_template option can be used to set various template variables.
187
If a template variable value will contain spaces, it is best to enclose the
188
whole setting in double quotes and use single quotes within the value to
189
retain spaces (if it is necessary).  Below is an example where the value
190
will have spaces and some spaces need to be retained.
107 bj 191
 
217 bj 192
mwc.pl -value_template "configurations=Debug Release 'Memcheck Debug' 'Memcheck Release'"
193
 
194
 
107 bj 195
Running only the Project Generator
196
----------------------------------
197
 
198
Most of what is stated about the Workspace Generator applies to the Project
199
Generator except that it only generates projects.  If an input file (.mpc
200
file) is not provided, the project creator will attempt to create a default
201
project in the directory from which the script was started.
202
 
203
 
204
Environment Variables
205
---------------------
206
 
207
MPC_COMMANDLINE - The value of this environment variable will be prepended
208
to the options passed to mwc.pl or mpc.pl (if any are passed).
209
 
210
MPC_VERBOSE_ORDERING - If this is set, mwc.pl will warn the user about
211
references to projects in the 'after' keyword that have not been processed.
212
 
213
MPC_DEPENDENCY_COMBINED_STATIC_LIBRARY - See the -static section above.
214
 
215
MPC_SILENT - If this is set, MPC will not print out any information or
216
warnings when processing projects or workspaces.  Errors are always printed
217
if any are encountered.
218
 
219
MPC_LOGGING - If this is set, MPC will parse the value and provide
220
informational, warning, diagnostic and detail messages depending on it's
221
setting.  If the MPC_LOGGING value contains info=1, informational messages
222
will be printed.  If it contains warn=1, warning messages will be printed.
223
If it contains diag=1, diagnostic messages will be printed.
224
And lastly, if it contains detail=1, detail messages will be printed.  If it
225
contains none of these, MPC will act as if MPC_SILENT was set.