Skip to content

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 and lib directory
    • Library unittests can be placed with library source code or in tests
    • lib can be omitted for header-only libraries
  • The default executable file is src/main.cpp.
    • Other executables can be placed in src/bin/.
  • Benchmarks go in the benches directory.
  • Examples go in the examples directory.
  • Unittests go in the tests directory.
Clone this wiki locally