aboutsummaryrefslogtreecommitdiff
path: root/bdep/new.cli
diff options
context:
space:
mode:
Diffstat (limited to 'bdep/new.cli')
-rw-r--r--bdep/new.cli66
1 files changed, 65 insertions, 1 deletions
diff --git a/bdep/new.cli b/bdep/new.cli
index 9e4b3e3..fa003c2 100644
--- a/bdep/new.cli
+++ b/bdep/new.cli
@@ -165,7 +165,7 @@ namespace bdep
libraries) as well as sources. This can be customized in a number of ways
using the \cb{prefix*} and \cb{split} project type sub-options (see below
for details). For example, to move the source subdirectory inside
- \c{src/}:
+ \cb{src/}:
\
$ bdep new -l c++ -t exe,prefix=src hello
@@ -328,6 +328,11 @@ namespace bdep
Omit the source subdirectory.|
+ \li|\n\ \ \ \cb{buildfile-in-prefix}
+
+ Create the \cb{buildfile} in the source prefix directory rather than
+ in its source subdirectory.|
+
\li|\n\ \ \ \c{\b{license=}\i{name}}|
\li|\ \ \ \cb{no-readme}|
@@ -403,6 +408,11 @@ namespace bdep
Shortcut for \cb{no-subdir-include,no-subdir-source}.|
+ \li|\n\ \ \ \cb{buildfile-in-prefix}
+
+ Create the \cb{buildfiles} in the header/source prefix directories
+ rather than in their source subdirectories.|
+
\li|\n\ \ \ \c{\b{license=}\i{name}}|
\li|\ \ \ \cb{no-readme}|
@@ -596,6 +606,7 @@ namespace bdep
dir_path prefix;
dir_path subdir;
bool no-subdir;
+ bool buildfile-in-prefix;
string license = "other: proprietary";
bool no-readme;
bool alt-naming;
@@ -624,6 +635,7 @@ namespace bdep
bool no-subdir-include;
bool no-subdir-source;
bool no-subdir;
+ bool buildfile-in-prefix;
string license = "other: proprietary";
bool no-readme;
bool alt-naming;
@@ -1136,6 +1148,58 @@ namespace bdep
└── hello.cxx
\
+ When packaging a third-party project for \cb{build2}, one of the common
+ approaches is to create a project with the split layout and the
+ \cb{buildfiles} in the source prefix directories rather than in the source
+ subdirectories:
+
+ \
+ # hello/libhello/{include,src}/hello/
+ # hello/libhello/{include,src}/buildfile
+
+ $ bdep new -l c -t empty hello
+
+ $ bdep new -d hello --package \
+ -l c \
+ -t lib, \
+ split,subdir=hello,no-version,no-symexport,buildfile-in-prefix \
+ libhello
+
+ $ tree hello/
+ hello/
+ └── libhello/
+ ├── include/
+ │   ├── buildfile
+ │   └── hello/
+ │   └── hello.h
+ └── src/
+ ├── buildfile
+ └── hello/
+ └── hello.c
+ \
+
+ After that the upstream project is added as a \cb{git} submodule to the
+ project root directory and the source subdirectories are replaced with the
+ symbolic links to the directories inside the upstream project directory:
+
+ \
+ $ tree hello/
+ hello/
+ ├── libhello/
+ │ ├── include/
+ │ │   ├── buildfile
+ │ │   └── hello/ -> ../../upstream/include/hello/
+ │ └── src/
+ │ ├── buildfile
+ │ └── hello/ -> ../../upstream/src/
+ └── upstream/
+ ├── include/
+ │   └── hello/
+ │   └── hello.h
+ └── src/
+ └── hello.c
+ \
+
\h|DEFAULT OPTIONS FILES|
See \l{bdep-default-options-files(1)} for an overview of the default