A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.

Overview

Actions Status Actions Status Actions Status codecov GitHub release (latest by date)

Modern C++ Template

A quick C++ template for modern CMake projects, aimed to be an easy to use starting point.

This is my personal take on such a type of template, thus I might not use the best practices or you might disagree with how I do things. Any and all feedback is greatly appreciated!

Features

  • Modern CMake configuration and project, which, to the best of my knowledge, uses the best practices,

  • An example of a Clang-Format config, inspired from the base Google model, with minor tweaks. This is aimed only as a starting point, as coding style is a subjective matter, everyone is free to either delete it (for the LLVM default) or supply their own alternative,

  • Static analyzers integration, with Clang-Tidy and Cppcheck, the former being the default option,

  • Doxygen support, through the ENABLE_DOXYGEN option, which you can enable if you wish to use it,

  • Unit testing support, through GoogleTest (with an option to enable GoogleMock) or Catch2,

  • Code coverage, enabled by using the ENABLE_CODE_COVERAGE option, through Codecov CI integration,

  • Package manager support, with Conan and Vcpkg, through their respective options

  • CI workflows for Windows, Linux and MacOS using GitHub Actions, making use of the caching features, to ensure minimum run time,

  • .md templates for: README, Contributing Guideliness, Issues and Pull Requests,

  • Permissive license to allow you to integrate it as easily as possible. The template is licensed under the Unlicense,

  • Options to build as a header-only library or executable, not just a static or shared library.

  • Ccache integration, for speeding up rebuild times

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

This project is meant to be only a template, thus versions of the software used can be change to better suit the needs of the developer(s). If you wish to use the template as-is, meaning using the versions recommended here, then you will need:

  • CMake v3.15+ - found at https://cmake.org/

  • C++ Compiler - needs to support at least the C++17 standard, i.e. MSVC, GCC, Clang

Note: You also need to be able to provide CMake a supported generator.

Installing

It is fairly easy to install the project, all you need to do is clone if from GitHub or generate a new repository from it (also on GitHub).

If you wish to clone the repository, rather than generate from it, you simply need to run:

git clone https://github.com/filipdutescu/modern-cpp-template/

After finishing getting a copy of the project, with any of the methods above, create a new folder in the include/ folder, with the name of your project. Edit cmake/SourcesAndHeaders.cmake to add your files.

You will also need to rename the cmake/ProjectConfig.cmake.in file to start with the exact name of your project. Such as cmake/MyNewProjectConfig.cmake.in. You should also make the same changes in the GitHub workflows provided, notably .github/workflows/ubuntu.yml, in which you should replace the CMake option -DProject_ENABLE_CODE_COVERAGE=1 to -DMyNewProject_ENABLE_CODE_COVERAGE=1.

Finally, change "Project" from CMakeLists.txt, from

project(
  "Project"
  VERSION 0.1.0
  LANGUAGES CXX
)

to the exact name of your project, i.e. using the previous name it will become:

project(
  MyNewProject
  VERSION 0.1.0
  LANGUAGES CXX
)

To install an already built project, you need to run the install target with CMake. For example:

cmake --build build --target install --config Release

# a more general syntax for that command is:
cmake --build <build_directory> --target install --config <desired_config>

Building the project

To build the project, all you need to do, after correctly installing the project, is run a similar CMake routine to the the one below:

mkdir build/ && cd build/
cmake .. -DCMAKE_INSTALL_PREFIX=/absolute/path/to/custom/install/directory
cmake --build . --target install

Note: The custom CMAKE_INSTALL_PREFIX can be omitted if you wish to install in the default install location.

More options that you can set for the project can be found in the cmake/StandardSettings.cmake file. For certain options additional configuration may be needed in their respective *.cmake files (i.e. Conan needs the CONAN_REQUIRES and might need the CONAN_OPTIONS to be setup for it work correctly; the two are set in the cmake/Conan.cmake file).

Generating the documentation

In order to generate documentation for the project, you need to configure the build to use Doxygen. This is easily done, by modifying the workflow shown above as follows:

mkdir build/ && cd build/
cmake .. -D<project_name>_ENABLE_DOXYGEN=1 -DCMAKE_INSTALL_PREFIX=/absolute/path/to/custom/install/directory
cmake --build . --target doxygen-docs

Note: This will generate a docs/ directory in the project's root directory.

Running the tests

