- Notifications
You must be signed in to change notification settings - Fork0
akiscode/cpp_cmake_template
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A repository that serves as a template for C++ projects that want to use modern CMake
Contact:dev@akiscode.com
A sample repository that serves as a starting point for C++ projects. It contains a sample application ("app1") and a sample library ("lib1") that both have initial benchmark and testing fixtures setup.
This also comes with a.gitignore file that ignores if the user creates abuild directory in the root folder for CMake usage.
Clone this repository, change into the directory and issue:
mkdir buildcd buildcmake ..makeYou can also issuemake test andmake package to run tests or package up the project respectively.
| Directory | Description |
|---|---|
app1 | Root folder of sample app |
cmake | Location of "extra" cmake files |
docs | Folder for any documentation |
lib1 | Root folder of sample library |
scripts | Folder for any scripts |
Inside the sample app and library is the same directory structure:
├── CMakeLists.txt├── include│ └── app1│ └── common.hpp├── src│ ├── common.cpp│ └── main.cpp└── test ├── bench │ ├── CMakeLists.txt │ └── sample_bench.cpp ├── CMakeLists.txt └── unit ├── CMakeLists.txt ├── main.cpp └── sample_test.cppHeaders are located under theinclude/(app1|lib1) folder with corresponding source files undersrc.
There must always be a pair of source and header files with the exception of main.cpp
This is because the CMakeLists in the root of the app adds in source files only (which pulls in the header files).test contains both the unit tests and benchmarks. Either of which can be disabled by turning the corresponding CMake options off.
This template is provided under the "Unlicense" License
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, ordistribute this software, either in source code form or as a compiledbinary, for any purpose, commercial or non-commercial, and by anymeans.
In jurisdictions that recognize copyright laws, the author or authorsof this software dedicate any and all copyright interest in thesoftware to the public domain. We make this dedication for the benefitof the public at large and to the detriment of our heirs andsuccessors. We intend this dedication to be an overt act ofrelinquishment in perpetuity of all present and future rights to thissoftware under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.
For more information, please refer tohttp://unlicense.org/
About
A C++ CMake Template with Benchmark and Unit Testing built in
Resources
Uh oh!
There was an error while loading.Please reload this page.