Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A C++ CMake Template with Benchmark and Unit Testing built in

NotificationsYou must be signed in to change notification settings

akiscode/cpp_cmake_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A repository that serves as a template for C++ projects that want to use modern CMake

Overview

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.

Quick Start

Clone this repository, change into the directory and issue:

mkdir buildcd buildcmake ..make

You can also issuemake test andmake package to run tests or package up the project respectively.

Directory Layout

DirectoryDescription
app1Root folder of sample app
cmakeLocation of "extra" cmake files
docsFolder for any documentation
lib1Root folder of sample library
scriptsFolder 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.cpp

Headers 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.

License

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp