1bdep-new(1) General Commands Manual bdep-new(1)
2
3
4
6 bdep-new - create and initialize new project
7
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
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 as‐
56 sumed. 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 di‐
89 rectory 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 un‐
182 specified, a C++ project is created by default.
183
184 c
185 A C project. Recognized language sub-options:
186
187 c++
188 A C project that can also use C++. If specified, then the hxx,
189 cxx, ixx, txx, and mxx c++ language sub-options can also be
190 specified.
191
192 c++
193 A C++ project. Recognized language sub-options:
194
195 cpp
196 Use the .cpp, .hpp, .ipp, .tpp, and .mpp source file extensions
197 (alias for extension=?pp).
198
199 extension=pattern
200 Derive source file extensions from pattern by replacing every ?
201 with one of the c (source), h (header), i (inline), t (tem‐
202 plate), or m (module interface) letters. If unspecified and no
203 individual extensions are specified with the below options, then
204 ?xx is used by default.
205
206 hxx=extension
207 Use the specified extension for header files instead of the de‐
208 fault .hxx.
209
210 cxx=extension
211 Use the specified extension for source files instead of the de‐
212 fault .cxx.
213
214 ixx=extension
215 Use the specified extension for inline files. If unspecified,
216 then assume no inline files are used by the project.
217
218 txx=extension
219 Use the specified extension for template files. If unspecified,
220 then assume no template files are used by the project.
221
222 mxx=extension
223 Use the specified extension for module interface files. If un‐
224 specified, then assume no modules are used by the project.
225
226 c
227 A C++ project that can also use C.
228
229 As an example, the following command creates a header-only C++ library
230 that uses the .h extension for header files and .cpp – for source
231 files:
232
233 $ bdep new -l c++,hxx=h,cxx=cpp -t lib,binless libhello
234
235 The project type can be specified with the --type|-t option. The empty
236 project type is language-agnostic with the semantics and valid sub-op‐
237 tions for the rest being language-dependent, as described next. If un‐
238 specified, an executable project is created by default.
239
240 exe
241 A project that builds a sample C or C++ executable. Recognized
242 executable project sub-options:
243
244 no-tests
245 Don't add support for functional/integration testing.
246
247 unit-tests
248 Add support for unit testing.
249
250 no-install
251 Don't add support for installing.
252
253 prefix=dir
254 Optional source prefix relative to project/package root.
255
256 subdir=dir
257 Alternative source subdirectory relative to source prefix.
258
259 no-subdir
260 Omit the source subdirectory.
261
262 license=name
263
264
265 no-readme
266
267
268 alt-naming
269 See common sub-options below.
270
271 lib
272 A project that builds a sample C or C++ library. Recognized li‐
273 brary project sub-options:
274
275 binless
276 Create a header-only library.
277
278 no-tests
279 Don't add support for functional/integration testing.
280
281 unit-tests
282 Add support for unit testing.
283
284 no-install
285 Don't add support for installing.
286
287 no-version
288 Don't add support for generating the version header.
289
290 prefix-include=dir
291 Optional public header prefix relative to project/package root.
292
293 prefix-source=dir
294 Optional source prefix relative to project/package root.
295
296 prefix=dir
297 Shortcut for prefix-include=dir,prefix-source=dir.
298
299 split
300 Shortcut for prefix-include=include,prefix-source=src.
301
302 subdir=dir
303 Alternative source subdirectory relative to header/source pre‐
304 fix.
305
306 no-subdir
307 Omit the source subdirectory.
308
309 no-subdir-source
310 Omit the source subdirectory relative to the source prefix but
311 still create it relative to the header prefix.
312
313 license=name
314
315
316 no-readme
317
318
319 alt-naming
320 See common sub-options below.
321
322 bare
323 A project without any source code that can be filled later (see
324 --source). Recognized bare project sub-options:
325
326 no-tests
327 Don't add support for testing.
328
329 no-install
330 Don't add support for installing.
331
332 license=name
333
334
335 no-readme
336
337
338 alt-naming
339 See common sub-options below.
340
341 empty
342 An empty project that can be filled with packages (see --pack‐
343 age). Recognized empty project sub-options:
344
345 no-readme
346 See common sub-options below.
347
348 common
349 Common project type sub-options:
350
351 license=name
352 Specify the project's license. The license name can be an SPDX
353 License Expression (https://spdx.org/licenses/), which, in its
354 simplest form, is just the license ID. Or it can be a free form
355 name in the other: license name scheme. If unspecified, then
356 other: proprietary is assumed. The following tables lists the
357 most commonly used free/open source software license IDs as well
358 as a number of pre-defined other: names. See the license (#mani‐
359 fest-package-license) package manifest value for more informa‐
360 tion.
361
362 MIT MIT License.
363
364 BSD-2-Clause BSD 2-Clause "Simplified" License
365 BSD-3-Clause BSD 3-Clause "New" or "Revised" License
366
367 GPL-3.0-only GNU General Public License v3.0 only
368 GPL-3.0-or-later GNU General Public License v3.0 or later
369
370 LGPL-3.0-only GNU Lesser General Public License v3.0 only
371 LGPL-3.0-or-later GNU Lesser General Public License v3.0 or later
372
373 AGPL-3.0-only GNU Affero General Public License v3.0 only
374 AGPL-3.0-or-later GNU Affero General Public License v3.0 or later
375
376 Apache-2.0 Apache License 2.0
377
378 MPL-2.0 Mozilla Public License 2.0
379
380 BSL-1.0 Boost Software License 1.0
381
382 Unlicense The Unlicense (public domain)
383
384 other: public domain Released into the public domain
385 other: available source Not free/open source with public source code
386 other: proprietary Not free/open source
387 other: TODO License is not yet decided
388
389 no-readme
390 Don't add README.md.
391
392 alt-naming
393 Use the alternative build file/directory naming scheme.
394
395 The project version control system can be specified with the --vcs|-s
396 option. Valid values for this option and their semantics are described
397 next. If unspecified, git is assumed by default.
398
399 git
400 Initialize a git(1) repository inside the project and generate
401 .gitignore files.
402
403 none
404 Don't initialize a version control system inside the project.
405
406 The created project, package, or source subdirectory can be further
407 customized using the pre and post-creation hooks specified with the
408 --pre-hook and --post-hook options, respectively. The pre hooks are ex‐
409 ecuted before any new files are created and the post hook – after all
410 the files have been created. The hook commands are executed in the
411 project, package, or source directory as their current working direc‐
412 tory. For example:
413
414 $ bdep new --post-hook "echo .idea/ >>.gitignore" hello
415
416 The pre hooks are primarily useful for moving/renaming existing files
417 that would otherwise clash with files created by the new command. For
418 example:
419
420 $ bdep new --pre-hook "mv .gitignore .gitignore.bak" \
421 --post-hook "cat .gitignore.bak >>.gitignore" \
422 --post-hook "rm .gitignore.bak" ...
423
424 See the --pre-hook and --post-hook options documentation below for de‐
425 tails.
426
428 --no-init
429 Don't initialize an empty build configuration set.
430
431 --package
432 Create a new package inside an already existing project rather
433 than a new project.
434
435 --source
436 Create a new source subdirectory inside an already existing
437 project or package rather than a new project.
438
439 --output-dir|-o dir
440 Create the project, package, or source subdirectory in the spec‐
441 ified directory.
442
443 --directory|-d dir
444 Assume the project/package is in the specified directory rather
445 than in the current working directory. Only used with --package
446 or --source.
447
448 --type|-t type[,opt...]
449 Specify project type and options. Valid values for type are exe
450 (executable project, default), lib (library project), bare (bare
451 project without any source code), and empty (empty project ready
452 to be filled with packages). Valid values for opt are type-spe‐
453 cific.
454
455 --lang|-l lang[,opt...]
456 Specify project language and options. Valid values for lang are
457 c and c++ (default). Valid values for opt are language-specific.
458
459 --vcs|-s vcs[,opt...]
460 Specify project version control system and options. Valid values
461 for vcs are git (default) and none. Valid values for opt are
462 system-specific.
463
464 --pre-hook command
465
466
467 --post-hook command
468 Run the specified command before/after creating the project,
469 package, or source directory.
470
471 The command value is interpreted as a whitespace-separated, po‐
472 tentially quoted command line consisting of a program or a por‐
473 table builtin (testscript#builtins) optionally followed by argu‐
474 ments and redirects. Specifically, a single level of quotes
475 (either single or double) is removed and whitespaces are not
476 treated as separators inside such quoted fragments. Currently
477 only the stdout redirect to a file is supported. For example:
478
479 $ bdep new --post-hook "echo '.idea/ # IDE' >>.gitignore" hello
480
481 The command line elements (program, arguments, etc) may option‐
482 ally contain substitutions – variable names enclosed with the @
483 substitution symbol – which are replaced with the corresponding
484 variable values to produce the actual command. The following
485 variable names are recognized with the double substitution sym‐
486 bol (@@) serving as an escape sequence.
487
488 @mode@ - one of 'project', 'package', or 'source'
489 @name@ - project, package, or source subdirectory name
490 @base@ - name base (name without extension)
491 @stem@ - name stem (name base without 'lib' prefix)
492 @root@ - project/package root directory
493 @pfx@ - combined prefix relative to project/package root
494 @inc@ - split header prefix relative to project/package root
495 @src@ - split source prefix relative to project/package root
496 @sub@ - source subdirectory relative to header/source prefix
497 @type@ - type (--type|-t value: 'exe', 'lib', etc)
498 @lang@ - language (--lang|-l value: 'c', 'c++', etc)
499 @vcs@ - version control system (--vcs|-s value: 'git', etc)
500
501 Note that the @inc@ and @src@ variables are only set if the
502 header/source prefix is split with the combined @pfx@ variable
503 set otherwise.
504
505 For example:
506
507 $ bdep new --post-hook "echo bin/ >>@name@/.gitignore" hello
508
509 These substitution variables are also made available to the hook
510 program as the BDEP_NEW_* environment variables (BDEP_NEW_MODE,
511 BDEP_NEW_NAME, etc).
512
513 --no-amalgamation
514 Create a project with disabled amalgamation support. This option
515 is normally only used for testing.
516
517 --no-checks
518 Suppress nested project/package checks. This option is normally
519 only used for testing.
520
521 --config-add|-A dir
522 Add an existing build configuration dir.
523
524 --config-create|-C dir
525 Create a new build configuration in dir.
526
527 --type|--config-type typ
528 The type of the configuration being created. By default, config‐
529 uration of type target is created. See bpkg-cfg-create(1) for
530 background on configuration types.
531
532 --default
533 Make the added or created configuration the default.
534
535 --no-default
536 Don't make the first added or created configuration the default.
537
538 --forward
539 Make the added or created configuration forwarded.
540
541 --no-forward
542 Don't make the added or created configuration forwarded.
543
544 --auto-sync
545 Make the added or created configuration automatically synchro‐
546 nized.
547
548 --no-auto-sync
549 Don't make the added or created configuration automatically syn‐
550 chronized.
551
552 --existing|-e
553 Initialize a bpkg configuration based on an existing build sys‐
554 tem configuration.
555
556 --wipe Wipe the configuration directory clean before creating the new
557 configuration.
558
559 --config-name|-n name
560 Specify the build configuration as a name.
561
562 --config-id num
563 Specify the build configuration as an id.
564
566 The common options are summarized below with a more detailed descrip‐
567 tion available in bdep-common-options(1).
568
569 -v Print essential underlying commands being executed.
570
571 -V Print all underlying commands being executed.
572
573 --quiet|-q
574 Run quietly, only printing error messages.
575
576 --verbose level
577 Set the diagnostics verbosity to level between 0 and 6.
578
579 --jobs|-j num
580 Number of jobs to perform in parallel.
581
582 --no-progress
583 Suppress progress indicators for long-lasting operations, such
584 as network transfers, building, etc.
585
586 --bpkg path
587 The package manager program to be used for build configuration
588 management.
589
590 --bpkg-option opt
591 Additional option to be passed to the package manager program.
592
593 --build path
594 The build program to be used to build packages.
595
596 --build-option opt
597 Additional option to be passed to the build program.
598
599 --curl path
600 The curl program to be used for network operations.
601
602 --curl-option opt
603 Additional option to be passed to the curl program.
604
605 --pager path
606 The pager program to be used to show long text.
607
608 --pager-option opt
609 Additional option to be passed to the pager program.
610
611 --options-file file
612 Read additional options from file.
613
614 --default-options dir
615 The directory to load additional default options files from.
616
617 --no-default-options
618 Don't load default options files.
619
621 C and C++ projects employ a bewildering variety of source code layouts
622 most of which fit into two broad classes: combined, where all the
623 source code for a single executable or library resides in the same di‐
624 rectory and split, where headers (typically public headers of a li‐
625 brary) and other source files reside in separate directories (most com‐
626 monly called include/ and src/).
627
628 To support the creation of such varying layouts the new command divides
629 paths leading to source code inside a package/project into a number of
630 customizable components:
631
632 libhello/{include,src}/hello/
633 ^ ^ ^
634 | | |
635 project/ source source
636 package prefix subdirectory
637 root
638
639 Note that while the same physical layout can be achieved with various
640 combinations of source prefix and subdirectory, there will be differ‐
641 ences in semantics since the headers in the project are included with
642 the source subdirectory (if any) as a prefix. See Canonical Project
643 Structure (intro#proj-struct) for rationale and details.
644
645 As we have already seen, the source subdirectory can be customized with
646 the subdir project type sub-option. For example:
647
648 # libhello/hello/
649
650 $ bdep new -l c++ -t lib,subdir=hello libhello
651
652 $ tree libhello/
653 libhello/
654 └── hello/
655 ├── hello.hxx
656 └── hello.cxx
657
658 Note: pass -l c++,cpp if you prefer the .hpp/.cpp source file naming
659 scheme.
660
661 The source prefix can be combined, in which case it can be customized
662 with the single prefix project type sub-option. For example:
663
664 # hello/src/hello/
665
666 $ bdep new -l c++ -t exe,prefix=src hello
667
668 $ tree hello/
669 hello/
670 └── src/
671 └── hello/
672 └── hello.cxx
673
674 The prefix can also be split, in which case the prefix-include and pre‐
675 fix-source sub-options can be used to customize the respective directo‐
676 ries independently. If either is omitted, then the corresponding prefix
677 is left empty. For example:
678
679 # libhello/{include,.}/libhello/
680
681 $ bdep new -l c++ -t lib,prefix-include=include libhello
682
683 $ tree libhello/
684 libhello/
685 ├── include/
686 │ └── libhello/
687 │ └── hello.hxx
688 └── libhello/
689 └── hello.cxx
690
691 The split sub-option is a convenient shortcut for the most common case
692 where the header prefix is include/ and source prefix is src/. For ex‐
693 ample:
694
695 # libhello/{include,src}/libhello/
696
697 $ bdep new -l c++ -t lib,split libhello
698
699 $ tree libhello/
700 libhello/
701 ├── include/
702 │ └── libhello/
703 │ └── hello.hxx
704 └── src/
705 └── libhello/
706 └── hello.cxx
707
708 The source subdirectory can be omitted by specifying the no-subdir
709 project type sub-option. For example:
710
711 # hello/src/
712
713 $ bdep new -l c++ -t exe,prefix=src,no-subdir hello
714
715 $ tree hello/
716 hello/
717 └── src/
718 └── hello.cxx
719
720 The same but for the split layout (we also have to disable the gener‐
721 ated version header that is not supported in this layout):
722
723 # libhello/{include,src}/
724
725 $ bdep new -l c++ -t lib,split,no-subdir,no-version libhello
726
727 $ tree libhello/
728 libhello/
729 ├── include/
730 │ └── hello.hxx
731 └── src/
732 └── hello.cxx
733
734 To achieve the layout where all the source code resides in the project
735 root, we omit both the source prefix and subdirectory (we also have to
736 disable a couple of other features that are not supported in this lay‐
737 out):
738
739 # hello/
740
741 $ bdep new -l c++ -t lib,no-subdir,no-version,no-tests libhello
742
743 $ tree libhello/
744 libhello/
745 ├── hello.cxx
746 └── hello.hxx
747
748 We can also omit the source subdirectory but only in the source prefix
749 of the split layout by specifying the no-subdir-source sub-option. For
750 example:
751
752 # libhello/{include/hello,src}/
753
754 $ bdep new -l c++ -t lib,split,subdir=hello,no-subdir-source libhello
755
756 $ tree libhello/
757 libhello/
758 ├── include/
759 │ └── hello/
760 │ └── hello.hxx
761 └── src/
762 └── hello.cxx
763
764 To achieve the split layout where the include/ directory is inside
765 src/:
766
767 # libhello/src/{include,.}/hello/
768
769 $ bdep new \
770 -l c++ \
771 -t lib,prefix-include=src/include,prefix-source=src,subdir=hello \
772 libhello
773
774 $ tree libhello/
775 libhello/
776 └── src/
777 ├── include/
778 │ └── hello/
779 │ └── hello.hxx
780 └── hello/
781 └── hello.cxx
782
783 A similar layout but without the source subdirectory in src/:
784
785 # libhello/src/{include/hello,.}/
786
787 $ bdep new \
788 -l c++ \
789 -t lib,prefix-include=src/include,prefix-source=src,\
790 subdir=hello,no-subdir-source \
791 libhello
792
793 $ tree libhello/
794 libhello/
795 └── src/
796 ├── include/
797 │ └── hello/
798 │ └── hello.hxx
799 └── hello.cxx
800
801 The layout used by the Boost libraries:
802
803 # libhello/{include/hello,libs/hello/src}/
804
805 $ bdep new \
806 -l c++ \
807 -t lib,prefix-include=include,prefix-source=libs/hello/src,\
808 subdir=hello,no-subdir-source \
809 libhello
810
811 $ tree libhello/
812 libhello/
813 ├── include/
814 │ └── hello/
815 │ └── hello.hxx
816 └── libs/
817 └── hello/
818 └── src/
819 └── hello.cxx
820
821 A layout where multiple components each have their own include/src
822 split:
823
824 # hello/libhello1/{include/hello1,src}/
825 # hello/libhello2/{include/hello2,src}/
826
827 $ bdep new -l c++ -t bare hello
828
829 $ bdep new -d hello --source \
830 -l c++ \
831 -t lib,\
832 prefix-include=libhello1/include,prefix-source=libhello1/src,\
833 subdir=hello1,no-subdir-source \
834 libhello1
835
836 $ bdep new -d hello --source \
837 -l c++ \
838 -t lib,\
839 prefix-include=libhello2/include,prefix-source=libhello2/src,\
840 subdir=hello2,no-subdir-source \
841 libhello2
842
843 $ tree hello/
844 hello/
845 ├── libhello1/
846 │ ├── include/
847 │ │ └── hello1/
848 │ │ └── hello1.hxx
849 │ └── src/
850 │ └── hello1.cxx
851 └── libhello2/
852 ├── include/
853 │ └── hello2/
854 │ └── hello2.hxx
855 └── src/
856 └── hello2.cxx
857
858 A layout where libraries and executables have different prefixes:
859
860 # hello/libs/libhello/{include/hello,src}/
861 # hello/src/hello/
862
863 $ bdep new -l c++ -t bare hello
864
865 $ bdep new -d hello --source \
866 -l c++ \
867 -t lib,\
868 prefix-include=libs/libhello/include,prefix-source=libs/libhello/src,\
869 subdir=hello,no-subdir-source \
870 libhello
871
872 $ bdep new -d hello --source -l c++ -t exe,prefix=src hello
873
874 $ tree hello/
875 hello/
876 ├── libs/
877 │ └── libhello/
878 │ ├── include/
879 │ │ └── hello/
880 │ │ └── hello.hxx
881 │ └── src/
882 │ └── hello.cxx
883 └── src/
884 └── hello/
885 └── hello.cxx
886
888 See bdep-default-options-files(1) for an overview of the default op‐
889 tions files. For the new command the search start directory is the
890 project directory in the package and source modes and the parent direc‐
891 tory of the new project in all other modes. The following options files
892 are searched for in each directory and, if found, loaded in the order
893 listed:
894
895 bdep.options
896 bdep-{config config-add}.options # if --config-add|-A
897 bdep-{config config-add config-create}.options # if --config-create|-C
898 bdep-new.options
899 bdep-new-{project|package|source}.options # (mode-dependent)
900
901 The following new command options cannot be specified in the default
902 options files:
903
904 --output-dir|-o
905 --directory|-d
906 --package
907 --source
908 --no-checks
909 --config-add|-A
910 --config-create|-C
911 --wipe
912
913 While the presence of the --pre-hook or --post-hook options in remote
914 default options files will trigger a prompt.
915
917 The BDEP_AUTHOR_EMAIL environment variable can be used to specify the
918 package email address. If not set, the new command will first try to
919 obtain the email from the version control system (if used) and then
920 from the EMAIL environment variable. If all these methods fail, a dummy
921 you@example.org email is used.
922
924 Send bug reports to the users@build2.org mailing list.
925
927 Copyright (c) 2014-2021 the build2 authors.
928
929 Permission is granted to copy, distribute and/or modify this document
930 under the terms of the MIT License.
931
932
933
934bdep 0.14.0 October 2021 bdep-new(1)