1bdep-new(1)                 General Commands Manual                bdep-new(1)
2
3
4

NAME

6       bdep-new - create and initialize new project
7

SYNOPSIS

9       bdep new [options] [--no-init] spec [name]
10       bdep new [options] --config-add|-A cfg-dir [@cfg-name] spec [name]
11       bdep new [options] --config-create|-C cfg-dir [@cfg-name] spec [name]
12                [cfg-args]
13       bdep new [options] --package [prj-spec] spec [name]
14       bdep new [options] --source [prj-spec] spec [name]
15
16       spec     = [lang] [type] [vcs]
17       lang     = --lang|-l (c|c++)[,lang-opt...]
18       type     = --type|-t (exe|lib|bare|empty)[,type-opt...]
19       vcs      = --vcs|-s (git|none)[,vcs-opt...]
20       prj-spec = --directory|-d prj-dir
21       cfg-args = [-- bpkg-options] [--existing|-e | (module | cfg-var)...]
22

DESCRIPTION

24       The  new command creates and initializes a new project (the first three
25       forms), a new package in an already  existing  project  (the  --package
26       form),   or   a   new   source  subdirectory  in  an  already  existing
27       project/package (the --source form).  All  the  forms  except  --source
28       first create according to spec a new build2 project/package called name
29       in the name subdirectory of the current working directory (unless over‐
30       ridden with --output-dir|-o).
31
32       The first form then, unless the --no-init option is specified, initial‐
33       izes an empty project database as if by executing the bdep-init(1) com‐
34       mand with the --empty option. For example:
35
36       $ bdep new -l c++ -t exe hello
37
38       $ tree hello/
39       hello/
40       ├── hello/
41       │   ├── hello.cxx
42       │   └── buildfile
43       ├── buildfile
44       └── manifest
45
46       Similarly,  the  second and third forms add an existing or create a new
47       build configuration and then initialize the project in that  configura‐
48       tion  as if by executing the bdep-init(1) command with the --config-add
49       or --config-create option, respectively. For example:
50
51       $ bdep new -l c++ -t exe -C @gcc hello cc config.cxx=g++
52
53       The --package form adds the new package to the  packages.manifest  file
54       creating  it if necessary. If no project directory is explicitly speci‐
55       fied  with  --directory|-d,  then  the  current  working  directory  is
56       assumed. Note that nested packages are not allowed. For example:
57
58       $ bdep new -t empty hello
59       $ cd hello
60
61       $ bdep new --package -l c++ -t lib libhello
62       $ bdep new --package -l c++ -t exe hello
63
64       $ bdep init -C @gcc cc config.cxx=g++
65
66       $ cd ..
67       $ tree hello/
68       hello/
69       ├── hello/
70       │   ├── hello/
71       │   │   ├── hello.cxx
72       │   │   └── buildfile
73       │   ├── buildfile
74       │   └── manifest
75       ├── libhello/
76       │   ├── libhello/
77       │   │   ├── hello.hxx
78       │   │   ├── hello.cxx
79       │   │   └── buildfile
80       │   ├── buildfile
81       │   └── manifest
82       └── packages.manifest
83
84       The  --source form operates as-if by first creating according to spec a
85       temporary project called name and then copying its source  subdirectory
86       (name/name/  by  default) over to the current working directory (unless
87       overridden with --output-dir|-o). If no  project/package  directory  is
88       explicitly  specified  with  --directory|-d,  then  the current working
89       directory is assumed. For example:
90
91       $ bdep new -l c++ -t bare hello
92       $ cd hello
93
94       $ bdep new --source -l c++ -t lib libhello
95       $ bdep new --source -l c++ -t exe hello
96
97       $ bdep init -C @gcc cc config.cxx=g++
98
99       $ cd ..
100       $ tree hello/
101       hello/
102       ├── hello/
103       │   ├── hello.cxx
104       │   └── buildfile
105       ├── libhello/
106       │   ├── hello.hxx
107       │   ├── hello.cxx
108       │   └── buildfile
109       ├── buildfile
110       └── manifest
111
112       In all the forms, if name is omitted, then the current  working  direc‐
113       tory  name  (unless  overridden  with  --output-dir|-o)  is used as the
114       project/package/source subdirectory name. See Package  Name  (#package-
115       name) for details on project/package names.
116
117       The  source subdirectory can be customized with the subdir project type
118       sub-option (see below for details). For example:
119
120       $ bdep new -l c++ -t lib,subdir=libhello/io libhello-io
121
122       $ tree libhello-io/
123       libhello-io/
124       └── libhello/
125           └── io/
126               ├── hello-io.hxx
127               └── hello-io.cxx
128
129       By default the source subdirectory is created  in  the  project/package
130       root  directory and contains both headers (including public headers for
131       libraries) as well as sources. This can be customized in  a  number  of
132       ways  using  the  prefix* and split project type sub-options (see below
133       for details). For example, to move the source subdirectory inside src/:
134
135       $ bdep new -l c++ -t exe,prefix=src hello
136
137       $ tree hello/
138       hello/
139       └── src/
140           └── hello/
141               └── hello.cxx
142
143       And to split the library source subdirectory into  public  headers  and
144       other source files:
145
146       $ bdep new -l c++ -t lib,split libhello
147
148       $ tree libhello/
149       libhello/
150       ├── include/
151       │   └── libhello/
152       │       └── hello.hxx
153       └── src/
154           └── libhello/
155               └── hello.cxx
156
157       See the SOURCE LAYOUT section below for details and more examples.
158
159       The  output  directory may already contain existing files provided they
160       don't clash with the files to be created. The new command  also  recog‐
161       nizes  certain well-known files and tries to use the extracted informa‐
162       tion in the package manifest file. Specifically, it tries to guess  the
163       license  from  the  LICENSE  file  as  well as extract the summary from
164       README.md.  This allows for the following workflow:
165
166       # Create a project with LICENSE and README.md on one of the Git
167       # hosting services (GitHub, GitLab, etc).
168
169       $ git clone .../libhello.git
170       $ cd libhello
171
172       $ bdep new -l c++ -t lib
173
174       The project parameters such as  language,  type  (executable,  library,
175       etc),  and  version control system can be customized as described next.
176       Some of these parameters also  support  parameter-specific  sub-options
177       (such as the file extensions to use in a C++ project) that can be spec‐
178       ified with a comma after the parameter value.
179
180       The project language can be specified with the --lang|-l option.  Valid
181       values  for  this  option  and  their semantics are described next.  If
182       unspecified, a C++ project is created by default.
183
184       c
185              A C project.
186
187       c++
188              A C++ project. Recognized language sub-options:
189
190          cpp
191              Use the .cpp, .hpp, .ipp, .tpp, and .mpp source file  extensions
192              (alias for extension=?pp).
193
194          extension=pattern
195              Derive  source file extensions from pattern by replacing every ?
196              with one of the c (source), h  (header),  i  (inline),  t  (tem‐
197              plate),  or  m (module interface) letters. If unspecified and no
198              individual extensions are specified with the below options, then
199              ?xx is used by default.
200
201          hxx=extension
202              Use  the  specified  extension  for  header files instead of the
203              default .hxx.
204
205          cxx=extension
206              Use the specified extension for  source  files  instead  of  the
207              default .cxx.
208
209          ixx=extension
210              Use  the  specified  extension for inline files. If unspecified,
211              then assume no inline files are used by the project.
212
213          txx=extension
214              Use the specified extension for template files. If  unspecified,
215              then assume no template files are used by the project.
216
217          mxx=extension
218              Use  the  specified  extension  for  module  interface files. If
219              unspecified, then assume no modules are used by the project.
220
221       As an example, the following command creates a header-only C++  library
222       that  uses  the  .h  extension  for  header files and .cpp – for source
223       files:
224
225       $ bdep new -l c++,hxx=h,cxx=cpp -t lib,binless libhello
226
227       The project type can be specified with the --type|-t option.  The empty
228       project  type  is  language-agnostic  with the semantics and valid sub-
229       options for the rest being language-dependent, as  described  next.  If
230       unspecified, an executable project is created by default.
231
232       exe
233              A  project  that builds a sample C or C++ executable. Recognized
234              executable project sub-options:
235
236          no-tests
237              Don't add support for functional/integration testing.
238
239          unit-tests
240              Add support for unit testing.
241
242          no-install
243              Don't add support for installing.
244
245          prefix=dir
246              Optional source prefix relative to project/package root.
247
248          subdir=dir
249              Alternative source subdirectory relative to source prefix.
250
251          no-subdir
252              Omit the source subdirectory.
253
254          license=name
255
256
257          no-readme
258
259
260          alt-naming
261              See common sub-options below.
262
263       lib
264              A project that builds a sample  C  or  C++  library.  Recognized
265              library project sub-options:
266
267          binless
268              Create a header-only C++ library.
269
270          no-tests
271              Don't add support for functional/integration testing.
272
273          unit-tests
274              Add support for unit testing.
275
276          no-install
277              Don't add support for installing.
278
279          no-version
280              Don't add support for generating the version header.
281
282          prefix-include=dir
283              Optional public header prefix relative to project/package root.
284
285          prefix-source=dir
286              Optional source prefix relative to project/package root.
287
288          prefix=dir
289              Shortcut for prefix-include=dir,prefix-source=dir.
290
291          split
292              Shortcut for prefix-include=include,prefix-source=src.
293
294          subdir=dir
295              Alternative  source  subdirectory relative to header/source pre‐
296              fix.
297
298          no-subdir
299              Omit the source subdirectory.
300
301          no-subdir-source
302              Omit the source subdirectory relative to the source  prefix  but
303              still create it relative to the header prefix.
304
305          license=name
306
307
308          no-readme
309
310
311          alt-naming
312              See common sub-options below.
313
314       bare
315              A  project without any source code that can be filled later (see
316              --source). Recognized bare project sub-options:
317
318          no-tests
319              Don't add support for testing.
320
321          no-install
322              Don't add support for installing.
323
324          license=name
325
326
327          no-readme
328
329
330          alt-naming
331              See common sub-options below.
332
333       empty
334              An empty project that can be filled with packages  (see  --pack‐
335              age).  Recognized empty project sub-options:
336
337          no-readme
338              See common sub-options below.
339
340       common
341              Common project type sub-options:
342
343          license=name
344              Specify  the  project's license. The license name can be an SPDX
345              License Expression (https://spdx.org/licenses/), which,  in  its
346              simplest  form, is just the license ID. Or it can be a free form
347              name in the other: license name  scheme.  If  unspecified,  then
348              other:  proprietary  is  assumed. The following tables lists the
349              most commonly used free/open source software license IDs as well
350              as a number of pre-defined other: names. See the license (#mani‐
351              fest-package-license) package manifest value for  more  informa‐
352              tion.
353
354              MIT                MIT License.
355
356              BSD-2-Clause       BSD 2-Clause "Simplified" License
357              BSD-3-Clause       BSD 3-Clause "New" or "Revised" License
358
359              GPL-3.0-only       GNU General Public License v3.0 only
360              GPL-3.0-or-later   GNU General Public License v3.0 or later
361
362              LGPL-3.0-only      GNU Lesser General Public License v3.0 only
363              LGPL-3.0-or-later  GNU Lesser General Public License v3.0 or later
364
365              AGPL-3.0-only      GNU Affero General Public License v3.0 only
366              AGPL-3.0-or-later  GNU Affero General Public License v3.0 or later
367
368              Apache-2.0         Apache License 2.0
369
370              MPL-2.0            Mozilla Public License 2.0
371
372              BSL-1.0            Boost Software License 1.0
373
374              Unlicense          The Unlicense (public domain)
375
376              other: public domain     Released into the public domain
377              other: available source  Not free/open source with public source code
378              other: proprietary       Not free/open source
379              other: TODO              License is not yet decided
380
381          no-readme
382              Don't add README.md.
383
384          alt-naming
385              Use the alternative build file/directory naming scheme.
386
387       The  project  version control system can be specified with the --vcs|-s
388       option. Valid values for this option and their semantics are  described
389       next. If unspecified, git is assumed by default.
390
391       git
392              Initialize  a  git(1) repository inside the project and generate
393              .gitignore files.
394
395       none
396              Don't initialize a version control system inside the project.
397
398       The created project, package, or source  subdirectory  can  be  further
399       customized  using  the  pre  and post-creation hooks specified with the
400       --pre-hook and --post-hook options, respectively.  The  pre  hooks  are
401       executed before any new files are created and the post hook – after all
402       the files have been created. The hook  commands  are  executed  in  the
403       project,  package,  or source directory as their current working direc‐
404       tory. For example:
405
406       $ bdep new --post-hook "echo .idea/ >>.gitignore" hello
407
408       The pre hooks are primarily useful for moving/renaming  existing  files
409       that  would  otherwise clash with files created by the new command. For
410       example:
411
412       $ bdep new --pre-hook  "mv .gitignore .gitignore.bak" \
413                  --post-hook "cat .gitignore.bak >>.gitignore" \
414                  --post-hook "rm .gitignore.bak" ...
415
416       See the --pre-hook and  --post-hook  options  documentation  below  for
417       details.
418

NEW OPTIONS

420       --no-init
421              Don't initialize an empty build configuration set.
422
423       --package
424              Create  a  new package inside an already existing project rather
425              than a new project.
426
427       --source
428              Create a new source  subdirectory  inside  an  already  existing
429              project or package rather than a new project.
430
431       --output-dir|-o dir
432              Create the project, package, or source subdirectory in the spec‐
433              ified directory.
434
435       --directory|-d dir
436              Assume the project/package is in the specified directory  rather
437              than  in the current working directory. Only used with --package
438              or --source.
439
440       --type|-t type[,opt...]
441              Specify project type and options. Valid values for type are  exe
442              (executable project, default), lib (library project), bare (bare
443              project without any source code), and empty (empty project ready
444              to  be filled with packages). Valid values for opt are type-spe‐
445              cific.
446
447       --lang|-l lang[,opt...]
448              Specify project language and options. Valid values for lang  are
449              c and c++ (default). Valid values for opt are language-specific.
450
451       --vcs|-s vcs[,opt...]
452              Specify project version control system and options. Valid values
453              for vcs are git (default) and none. Valid  values  for  opt  are
454              system-specific.
455
456       --pre-hook command
457
458
459       --post-hook command
460              Run  the  specified  command  before/after creating the project,
461              package, or source directory.
462
463              The command value  is  interpreted  as  a  whitespace-separated,
464              potentially  quoted  command  line  consisting of a program or a
465              portable builtin (testscript#builtins)  optionally  followed  by
466              arguments and redirects.  Specifically, a single level of quotes
467              (either single or double) is removed  and  whitespaces  are  not
468              treated  as  separators inside such quoted fragments.  Currently
469              only the stdout redirect to a file is supported. For example:
470
471              $ bdep new --post-hook "echo '.idea/ # IDE' >>.gitignore" hello
472
473              The command line elements (program, arguments, etc) may  option‐
474              ally  contain substitutions – variable names enclosed with the @
475              substitution symbol – which are replaced with the  corresponding
476              variable  values  to  produce  the actual command. The following
477              variable names are recognized with the double substitution  sym‐
478              bol (@@) serving as an escape sequence.
479
480              @mode@ - one of 'project', 'package', or 'source'
481              @name@ - project, package, or source subdirectory name
482              @base@ - name base (name without extension)
483              @stem@ - name stem (name base without 'lib' prefix)
484              @root@ - project/package root directory
485              @pfx@  - combined prefix relative to project/package root
486              @inc@  - split header prefix relative to project/package root
487              @src@  - split source prefix relative to project/package root
488              @sub@  - source subdirectory relative to header/source prefix
489              @type@ - type (--type|-t value: 'exe', 'lib', etc)
490              @lang@ - language (--lang|-l value: 'c', 'c++', etc)
491              @vcs@  - version control system (--vcs|-s value: 'git', etc)
492
493              Note  that  the  @inc@  and  @src@ variables are only set if the
494              header/source prefix is split with the combined  @pfx@  variable
495              set otherwise.
496
497              For example:
498
499              $ bdep new --post-hook "echo bin/ >>@name@/.gitignore" hello
500
501              These substitution variables are also made available to the hook
502              program as the BDEP_NEW_* environment variables  (BDEP_NEW_MODE,
503              BDEP_NEW_NAME, etc).
504
505       --no-amalgamation
506              Create a project with disabled amalgamation support. This option
507              is normally only used for testing.
508
509       --no-checks
510              Suppress nested project/package checks. This option is  normally
511              only used for testing.
512
513       --config-add|-A dir
514              Add an existing build configuration dir.
515
516       --config-create|-C dir
517              Create a new build configuration in dir.
518
519       --default
520              Make the added or created configuration the default.
521
522       --no-default
523              Don't make the first added or created configuration the default.
524
525       --forward
526              Make the added or created configuration forwarded.
527
528       --no-forward
529              Don't make the added or created configuration forwarded.
530
531       --auto-sync
532              Make  the  added or created configuration automatically synchro‐
533              nized.
534
535       --no-auto-sync
536              Don't make the added or created configuration automatically syn‐
537              chronized.
538
539       --existing|-e
540              Initialize  a bpkg configuration based on an existing build sys‐
541              tem configuration.
542
543       --wipe Wipe the configuration directory clean before creating  the  new
544              configuration.
545
546       --config-name|-n name
547              Specify the build configuration as a name.
548
549       --config-id num
550              Specify the build configuration as an id.
551

COMMON OPTIONS

553       The  common  options are summarized below with a more detailed descrip‐
554       tion available in bdep-common-options(1).
555
556       -v     Print essential underlying commands being executed.
557
558       -V     Print all underlying commands being executed.
559
560       --quiet|-q
561              Run quietly, only printing error messages.
562
563       --verbose level
564              Set the diagnostics verbosity to level between 0 and 6.
565
566       --jobs|-j num
567              Number of jobs to perform in parallel.
568
569       --no-progress
570              Suppress progress indicators for long-lasting  operations,  such
571              as network transfers, building, etc.
572
573       --bpkg path
574              The  package  manager program to be used for build configuration
575              management.
576
577       --bpkg-option opt
578              Additional option to be passed to the package manager program.
579
580       --build path
581              The build program to be used to build packages.
582
583       --build-option opt
584              Additional option to be passed to the build program.
585
586       --curl path
587              The curl program to be used for network operations.
588
589       --curl-option opt
590              Additional option to be passed to the curl program.
591
592       --pager path
593              The pager program to be used to show long text.
594
595       --pager-option opt
596              Additional option to be passed to the pager program.
597
598       --options-file file
599              Read additional options from file.
600
601       --default-options dir
602              The directory to load additional default options files from.
603
604       --no-default-options
605              Don't load default options files.
606

SOURCE LAYOUT

608       C and C++ projects employ a bewildering variety of source code  layouts
609       most  of  which  fit  into  two  broad classes: combined, where all the
610       source code for a single executable or  library  resides  in  the  same
611       directory  and  split,  where  headers  (typically  public headers of a
612       library) and other source files reside in  separate  directories  (most
613       commonly called include/ and src/).
614
615       To support the creation of such varying layouts the new command divides
616       paths leading to source code inside a package/project into a number  of
617       customizable components:
618
619       libhello/{include,src}/hello/
620           ^         ^          ^
621           |         |          |
622        project/   source    source
623        package    prefix  subdirectory
624         root
625
626       Note  that  while the same physical layout can be achieved with various
627       combinations of source prefix and subdirectory, there will  be  differ‐
628       ences  in  semantics since the headers in the project are included with
629       the source subdirectory (if any) as a  prefix.  See  Canonical  Project
630       Structure (intro#proj-struct) for rationale and details.
631
632       As we have already seen, the source subdirectory can be customized with
633       the subdir project type sub-option. For example:
634
635       # libhello/hello/
636
637       $ bdep new -l c++ -t lib,subdir=hello libhello
638
639       $ tree libhello/
640       libhello/
641       └── hello/
642           ├── hello.hxx
643           └── hello.cxx
644
645       Note: pass -l c++,cpp if you prefer the .hpp/.cpp  source  file  naming
646       scheme.
647
648       The  source  prefix can be combined, in which case it can be customized
649       with the single prefix project type sub-option. For example:
650
651       # hello/src/hello/
652
653       $ bdep new -l c++ -t exe,prefix=src hello
654
655       $ tree hello/
656       hello/
657       └── src/
658           └── hello/
659               └── hello.cxx
660
661       The prefix can also be split, in which case the prefix-include and pre‐
662       fix-source sub-options can be used to customize the respective directo‐
663       ries independently. If either is omitted, then the corresponding prefix
664       is left empty. For example:
665
666       # libhello/{include,.}/libhello/
667
668       $ bdep new -l c++ -t lib,prefix-include=include libhello
669
670       $ tree libhello/
671       libhello/
672       ├── include/
673       │   └── libhello/
674       │       └── hello.hxx
675       └── libhello/
676           └── hello.cxx
677
678       The  split sub-option is a convenient shortcut for the most common case
679       where the header prefix is include/ and source  prefix  is  src/.   For
680       example:
681
682       # libhello/{include,src}/libhello/
683
684       $ bdep new -l c++ -t lib,split libhello
685
686       $ tree libhello/
687       libhello/
688       ├── include/
689       │   └── libhello/
690       │       └── hello.hxx
691       └── src/
692           └── libhello/
693               └── hello.cxx
694
695       The  source  subdirectory  can  be  omitted by specifying the no-subdir
696       project type sub-option. For example:
697
698       # hello/src/
699
700       $ bdep new -l c++ -t exe,prefix=src,no-subdir hello
701
702       $ tree hello/
703       hello/
704       └── src/
705           └── hello.cxx
706
707       The same but for the split layout (we also have to disable  the  gener‐
708       ated version header that is not supported in this layout):
709
710       # libhello/{include,src}/
711
712       $ bdep new -l c++ -t lib,split,no-subdir,no-version libhello
713
714       $ tree libhello/
715       libhello/
716       ├── include/
717       │   └── hello.hxx
718       └── src/
719           └── hello.cxx
720
721       To  achieve the layout where all the source code resides in the project
722       root, we omit both the source prefix and subdirectory (we also have  to
723       disable  a couple of other features that are not supported in this lay‐
724       out):
725
726       # hello/
727
728       $ bdep new -l c++ -t lib,no-subdir,no-version,no-tests libhello
729
730       $ tree libhello/
731       libhello/
732       ├── hello.cxx
733       └── hello.hxx
734
735       We can also omit the source subdirectory but only in the source  prefix
736       of  the split layout by specifying the no-subdir-source sub-option. For
737       example:
738
739       # libhello/{include/hello,src}/
740
741       $ bdep new -l c++ -t lib,split,subdir=hello,no-subdir-source libhello
742
743       $ tree libhello/
744       libhello/
745       ├── include/
746       │   └── hello/
747       │       └── hello.hxx
748       └── src/
749           └── hello.cxx
750
751       To achieve the split layout where  the  include/  directory  is  inside
752       src/:
753
754       # libhello/src/{include,.}/hello/
755
756       $ bdep new                                                         \
757         -l c++                                                           \
758         -t lib,prefix-include=src/include,prefix-source=src,subdir=hello \
759         libhello
760
761       $ tree libhello/
762       libhello/
763       └── src/
764           ├── include/
765           │   └── hello/
766           │       └── hello.hxx
767           └── hello/
768               └── hello.cxx
769
770       A similar layout but without the source subdirectory in src/:
771
772       # libhello/src/{include/hello,.}/
773
774       $ bdep new                                                         \
775         -l c++                                                           \
776         -t lib,prefix-include=src/include,prefix-source=src,\
777       subdir=hello,no-subdir-source                                      \
778         libhello
779
780       $ tree libhello/
781       libhello/
782       └── src/
783           ├── include/
784           │   └── hello/
785           │       └── hello.hxx
786           └── hello.cxx
787
788       The layout used by the Boost libraries:
789
790       # libhello/{include/hello,libs/hello/src}/
791
792       $ bdep new                                                         \
793         -l c++                                                           \
794         -t lib,prefix-include=include,prefix-source=libs/hello/src,\
795       subdir=hello,no-subdir-source                                      \
796         libhello
797
798       $ tree libhello/
799       libhello/
800       ├── include/
801       │   └── hello/
802       │       └── hello.hxx
803       └── libs/
804           └── hello/
805               └── src/
806                   └── hello.cxx
807
808       A  layout  where  multiple  components  each have their own include/src
809       split:
810
811       # hello/libhello1/{include/hello1,src}/
812       # hello/libhello2/{include/hello2,src}/
813
814       $ bdep new -l c++ -t bare hello
815
816       $ bdep new -d hello --source                                       \
817         -l c++                                                           \
818         -t lib,\
819       prefix-include=libhello1/include,prefix-source=libhello1/src,\
820       subdir=hello1,no-subdir-source                                     \
821         libhello1
822
823       $ bdep new -d hello --source                                       \
824         -l c++                                                           \
825         -t lib,\
826       prefix-include=libhello2/include,prefix-source=libhello2/src,\
827       subdir=hello2,no-subdir-source                                     \
828         libhello2
829
830       $ tree hello/
831       hello/
832       ├── libhello1/
833       │   ├── include/
834       │   │   └── hello1/
835       │   │       └── hello1.hxx
836       │   └── src/
837       │       └── hello1.cxx
838       └── libhello2/
839           ├── include/
840           │   └── hello2/
841           │       └── hello2.hxx
842           └── src/
843               └── hello2.cxx
844
845       A layout where libraries and executables have different prefixes:
846
847       # hello/libs/libhello/{include/hello,src}/
848       # hello/src/hello/
849
850       $ bdep new -l c++ -t bare hello
851
852       $ bdep new -d hello --source                                       \
853         -l c++                                                           \
854         -t lib,\
855       prefix-include=libs/libhello/include,prefix-source=libs/libhello/src,\
856       subdir=hello,no-subdir-source                                      \
857         libhello
858
859       $ bdep new -d hello --source -l c++ -t exe,prefix=src hello
860
861       $ tree hello/
862       hello/
863       ├── libs/
864       │   └── libhello/
865       │       ├── include/
866       │       │   └── hello/
867       │       │       └── hello.hxx
868       │       └── src/
869       │           └── hello.cxx
870       └── src/
871           └── hello/
872               └── hello.cxx
873

DEFAULT OPTIONS FILES

875       See  bdep-default-options-files(1)  for  an  overview  of  the  default
876       options  files.  For  the new command the search start directory is the
877       project directory in the package and source modes and the parent direc‐
878       tory of the new project in all other modes. The following options files
879       are searched for in each directory and, if found, loaded in  the  order
880       listed:
881
882       bdep.options
883       bdep-{config config-add}.options                # if --config-add|-A
884       bdep-{config config-add config-create}.options  # if --config-create|-C
885       bdep-new.options
886       bdep-new-{project|package|source}.options # (mode-dependent)
887
888       The  following  new  command options cannot be specified in the default
889       options files:
890
891       --output-dir|-o
892       --directory|-d
893       --package
894       --source
895       --no-checks
896       --config-add|-A
897       --config-create|-C
898       --wipe
899
900       While the presence of the --pre-hook or --post-hook options  in  remote
901       default options files will trigger a prompt.
902

ENVIRONMENT

904       The  BDEP_AUTHOR_EMAIL  environment variable can be used to specify the
905       package email address. If not set, the new command will  first  try  to
906       obtain  the  email  from  the version control system (if used) and then
907       from the EMAIL environment variable. If all these methods fail, a dummy
908       you@example.org email is used.
909

BUGS

911       Send bug reports to the users@build2.org mailing list.
912
914       Copyright (c) 2014-2020 the build2 authors.
915
916       Permission  is  granted to copy, distribute and/or modify this document
917       under the terms of the MIT License.
918
919
920
921bdep 0.13.0                        July 2020                       bdep-new(1)
Impressum