-
Notifications
You must be signed in to change notification settings - Fork 6
Package Layout
Wu edited this page May 6, 2023
·
1 revision
Like Cargo, cppship uses conventions for file placement to make it easy to dive into a new cppship package.
.
├── cppship.toml
├── include/
│ └── some_lib
│ └── lib.h
├── lib/
│ ├── libfile1.cpp
│ ├── libfile1_test.cpp
│ ├── libfile2.cpp
│ └── libfile2_test.cpp
├── src/
│ ├── main.cpp
| ├── other_cpp_for_main1.cpp
| ├── other_cpp_for_main2.cpp
│ └── bin/
│ ├── named-executable.cpp
│ └── another-executable.cpp
├── benches/
│ ├── bench1.cpp
│ └── bench2.cpp
├── examples/
│ ├── example1.cpp
│ └── example2.cpp
└── tests/
├── test1.cpp
└── sub_dir/
├── test2.cpp
└── test3.cpp
-
cppship.toml
are stored in the root of your package (package root). - Binary source code goes in the
src
directory. - Library source code goes in the
include
andlib
directory- Library unittests can be placed with library source code or in
tests
-
lib
can be omitted for header-only libraries
- Library unittests can be placed with library source code or in
- The default executable file is
src/main.cpp
.- Other executables can be placed in
src/bin/
.
- Other executables can be placed in
- Benchmarks go in the
benches
directory. - Examples go in the
examples
directory. - Unittests go in the
tests
directory.