By default, the template uses Google Test for unit testing. Unit testing can be disabled in the options, by setting the ENABLE_UNIT_TESTING (from cmake/StandardSettings.cmake) to be false. To run the tests, simply use CTest, from the build directory, passing the desire configuration for which to run tests for. An example of this procedure is:

cd build          # if not in the build directory already
ctest -C Release  # or `ctest -C Debug` or any other configuration you wish to test

# you can also run tests with the `-VV` flag for a more verbose output (i.e.
#GoogleTest output as well)

End to end tests

If applicable, should be presented here.

Coding style tests

If applicable, should be presented here.

Contributing

Please read CONTRIBUTING.md for details on our how you can become a contributor and the process for submitting pull requests to us.

Versioning

This project makes use of SemVer for versioning. A list of existing versions can be found in the project's releases.

Authors

License

This project is licensed under the Unlicense - see the LICENSE file for details

Comments
  • [BUG] msvc runtime library not setup at all.

    [BUG] msvc runtime library not setup at all.

    Describe the bug cmake build stage failed with the error msg below:

    [main] Building folder: QuicPlus 
    [build] Starting build
    [proc] Executing command: "C:\Program Files\CMake\bin\cmake.exe" --build d:/VS2019/QuicPlus/build --config Debug --target all -j 24 --
    [build] [1/2  50% :: 0.886] Building CXX object test\CMakeFiles\tmp_test_Tests.dir\src\tmp_test.cpp.obj
    [build] [2/2 100% :: 1.036] Linking CXX executable test\tmp_test_Tests.exe
    [build] FAILED: test/tmp_test_Tests.exe 
    [build] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=test\CMakeFiles\tmp_test_Tests.dir --rc="D:\Windows Kits\10\bin\10.0.19041.0\x86\rc.exe" --mt="D:\Windows Kits\10\bin\10.0.19041.0\x86\mt.exe" --manifests  -- "D:\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64\link.exe" /nologo test\CMakeFiles\tmp_test_Tests.dir\src\tmp_test.cpp.obj  /out:test\tmp_test_Tests.exe /implib:test\tmp_test_Tests.lib /pdb:test\tmp_test_Tests.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console  lib\Debug\QuicPlus.lib  D:\vcpkg\installed\x64-windows-static\debug\lib\manual-link\gtest_maind.lib  D:\vcpkg\installed\x64-windows-static\debug\lib\gtestd.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D D:\VS2019\QuicPlus\build\test && C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy Bypass -file D:/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary D:/VS2019/QuicPlus/build/test/tmp_test_Tests.exe -installedDir D:/vcpkg/installed/x64-windows-static/debug/bin -OutVariable out""
    [build] LINK Pass 1: command "D:\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x64\link.exe /nologo test\CMakeFiles\tmp_test_Tests.dir\src\tmp_test.cpp.obj /out:test\tmp_test_Tests.exe /implib:test\tmp_test_Tests.lib /pdb:test\tmp_test_Tests.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console lib\Debug\QuicPlus.lib D:\vcpkg\installed\x64-windows-static\debug\lib\manual-link\gtest_maind.lib D:\vcpkg\installed\x64-windows-static\debug\lib\gtestd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:test\CMakeFiles\tmp_test_Tests.dir/intermediate.manifest test\CMakeFiles\tmp_test_Tests.dir/manifest.res" failed (exit code 1169) with the following output:
    [build] gtestd.lib(gtest-all.cc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: struct _Cvtvec __cdecl std::_Locinfo::_Getcvt(void)const " ([email protected][email protected]@@[email protected]@XZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: bool __cdecl std::ios_base::good(void)const " ([email protected][email protected]@@QEBA_NXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __cdecl std::ios_base::flags(void)const " ([email protected][email protected]@@QEBAHXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __cdecl std::ios_base::width(void)const " ([email protected][email protected]@@QEBA_JXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __cdecl std::ios_base::width(__int64)" ([email protected][email protected]@@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: int __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __int64 __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::eback(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEBAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::gptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEBAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::pbase(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEBAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::pptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEBAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::egptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEBAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::gbump(int)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::setg(char *,char *,char *)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::epptr(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEBAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::setp(char *,char *,char *)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: char * __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@IEAAPEADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __cdecl std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __cdecl std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __cdecl std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __cdecl std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: char __cdecl std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " ([email protected][email protected][email protected]@[email protected]@@[email protected]@QEBADXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "protected: __cdecl std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: void __cdecl std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@QEAAXXZ) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::operator<<(int)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@Z) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: __cdecl std::basic_iostream<char,struct std::char_traits<char> >::basic_iostream<char,struct std::char_traits<char> >(class std::basic_streambuf<char,struct std::char_traits<char> > *)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected][email protected]@[email protected]@@[email protected]@Z) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] msvcprtd.lib(MSVCP140D.dll) : error LNK2005: "public: virtual __cdecl std::basic_iostream<char,struct std::char_traits<char> >::~basic_iostream<char,struct std::char_traits<char> >(void)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in gtestd.lib(gtest-all.cc.obj)
    [build] libcpmtd.lib(locale0.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(locale0.obj) : error LNK2005: "void __cdecl std::_Facet_Register(class std::_Facet_base *)" ([email protected]@@[email protected]@@Z) already defined in msvcprtd.lib(locale0_implib.obj)
    [build] libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" ([email protected]@[email protected]@[email protected]@XZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" ([email protected]@[email protected]@[email protected]@[email protected]) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" ([email protected][email protected]@@[email protected]@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" ([email protected][email protected]@@[email protected]@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Locimp::_New_Locimp(class std::locale::_Locimp const &)" ([email protected][email protected]@[email protected]@[email protected]@@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(cout.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(cerr.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(locale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(locale.obj) : error LNK2005: "private: static void __cdecl std::locale::_Locimp::_Locimp_Addfac(class std::locale::_Locimp *,class std::locale::facet *,unsigned __int64)" ([email protected][email protected]@[email protected]@[email protected]@[email protected][email protected]) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(iosptrs.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xlock.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::_Lockit(int)" ([email protected]@@[email protected]@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::~_Lockit(void)" ([email protected]@@[email protected]) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(wlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(wlocale.obj) : error LNK2005: "public: char const * __cdecl std::_Locinfo::_Getdays(void)const " ([email protected][email protected]@@QEBAPEBDXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(wlocale.obj) : error LNK2005: "public: char const * __cdecl std::_Locinfo::_Getmonths(void)const " ([email protected][email protected]@@QEBAPEBDXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(wlocale.obj) : error LNK2005: "public: unsigned short const * __cdecl std::_Locinfo::_W_Getdays(void)const " ([email protected][email protected]@@QEBAPEBGXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(wlocale.obj) : error LNK2005: "public: unsigned short const * __cdecl std::_Locinfo::_W_Getmonths(void)const " ([email protected][email protected]@@QEBAPEBGXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(xlocale.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xlocale.obj) : error LNK2005: "public: char const * __cdecl std::_Locinfo::_Getdays(void)const " ([email protected][email protected]@@QEBAPEBDXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(xlocale.obj) : error LNK2005: "public: char const * __cdecl std::_Locinfo::_Getmonths(void)const " ([email protected][email protected]@@QEBAPEBDXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(xlocale.obj) : error LNK2005: "public: unsigned short const * __cdecl std::_Locinfo::_W_Getdays(void)const " ([email protected][email protected]@@QEBAPEBGXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(xlocale.obj) : error LNK2005: "public: unsigned short const * __cdecl std::_Locinfo::_W_Getmonths(void)const " ([email protected][email protected]@@QEBAPEBGXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
    [build] libcpmtd.lib(xstol.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xstoul.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xstoll.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xstoull.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xmtx.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xstrcoll.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xdateord.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xwcscoll.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xwcsxfrm.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xgetwctype.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xtowlower.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xtowupper.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(xstrxfrm.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(StlCompareStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(StlCompareStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(StlLCMapStringW.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] libcpmtd.lib(StlLCMapStringA.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in tmp_test.cpp.obj
    [build] LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
    [build] test\tmp_test_Tests.exe : fatal error LNK1169: one or more multiply defined symbols found
    [build] ninja: build stopped: subcommand failed.
    [build] Build finished with exit code 1
    

    The problem is casued by the missing of setup of msvc runtime library.

    To Reproduce

    1. Install vcpkg
    2. Install gtest via vcpkg.exe install gtest:x64-windows-static.
    3. Download and install vscode editor.
    4. Install c++ extension pack into the vscode editor.
    5. Git clone modern-cpp-template
    6. Open it from vscode editor
    7. Create a folder .vscode in the root folder and create a settings.json file in .vscode folder with the below content:
    {
      "cmake.configureSettings": {
        // "CMAKE_BUILD_TYPE": "Release", this does not take effetc. so use the vscode gui to control the build type
        "BUILD_SHARED_LIBS": "OFF",
        "VCPKG_TARGET_TRIPLET": "x64-windows-static",
        "CMAKE_TOOLCHAIN_FILE": "D:/vcpkg/scripts/buildsystems/vcpkg.cmake"
      }
    }
    

    Change D:/vcpkg/scripts/buildsystems/vcpkg.cmake to your own path. 7. config and build the project via vscode gui.

    Expected behavior config and build shoudl succeed. and tests shoudl all passed.

    Desktop (please complete the following information):

    • OS: Windows
    • Version 10
    • Editor: vscode

    Additional context I fixed up the issue by adding this line in my fork I am happy to create a PR when the issue is discussed and got alignment with the author.

    bug good first issue acknowledged fixed 
    opened by Kiddinglife 10
  • TODO

    TODO

    To be implemented:

    In progress:

    Done:

    • [x] Code coverage
    • [x] CI cache and GoogleTest build Release only
    • [x] CMake Windows export symbols and visibility preset (through CMakeGenerateExportHeader)
    • [x] GoogleMock integration
    • [x] VCPKG support
    • [x] Conan support
    • [x] Doxygen support
    • [x] Add separate file for sources and headers ro be used, rather than use GLOB_RECURSE)
    • [x] Move options to separate file
    • [x] Static Analyzers (Clang-Tidy & Cppcheck)
    • [x] Remove static only build of library
    enhancement 
    opened by filipdutescu 9
  • [FEATURE] Release workflow for github

    [FEATURE] Release workflow for github

    Is your feature request related to a problem? Please describe. No one should do manual deployments.

    Describe the solution you'd like Create a new tag or push on a release branch to trigger an automated release

    Provide usage examples There are already actions for the different tasks available: https://github.com/actions/create-release https://github.com/actions/upload-release-asset

    And filtering for specific branches and tags can be achieved by:

    on:
      push:
        branches:    
          - master
        tags:        
          - v1
    

    P.S.: Amazing work on the template. Working on a similar approach but using a strategy matrix https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix

    enhancement good first issue acknowledged implemented 
    opened by thebino 8
  • vs2022 build failure

    vs2022 build failure

    Hello, I am a newbie to cmake, I tried to clone the project and use vs2022 preview to generate it, but I got the error that gtest could not be found, I did not change any code.Do I need to manually download gtest and link to it somewhere.

    The system is: Windows - 10.0.19043 - AMD64
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
    Compiler: C:/Program Files/Microsoft Visual Studio/2022/Preview/VC/Tools/MSVC/14.30.30423/bin/Hostx64/x64/cl.exe 
    Build flags: 
    Id flags:  
    
    1> [CMake] -- Build unit tests for the project. Tests should always be found in the test folder
    1> [CMake] 
    1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Preview/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    1> [CMake]   Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR
    1> [CMake]   GTEST_MAIN_LIBRARY)
    1> [CMake] Call Stack (most recent call first):
    1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Preview/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Preview/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/FindGTest.cmake:255 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    1> [CMake]   test/CMakeLists.txt:46 (find_package)
    1> [CMake] -- Configuring incomplete, errors occurred!
    
    question acknowledged 
    opened by alazysun 6
  • How to make compilation warnings not work for third party libraries?

    How to make compilation warnings not work for third party libraries?

    Threr are many third party libraries in my project, I just let compilation warnings to work for my code,not work for third party libraries. Could you please tell me what should I do?

    enhancement acknowledged fixed 
    opened by stoneboy100200 6
  • [FEATURE] Control which changes trigger github actions

    [FEATURE] Control which changes trigger github actions

    Is your feature request related to a problem? Please describe. Typo fixes in one of the *.md files will rerun the entire CI pipeline. Depending on how long the pipeline takes to run, this may become an issue.

    Describe the solution you'd like Control what triggers the CI pipeline via config.

    Describe alternatives you've considered Github actions doesn't seem to support skipping via a keyword in the commit message, so not sure there is an alternative.

    Provide usage examples See documentation link above

    Additional context I would create a PR, but I don't know if you want to implement a whilelist or a blacklist.

    enhancement good first issue acknowledged implemented 
    opened by php1ic 5
  • [BUG] cmake fails when Project_BUILD_EXECUTABLE is true

    [BUG] cmake fails when Project_BUILD_EXECUTABLE is true

    Describe the bug If I try to build executable by setting -DProject_BUILD_EXECUTABLE=On, the cmake step fails with

    CMake Error at test/CMakeLists.txt:51 (target_link_libraries):
      Target "Project" of type EXECUTABLE may not be linked into another target.
      One may link only to INTERFACE, OBJECT, STATIC or SHARED libraries, or to
      executables with the ENABLE_EXPORTS property set.
    

    To Reproduce Steps to reproduce the behavior:

    1. Clone project
    2. mkdir build && cd build
    3. cmake .. -DProject_BUILD_EXECUTABLE=On
    4. See error

    Expected behavior I'm just trying to build a simple executable, not a library

    Desktop (please complete the following information):

    • OS: Linux.
    • Version: Running inside custom Docker container based on ubuntu 20

    cmake --version cmake version 3.16.3

    Additional context Coming back to C++ after forever away, just learning about the build tooling etc, so it could be a basic mistake on my end. Just want to build an executable program not a library. I failed after tweaking things for my project, and then got the same failure in the vanilla template project with no tweaks.

    bug help wanted good first issue acknowledged fixed 
    opened by jmarca 4
  • [BUG] CMakeLists.txt source files and header files do not print as list

    [BUG] CMakeLists.txt source files and header files do not print as list

    Describe the bug In the projects CMakeLists.txt, there are calls to:

    • verbose_message(${sources})
    • verbose_message(${exe_sources})
    • verbose_message(${headers})

    where the variables are lists set in SourcesAndHeaders.cmake.

    However, when the messages are displayed in the console, only the first file is displayed in the list. E.g. if you have multiple sources, only the first file will be displayed.

    To Reproduce Steps to reproduce the behavior:

    1. Add multiple source files or header files
    2. Build

    Expected behavior Should display all the values in a list.

    bug acknowledged fixed 
    opened by nhanders 3
  • [BUG] Conan not working ootb

    [BUG] Conan not working ootb

    Describe the bug After installing conan with pip and enabling conan support for project, several things are not working properly:

    1. ${PROJECT_NAME}_CONAN_REQUIRES and ${PROJECT_NAME}_CONAN_OPTIONS are not being detected.
    2. When detected, libraries are not linked so, compilation is failing (tested with boost only)

    Already managed to fix that, so you can apply that @filipdutescu:

    1. For first issue, just replace ${CONAN_REQUIRES} with ${${PROJECT_NAME}_CONAN_REQUIRES} in Conan.cmake - just a typo :) apply same for ${CONAN_OPTIONS}
    2. For second, conan_basic_setup() needs to be called within Conan.cmake.

    To Reproduce Steps to reproduce the behavior:

    1. Clone repo
    2. Install conan via pip
    3. Enable conan in cmake/StandardSettings.cmake
    4. Add dependency in cmake/Conan.cmake, like set(${PROJECT_NAME}_CONAN_REQUIRES "boost/1.77.0")
    5. Use the library somewhere in example project, like #include <boost/archive/text_oarchive.hpp> in include/project/tmp.hpp
    6. Build the project, enjoy the compilation error.

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: [e.g. Windows] Ubuntu
    • Version [e.g. 10] 20.04

    Additional context Add any other context about the problem here.

    bug acknowledged fixed 
    opened by inql 3
  • [FEATURE] Use pip to install CMake in Dockerfile

    [FEATURE] Use pip to install CMake in Dockerfile

    Is your feature request related to a problem? Please describe. This is not really a problem, but you may not have to manually install cmake from source in the Dockerfile

    Describe the solution you'd like You can install cmake via pip

    Describe alternatives you've considered N/A

    Provide usage examples e.g. pip3 install cmake

    Additional context https://cmake-python-distributions.readthedocs.io/en/latest/index.html

    enhancement good first issue wontfix acknowledged 
    opened by arecarn 3
  • Fix clang format target command

    Fix clang format target command

    closes #21

    Summary

    When using multiple sources/headers, the building of the custom target clang-format was failing.

    This was fixed by using the WORKING_DIRECTORY argument of add_custom_target.

    Side Notes

    I know you said you'd fixed this in the next release @filipdutescu, but I thought I'd help you along here.

    Thank you for putting this template together! The world of modern C++ can be extremely confusing, but having a template like this with best practices has already made a world of difference to me!

    Testing

    ✅ Able to reproduce error by adding src/main.cpp and building as an executable with ${PROJECT_NAME}_BUILD_EXECUTABLE set to ON. This work fixed this error. ✅ Able to run clang-format target with the setup described in the test above

    Pull Request Readiness Checklist

    See details at CONTRIBUTING.md.

    • [x] I agree to contribute to the project under modern-cpp-template (Unlicense) License.
    • [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with modern-cpp-template
    • [x] The PR is proposed to proper branch
    • [x] There is reference to original bug report and related work
    • [x] There is accuracy test, performance test and test data in the repository, if applicable
    • [x] The feature is well documented and sample code can be built with the project CMake
    bug acknowledged fixed 
    opened by nhanders 2
  • [FEATURE] add AddressSanitizer as an option

    [FEATURE] add AddressSanitizer as an option

    Is your feature request related to a problem? Please describe.

    AddressSanitizer is a fast memory error detector. It consists of a compiler instrumentation module and a run-time library. see https://github.com/google/sanitizers/wiki/AddressSanitizer. The tool can detect the following types of bugs:

    • Out-of-bounds accesses to heap, stack and globals
    • Use-after-free
    • Use-after-return (clang flag -fsanitize-address-use-after-return=(never|runtime|always) default: runtime)
    • Enable with: ASAN_OPTIONS=detect_stack_use_after_return=1 (already enabled on Linux).
    • Disable with: ASAN_OPTIONS=detect_stack_use_after_return=0.
    • Use-after-scope (clang flag -fsanitize-address-use-after-scope)
    • Double-free, invalid free
    • Memory leaks (experimental)

    This tool is very fast. The average slowdown of the instrumented program is ~2x (see

    And I think it's quite useful in C/C++ projects. You can simply enable it by compiling and linking your program with -fsanitize=address flag.

    Describe the solution you'd like

    Maybe we can add it as an option in cmake/StandardSettings.cmake ?

    For example, like this:

    option(${PROJECT_NAME}_ENABLE_ASAN "Enable Address Sanitize to detect memory error." ON)
    if(${PROJECT_NAME}_ENABLE_ASAN)
      add_compile_options(-fsanitize=address)
      add_link_options(-fsanitize=address)
    endif()
    
    enhancement 
    opened by yunwei37 0
  • [BUG]

    [BUG]

    I am probably doing something wrong, because I'm very new to C++ and wanted to start from a sensible template. (This template is awesome, by the way! It got me started very well, and I am much happier with the state of my learning project than I could imagine if I started from scratch. I just like myself a good build/package structure.)

    Describe the bug

    Following the instructions, I had a Conan provided library not linked, so I got undefined reference to boost::read_graphml(std::istream&, boost::mutate_graph&, unsigned long)' from ld.

    To Reproduce Steps to reproduce the behavior:

    I am trying to play around with graphs, so I included Conan in the cmake configuration

    option(${PROJECT_NAME}_ENABLE_CONAN "Enable the Conan package manager for this project." ON)
    

    and changed the Conan.cmake to include boost

      set(${PROJECT_NAME}_CONAN_REQUIRES "boost/1.79.0")
    

    I set the project to compile executables and wrote a small main.cpp to load a graph from a GraphML file

    #include <boost/graph/adjacency_list.hpp>
    #include <boost/graph/graph_concepts.hpp>
    #include <boost/graph/graphml.hpp>
    #include <ios>
    #include <list>
    
    #include "cmcmc/tmp.hpp"
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
      using Graph = boost::adjacency_list<>;
      Graph g;
      boost::dynamic_properties dp{ boost::ignore_other_properties };
    
      if (argc > 1)
      {
        ifstream in{ argv[1] };
        boost::read_graphml(in, g, dp, 0);
      }
    }
    

    :boom:

    /usr/bin/ld: CMakeFiles/CMCMC.dir/src/main.cpp.o: in function `void boost::read_graphml<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >(std::istream&, boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>&, boost::dynamic_properties&, unsigned long)':
    /home/anaphory/.conan/data/boost/1.79.0/_/_/package/1671931156455a119d7c3f14d951ac5fdbc5cd10/include/boost/graph/graphml.hpp:229: undefined reference to `boost::read_graphml(std::istream&, boost::mutate_graph&, unsigned long)'
    collect2: error: ld returned 1 exit status
    

    Expected behavior

    I thought with this setup, Conan would pull in Boost to a known location, and cmake would ensure it gets linked to. (I had some version of Boost headers available before installing Boost using Conan, so that may have complicated the impression I got.)

    Workaround

    I added conan_target_link_libraries(${PROJECT_NAME}) as last line to my CMakeList.txt and it works fine. So I assume the issue is more how I use the template and associated software – which, fair, I don't really understand well enough – and not an actual issue with the template, but maybe it is an issue worth pointing out?

    Environment

    I'm happy to provide version strings and other similar items, I just don't know what is useful.

    bug 
    opened by Anaphory 0
  • Not printing the header files with BUILD_HEADERS_ONLY [BUG]

    Not printing the header files with BUILD_HEADERS_ONLY [BUG]

    Describe the bug when using the BUILD_HEADERS_ONLY option, cmake fails

    To Reproduce Steps to reproduce the behavior:

    1. Open './cmake/StandardSettings.cmake'
    2. Go to option 'option(${PROJECT_NAME}_BUILD_HEADERS_ONLY "Build the project as a header-only library." ON)'
    3. Modify OFF --> ON
    4. MAKE SURE TO DEFINE THE add FUNCTION IN ./include/project/temp.hpp
    5. Generate cmake to get the following:
    -- Found the following headers:
    CMake Error at CMakeLists.txt:89 (foreach):
      Unknown argument:
    
        LIST
    
    
    
    -- * 
    CMake Error at CMakeLists.txt:91 (endforeach):
      endforeach An ENDFOREACH command was found outside of a proper FOREACH
      ENDFOREACH structure.  Or its arguments did not match the opening FOREACH
      command.
    
    

    Expected behavior Generation should work without any error.

    Screenshots image

    Desktop:

    • OS: MacOS Monterey
    • Version 12.1 (21C52)

    Suggested Fix In ./CMakeLists.txt line 89 Add S to LIST

    change foreach(header IN LIST headers) to foreach(header IN LISTS headers)

    bug acknowledged 
    opened by mk-95 2
  • [FEATURE] add .cmake-format config file and use cmake-format please

    [FEATURE] add .cmake-format config file and use cmake-format please

    Is your feature request related to a problem? Please describe. IMHO: A template project with cmake files should be clean of cmake-lint problems

    Describe the solution you'd like Add a .cmake-format config file to your project root:

    format:
      dangle_parens: true
      keyword_case: upper
      line_ending: unix
      line_width: 120
      max_lines_hwrap: 3
      max_pargs_hwrap: 8
      max_rows_cmdline: 3
      max_subgroups_hwrap: 4
      min_prefix_chars: 8
      separate_ctrl_name_with_space: false
      separate_fn_name_with_space: false
      tab_size: 2
    
    markup:
      bullet_char: '*'
      enum_char: .
      enable_markup: false
    

    Provide usage examples

    • cmake-format -i cmake/*.cmake
    • cmake-lint cmake/*.cmake

    Additional context you may also use this: https://github.com/TheLartians/Format.cmake#how-to-integrate

    enhancement acknowledged 
    opened by ClausKlein 1
  • [BUG] The unit test module failed to compile

    [BUG] The unit test module failed to compile

    Hi. This C++ project template is useful to me. Thanks!

    Unfortunately, the unit test module failed to compile. You may need to add the following to test/cmakelists.txt:

      target_include_directories(
        ${test_name}_Tests
        PUBLIC ${CMAKE_SOURCE_DIR}/include
        PRIVATE ${CMAKE_SOURCE_DIR}/src
      )
    
    bug acknowledged 
    opened by geodoer 1
  • [BUG] Gmock target not found

    [BUG] Gmock target not found

    Describe the bug Starting from fresh template, if use gmock option is selected, cmake generate fails.

    To Reproduce Steps to reproduce the behavior:

    1. Open './cmake/StandardSettings.cmake'
    2. Scroll down to 'option(${PROJECT_NAME}_USE_GOOGLE_MOCK "Use the GoogleMock project for extending the unit tests." OFF)'
    3. Modify OFF -> ON (activate gmock)
    4. Try to generate cmake
    5. See error Target "tmp_test_Tests" links to target ""GTest::gmock" but the target was not found"
    6. See error Target "tmp_test_Tests" links to target ""GTest::gmock_main" but the target was not found"

    Expected behavior Generation should work without any error

    Screenshots image

    Desktop (please complete the following information):

    • OS: Ubuntu (WSL 2)
    • Version 20.04

    Additional context

    bug acknowledged 
    opened by radupaulstefan 2
Releases(v4.1.0)
Owner
Filip Dutescu
Filip Dutescu
A template CMake project to get you started with C++ and tooling

cpp_starter_project Getting Started Use the Github template First, click the green Use this template button near the top of this page. This will take

Jason Turner 2k Oct 2, 2022
Blitz++ is a C++ template class library which provides array objects for scientific computing

Blitz++ is a C++ template class library which provides array objects for scientific computing

Peter Kümmel 17 Nov 22, 2020
🚀 Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and much more.

ModernCppStarter Setting up a new C++ project usually requires a significant amount of preparation and boilerplate code, even more so for modern C++ p

Lars Melchior 2.9k Sep 28, 2022
Standardise code formating for cmake projects with git and clang-format

git-cmake-format This project aims to provide a quick and easy way to integrate clang-format into your CMake project hosted in a git repository, it co

Kenneth Benzie 48 Sep 24, 2022
The C Unit Testing Library on GitHub is a library designed for easy unit testing in C

The C Unit Testing Library on GitHub is a library designed for easy unit testing in C. It was written by Brennan Hurst for the purpose of providing a J-Unit-like testing framework within C for personal projects.

null 1 Oct 11, 2021
C++ Unit Testing Easier: A Header-only C++ unit testing framework

CUTE C++ Unit Testing Easier: A Header-only C++ unit testing framework usually available as part of the Cevelop C++ IDE (http://cevelop.com) Dependenc

Peter Sommerlad 35 Aug 31, 2022
A unit testing framework for CMake

CMake Unit A unit testing framework for CMake. Status Travis CI (Ubuntu) AppVeyor (Windows) Coverage Biicode Licence Why have a unit-testing framework

ポリ平方 POLYSQUARE 35 Aug 16, 2022
Modern c++17 unit testing framework on Microsoft Windows, Apple macOS, Linux, iOS and android.

tunit Modern c++17 unit testing framework on Windows, macOS, Linux, iOS and android. Continuous Integration build status Operating system Status Windo

Gammasoft 8 Apr 5, 2022
Boiler plate template for C++ projects, with CMake, Doctest, Travis CI, Appveyor, Github Actions and coverage reports.

Boiler plate for C++ projects This is a boiler plate for C++ projects. What you get: Sources, headers and mains separated in distinct folders Use of m

Bendik Samseth 494 Oct 1, 2022
OpenGL Template Engine - a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects.

OpenGL Template Engine is a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects. This is the template I personally use for my own projects and provides me with the general OpenGL 3D render setup with model import and UI.

Marcus Nesse Madland 2 May 16, 2022
A minimal CMake template for Qt 5 & 6 projects

Minimal CMake Template for Qt 6 Projects This project is updated for Qt 6. Visit qt5 branch if you are looking for the Qt 5 template. This is a minima

Vincent Lee 180 Sep 21, 2022
cmake-avr - a cmake toolchain for AVR projects

cmake-avr - a cmake toolchain for AVR projects Testing the example provided The toolchain was created and tested within the following environment: Lin

Matthias Kleemann 161 Oct 2, 2022
A collection of as simple as possible, modern CMake projects

Modern CMake Examples Overview This repository is a collection of as simple as possible CMake projects (with a focus on installing). The idea is to tr

Tom Hulton-Harrop 976 Oct 4, 2022
Like feh, but better, faster, more image formats, simpler, more lightweight, animation support, and better UI

Like feh, but better, faster, more image formats, simpler, more lightweight, animation support, and better UI

martin 11 Aug 18, 2022
Lightway Core is a modern VPN protocol by ExpressVPN, to deliver a VPN experience that’s faster, more secure, and more reliable.

Lightway Core NOTE: This is a preview snapshot of the Lightway repository used for both our client and server. We will be publishing a live, actively

ExpressVPN 22 Feb 17, 2022
Lightway Core is a modern VPN protocol by ExpressVPN, to deliver a VPN experience that’s faster, more secure, and more reliable.

Lightway Core is a modern VPN protocol by ExpressVPN, to deliver a VPN experience that’s faster, more secure, and more reliable.

ExpressVPN 344 Oct 6, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 37 Dec 30, 2021
A small c++ template with modern CMake

C++/CMake modern boilerplate This is a template for new projects, gives a good CMake base and a few dependencies you most likely want in your project.

Clément Grégoire 269 Sep 24, 2022
CppUTest unit testing and mocking framework for C/C++

CppUTest CppUTest unit testing and mocking framework for C/C++ More information on the project page Slack channel: Join if link not expired Getting St

CppUTest 1.1k Oct 2, 2022
🧪 single header unit testing framework for C and C++

?? utest.h A simple one header solution to unit testing for C/C++. Usage Just #include "utest.h" in your code! The current supported platforms are Lin

Neil Henning 521 Oct 5, 2022