This file is indexed.

/usr/share/doc/gnat-gps/html/The-Project-Wizard.html is in gnat-gps-doc 5.0-16.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2002-2010 AdaCore.

This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, see http://www.gnu.org/licenses/.

A copy of the license is included in the section entitled
"GNU General Public License". -->
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using the GNAT Programming Studio: The Project Wizard</title>

<meta name="description" content="Using the GNAT Programming Studio: The Project Wizard">
<meta name="keywords" content="Using the GNAT Programming Studio: The Project Wizard">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index-table.html#Index-table" rel="index" title="Index table">
<link href="Project-Handling.html#Project-Handling" rel="up" title="Project Handling">
<link href="The-Project-Dependencies-Editor.html#The-Project-Dependencies-Editor" rel="next" title="The Project Dependencies Editor">
<link href="The-Project-Menu.html#The-Project-Menu" rel="previous" title="The Project Menu">
<style type="text/css">
<!--
   

a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
pre.smallexample {background-color:rgb(240,240,240);
                     font-family: courier new,courier,fixed;
                     font-size: 14px;
                     margin: 0px 40px 0px 40px;
                     border-width: 1px 2px 2px 1px;
                     border-top-style: dotted;
                     border-left-style: dotted;
                     border-right-style: solid;
                     border-bottom-style: solid;
                     border-color: black;}
   code             {color:black;
                     font-family: courier new,courier,fixed;
                     font-size: 14px;}
   body             {font-family: arial,helvetica,sans-serif;
                     font-size: 16px;
                     max-width: 800px;
                     text-align: justify}
   samp             {font-family: courier new,courier,fixed;
                     font-size: 14px}
                    

-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="The-Project-Wizard"></a>
<div class="header">
<p>
Next: <a href="The-Project-Dependencies-Editor.html#The-Project-Dependencies-Editor" accesskey="n" rel="next">The Project Dependencies Editor</a>, Previous: <a href="The-Project-Menu.html#The-Project-Menu" accesskey="p" rel="previous">The Project Menu</a>, Up: <a href="Project-Handling.html#Project-Handling" accesskey="u" rel="up">Project Handling</a> &nbsp; [<a href="Index-table.html#Index-table" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="The-Project-Wizard-1"></a>
<h3 class="section">7.8 The Project Wizard</h3>
<a name="index-project-wizard"></a>

<p>The project wizard allows you to create in a few steps a new project file.
It has a number of pages, each dedicated to editing a specific set of
attributes for the project.
</p>
<p>The typical way to access this wizard is through the
<code>Project-&gt;New...</code> menu.
</p>
<p>The project wizard is also launched when a new dependency is created
between two projects, through the contextual menu in the project
view.
</p>

<a name="index-screen-shot-20"></a>
<img src="project-wizard.jpg" alt="project-wizard">

<p>The wizard gives access to the following list of pages:
</p>
<ul>
<li> Project type
</li><li> Project Naming
</li><li> Languages Selection
</li><li> Version Control System Selection
</li><li> Source Directories Selection
</li><li> Build Directory
</li><li> Main Units
</li><li> Library
</li><li> Naming Scheme
</li><li> Switches
</li></ul>

<a name="Project-Type"></a>
<h4 class="subsection">7.8.1 Project Type</h4>

<p>Several types of project wizards are provided in GPS. Depending on the
information you have or your current setup, you will choose one or the
other.
</p>
<ul>
<li> Single Project

<p>This is likely the wizard you will use most often. It creates a project
file from scratch, and asks you for the location of source directories,
the object directory, &hellip;; The rest of this chapter describes this wizard
in more details
</p>
</li><li> Project Tree

<p>This wizard will attempt to create a set of one or more project files to
represent your current build environment. It will analyze what
your sources are, where the corresponding object files are, and will try
and find some possible setup for the project files (remember that a given
<samp>.gpr</samp> project file can be associated with a single object directory.
</p>
<p>This wizard might not work in all cases, but is worth a try to get you
started if you already have an existing set of sources
</p>
</li><li> Convert GLIDE Project (.adp)

<p>This wizard will help you convert a <samp>.adp</samp> project file that is used
by the GLIDE environment. The same restrictions apply as above, except
that the list of source directories, object directories
and tool switches are read directly from that file.
</p>
</li><li> Library Project
<a name="index-project_002c-library"></a>

<p>This specialized wizard is similar to the Single Project wizard, except it
adds one extra page, the Library page. The output of the compilation of this
project is a library (shared or static), as opposed to an executable in the
case of <code>Single Project</code>.
</p>
</li><li> Extending Project
<a name="index-project_002c-extending"></a>

<p>This specialized wizard allows you to easily create extending projects
(see <a href="Extending-Projects.html#Extending-Projects">Extending Projects</a>).
</p>
</li></ul>

<a name="Project-Naming"></a>
<h4 class="subsection">7.8.2 Project Naming</h4>

<p>This is the first page displayed by any of the wizard.
</p>
<p>You must enter the name and location of the project to create. This
name must be a valid Ada identifier (i.e. start with a letter,
optionally followed by a series of digits, letters or
underscores). Spaces are not allowed. Likewise, reserved Ada keywords
must be avoided. If the name is invalid, GPS will display an error
message when you press the <code>Forward</code> button.
</p>
<p>Child projects can be created from this dialog. These are project whose
name is of the form <code>Parent.Child</code>. GPS will automatically generate
the dependency to the parent project so as to make the child project
valid.
</p>
<p>In this page, you should also select what languages the source files
in this project are written in. Currently supported languages are <code>Ada</code>,
<code>C</code> and <code>C++</code>. Multiple languages can be used for a single
project.
</p>
<p>The last part of this page is used to indicate how the path should be
stored in the generated project file. Most of the time, this setting
will have no impact on your work. However, if you wish to edit the
project files by hand, or be able to duplicate a project hierarchy to
another location on your disk, it might be useful to indicate that
paths should be stored as relative paths (they will be relative to the
location of the project file).
</p>
<a name="Languages-Selection"></a>
<h4 class="subsection">7.8.3 Languages Selection</h4>
<a name="index-Languages"></a>

<p>This page is used to select the programming languages used for the
sources of this project. By default, only <code>Ada</code> is selected.
New languages can be added to this list by using XML files, see the
section on customizing GPS (see <a href="Adding-support-for-new-languages.html#Adding-support-for-new-languages">Adding support for new languages</a>).
</p>
<p>Additionally, this page allows you to select the toolchain used when working on
your project. There you can select one of the pre-defined toolchains or scan
your system for installed toolchains. You can also manually define some of the
tools in the toolchain such as the debugger to use, the gnat driver to use or
the gnatls tool to use.
</p>
<p>If you need to select a toolchain for a cross environment, you should have a
look at <a href="Working-in-a-Cross-Environment.html#Working-in-a-Cross-Environment">Working in a Cross Environment</a> for more info on this subject.
</p>
<a name="VCS-Selection"></a>
<h4 class="subsection">7.8.4 VCS Selection</h4>
<a name="index-Version-Control-System"></a>
<a name="index-VCS"></a>

<p>The second page in the project wizard allows you to select which Version
Control system is to be used for the source files of this project.
</p>
<p>GPS doesn&rsquo;t attempt to automatically guess what it should use, so you
must specify it if you want the VCS operations to be available to you.
</p>
<p>The two actions <code>Log checker</code> and <code>File checker</code> are the
name and location of programs to be run just prior an actual commit of
the files in the Version Control System. These should be used for
instance if you wish to enforce style checks before a file is actually
made available to other developers in your team.
</p>
<p>If left blank, no program will be run.
</p>
<a name="Source-Directories-Selection"></a>
<h4 class="subsection">7.8.5 Source Directories Selection</h4>

<p>This page lists and edits the list of source directories for the
project. Any number of source directory can be used (the default is to
use the directory which contains the project file, as
specified in the first page of the wizard).
</p>
<p>If you do not specify any source directory, no source file will be
associated with the project, since GPS wouldn&rsquo;t know where to look for
them.
</p>
<p>To add source directories to the project, select a directory in the
top frame, and click on the down arrow. This will add the directory to
the bottom frame, which contains the current list of source directories.
</p>
<p>You can also add a directory and all its subdirectories recursively by
using the contextual menu in the top frame. This contextual menu also
provides an entry to create new directories, if needed.
</p>
<p>To remove source directories from the project, select the directory in
the bottom frame, and click on the up arrow, or use the contextual
menu.
</p>
<p>All the files in these directories that match one of the language
supported by the project are automatically associated with that
project.
</p>
<p>The relative sizes of the top and bottom frame can be changed by
clicking on the separation line between the two frames and dragging
the line up or down.
</p>
<a name="Build-Directory"></a>
<h4 class="subsection">7.8.6 Build Directory</h4>
<a name="index-object-directory-1"></a>
<a name="index-exec-directory-1"></a>

<p>The object directory is the location where the files resulting from
the compilation of sources (e.g. <samp>.o</samp> files) are placed.
One object directory is associated for each project.
</p>
<p>The exec directory is the location where the executables are put. By
default, this is the same directory as the object directory.
</p>
<a name="Main-Units"></a>
<h4 class="subsection">7.8.7 Main Units</h4>
<a name="index-main-units"></a>

<p>The main units of a project are the files that should be compiled and
linked to obtain executables.
</p>
<p>Typically, for C applications, these are the files that contain the
<code>main()</code> function. For Ada applications, these are the files that
contain the main subprogram each partition in the project.
</p>
<p>These files are treated specially by GPS. Some sub-menus of
<code>Build</code> and <code>Debug</code> will have predefined entries for the
main units, which makes it more convenient to compile and link your
executables.
</p>
<p>To add main units click on the <code>Add</code> button. This opens a file
selection dialog. No check is currently done that the selected file
belongs to the project, but GPS will complain later if it doesn&rsquo;t.
</p>
<p>When compiled, each main unit will generate an executable, whose name
is visible in the second column in this page. If you are using a
recent enough version of GNAT (3.16 or more recent), you can change
the name of this executable by clicking in the second column and
changing the name interactively.
</p>
<a name="Library"></a>
<h4 class="subsection">7.8.8 Library</h4>
<a name="index-library-projects"></a>

<p>This page allows you to configure your project so that the output of
its compilation is a library (shared or static), as opposed to an
executable or a simple set of objet files. This library can then be linked
with other executables (and will be automatically if the project is imported
by another one.
</p>
<p>You need to define the attributes in the top box to transform your project
into a library project. See the tooltips that appear when you leave your
mouse on top of the label to the left of each field.
</p>
<p>If you define any of the attributes in the Standalone Library box, you
will compile a standalone library. This is a library that takes care of
its elaboration by itself, instead of relying on its caller to elaborate
it as is standard in Ada. You also have more control over what files make
up the public interface to the library, and what files are private to the
library and invisible from the outside.
</p>
<a name="Naming-Scheme"></a>
<h4 class="subsection">7.8.9 Naming Scheme</h4>
<a name="index-naming-scheme-1"></a>

<p>A naming scheme indicates the file naming conventions used in the different
languages supported by a given project.
For example, all <samp>.adb</samp> files are Ada files, all <samp>.c</samp> files are
C files.
</p>
<p>GPS is very flexible in this respect, and allows you to specify the
default extension for the files in a given programming language. GPS makes a
distinction between spec (or header) files, which generally contain
no executable code, only declarations, and body files which contain
the actual code. For languages other than Ada, this header file is
used rather than the body file when you select <code>Go To
Declaration</code> in the contextual menu of editors.
</p>
<p>In a language like Ada, the distinction between spec and body
is part of the definition of the language itself, and you should be
sure to specify the appropriate extensions.
</p>
<p>The default naming scheme for Ada is GNAT&rsquo;s naming scheme (<samp>.ads</samp>
for specs and <samp>.adb</samp> for bodies). In addition, a number of predefined
naming schemes for other compilers are available in the first combo box on
the page. You can also create your own customized scheme by entering a
free text in the text entries.
</p>

<a name="index-screen-shot-21"></a>
<img src="naming-scheme.jpg" alt="naming-scheme">

<p>For all languages, GPS accepts exceptions to this standard naming
scheme. For instance, this let you specify that in addition to using
<samp>.adb</samp> for Ada body files, the file <samp>foo.ada</samp> should also be
considered as an Ada file.
</p>
<p>The list of exceptions is displayed in the bottom list of the naming
scheme editor. To remove entries from this list, select the line you
want to remove, and then press the <tt class="key">Del</tt> key.
The contents of the lines can be edited interactively, by
double-clicking on the line and column you want to edit.
</p>
<p>To add new entries to this list, use the fields at the bottom of
the window, and press the update button.
</p>
<a name="index-multi_002dunit-source-files"></a>
<p>GNAT and GPS both support Ada source files that contain multiple Ada
units (typically a single file would contain both the spec and the body
of the unit for instance). This is not a recommend approach if you can
avoid it, since that might trigger unnecessary recompilation of your
source files. Such source files are always handled as naming scheme
exceptions, and you can specify those in the editor by adding &quot;at 1&quot;,
&quot;at 2&quot;,&hellip; after the file name for either the spec, the body or
both. The digit after &quot;at&quot; is the index (starting at 1) of the unit
in the source file.
</p>
<p>For instance, specifying &quot;file.ada at 1&quot; for the spec and &quot;file.ada at 2&quot;
for the body of the unit &quot;unit&quot; indicates that the two components of the
unit are in the same file, first the spec, followed by the body.
</p>
<a name="Switches-1"></a>
<h4 class="subsection">7.8.10 Switches</h4>
<a name="Switches"></a><a name="index-switches-1"></a>

<p>The last page of the project wizard is used to select the
default switches to be used by the various tools that GPS calls (compiler,
linker, binder, pretty printer, &hellip;).
</p>

<a name="index-screen-shot-22"></a>
<img src="switch-editor.jpg" alt="switch-editor">

<p>This page appears as a notebook, where each page is associated with a
specific tool. All these pages have the same structure:
</p>
<dl compact="compact">
<dt><b>Graphical selection of switches</b></dt>
<dd><p>The top part of each page contains a set of buttons, combo boxes,
entry fields, &hellip; which give fast and intuitive access to the most
commonly used switches for that tool.
</p>
</dd>
<dt><b>Textual selection of switches</b></dt>
<dd><p>The bottom part is an editable entry field, where you can directly
type the switches. This makes it easier to move from
an older setup (e.g. Makefile, script) to GPS, by copy-pasting switches.
</p></dd>
</dl>

<p>The two parts of the pages are kept synchronized at any time: clicking
on a button will edit the entry field to show the new switch; adding a
new switch by hand in the entry field will activate the corresponding
button if there is one.
</p>
<p>Any switch can be added to the entry field, even if there is no
corresponding button. In this case, GPS will simply forward it to the
tool when it is called, without trying to represent it graphically.
</p>
<hr>
<div class="header">
<p>
Next: <a href="The-Project-Dependencies-Editor.html#The-Project-Dependencies-Editor" accesskey="n" rel="next">The Project Dependencies Editor</a>, Previous: <a href="The-Project-Menu.html#The-Project-Menu" accesskey="p" rel="previous">The Project Menu</a>, Up: <a href="Project-Handling.html#Project-Handling" accesskey="u" rel="up">Project Handling</a> &nbsp; [<a href="Index-table.html#Index-table" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>