Code Monkey home page Code Monkey logo

modern-cpp-template's People

Contributors

bgloyer avatar filipdutescu avatar jrosdahl avatar nhanders avatar shahid-roofi-khan avatar thebino avatar vadi2 avatar yunwei37 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modern-cpp-template's Issues

[BUG] Error linking to Conan-installed Boost

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);
  }
}

💥

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

[Confusion] about ${PROJECT_NAME}_BUILD_SHARED_LIBS

**Describe the issue **
I am confused about the below cmake snippets in StandardSettings.cmake:

# Export all symbols when building a shared library
if(${PROJECT_NAME}_BUILD_SHARED_LIBS)
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
    set(CMAKE_CXX_VISIBILITY_PRESET hidden)
    set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
endif()

As cmake tool will build all the libraries as shared library when BUILD_SHARED_LIBS is ON, my understnading is that we should overwrite the cmake built-in cache variable of BUILD_SHARED_LIBS when ${PROJECT_NAME}_BUILD_SHARED_LIBS is ON. Something looks like this:

# Export all symbols when building a shared library
if(${PROJECT_NAME}_BUILD_SHARED_LIBS)
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
    set(CMAKE_CXX_VISIBILITY_PRESET hidden)
    set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
    set(BUILD_SHARED_LIBS ON CACHE BOOL "build shared libraries except when explicitely set to static" FORCE)
endif()

Let me know what you think it.

To Reproduce
None

Expected behavior
Overwrite the cmake built-in cache variable of BUILD_SHARED_LIBS when ${PROJECT_NAME}_BUILD_SHARED_LIBS is ON

Desktop (please complete the following information):

  • OS: Windows
  • Version 10
  • Editor: vscode

[BUG] make install fail

Describe the bug
make install,failed

To Reproduce
make install

Desktop (please complete the following information):

  • Ubuntu 18.04

Additional context
include/${PROJECT_NAME} doesn't exist, the correct include path is include/tmp
So make install would failed

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

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)

TODO

To be implemented:

In progress:

Done:

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

[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()

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

How to use vcpkg?

I enabled vcpkg support in my project (which downloaded the appropriate cmake file), created vcpkg.json to specify the dependencies that should be installed, but... they're not being installed. How do I plug in vcpkg to automatically install the dependencies?

[BUG] Build workflows have errounous CMake options

Describe the bug
The build actions do not reflect changes made in commit 38337bc to the macro names. It is not registered as an error, but CMake warns about it:

CMake Warning:
 Manually-specified variables were not used by the project:

   ENABLE_CODE_COVERAGE

To Reproduce
Steps to reproduce the behaviour:

  1. Go to the Ubuntu action,
  2. Click on the last run (at the time of the writing, this one),
  3. Click on the build job and open the configure step,
  4. Scroll down until the CMake warning

Expected behaviour
All options provided to CMake should be name properly and should function as described in the cmake/StandardSettings.cmake file.

Screenshots
N/A

Desktop (please complete the following information):
Rather than a PC, the following refers to the GitHub Actions' container:

  • OS: Windows/Ubuntu/MacOS
  • Version(s): Latest

Additional context
N/A

[BUG] Project_BUILD_HEADERS_ONLY=ON results in an error

Describe the bug
Building with Project_BUILD_HEADERS_ONLY=ON results in an error.

CMake Error at cmake/CompilerWarnings.cmake:93 (target_compile_options): target_compile_options may only set INTERFACE properties on INTERFACE targets

To Reproduce
cmake -DProject_BUILD_HEADERS_ONLY=ON

Expected behavior
This should succeed.

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

[Confusion] about ${PROJECT_NAME}_BUILD_SHARED_LIBS

Describe the confusion
I am confused about the below cmake snippets in StandardSettings.cmake:

# Export all symbols when building a shared library
if(${PROJECT_NAME}_BUILD_SHARED_LIBS)
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
    set(CMAKE_CXX_VISIBILITY_PRESET hidden)
    set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
endif()

As cmake tool will build all the libraries as shared library when BUILD_SHARED_LIBS is ON, my understnading is that we should overwrite the cmake built-in cache variable of BUILD_SHARED_LIBS when ${PROJECT_NAME}_BUILD_SHARED_LIBS is ON. Something looks like this:

# Export all symbols when building a shared library
if(${PROJECT_NAME}_BUILD_SHARED_LIBS)
    set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS OFF)
    set(CMAKE_CXX_VISIBILITY_PRESET hidden)
    set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
    set(BUILD_SHARED_LIBS ON CACHE BOOL "build shared libraries except when explicitely set to static" FORCE)
endif()

Let me know what you think it.

Expected behavior
Overwrite the cmake built-in cache variable of BUILD_SHARED_LIBS when ${PROJECT_NAME}_BUILD_SHARED_LIBS is ON

Desktop (please complete the following information):

  • OS: Windows
  • Version 10
  • Editor: vscode

[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

[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] 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 " (?_Getcvt@_Locinfo@std@@QEBA?AU_Cvtvec@@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 " (?good@ios_base@std@@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 " (?flags@ios_base@std@@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 " (?width@ios_base@std@@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)" (?width@ios_base@std@@QEAA_J_J@Z) 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)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAA@XZ) 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)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UEAA@XZ) 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)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAAHD@Z) 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)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QEAA_JPEBD_J@Z) 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 " (?eback@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 " (?gptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 " (?pbase@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 " (?pptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 " (?egptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (?gbump@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXH@Z) 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 *)" (?setg@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z) 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 " (?epptr@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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 *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD0@Z) 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 *)" (?setp@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IEAAXPEAD00@Z) 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)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@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)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ) 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)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QEAAXH_N@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_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) 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 " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QEBAPEAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) 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 " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@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)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IEAA@XZ) 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)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@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)" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@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)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@XZ) 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> > *)" (??0?$basic_iostream@DU?$char_traits@D@std@@@std@@QEAA@PEAV?$basic_streambuf@DU?$char_traits@D@std@@@1@@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)" (??1?$basic_iostream@DU?$char_traits@D@std@@@std@@UEAA@XZ) 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 *)" (?_Facet_Register@std@@YAXPEAV_Facet_base@1@@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)" (?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@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)" (?_Init@locale@std@@CAPEAV_Locimp@12@_N@Z) 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 *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@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 *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@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 &)" (?_New_Locimp@_Locimp@locale@std@@CAPEAV123@AEBV123@@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)" (?_Locimp_Addfac@_Locimp@locale@std@@CAXPEAV123@PEAVfacet@23@_K@Z) 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)" (??0_Lockit@std@@QEAA@H@Z) already defined in msvcprtd.lib(MSVCP140D.dll)
[build] libcpmtd.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QEAA@XZ) 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 " (?_Getdays@_Locinfo@std@@QEBAPEBDXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
[build] libcpmtd.lib(wlocale.obj) : error LNK2005: "public: char const * __cdecl std::_Locinfo::_Getmonths(void)const " (?_Getmonths@_Locinfo@std@@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 " (?_W_Getdays@_Locinfo@std@@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 " (?_W_Getmonths@_Locinfo@std@@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 " (?_Getdays@_Locinfo@std@@QEBAPEBDXZ) already defined in msvcprtd.lib(MSVCP140D.dll)
[build] libcpmtd.lib(xlocale.obj) : error LNK2005: "public: char const * __cdecl std::_Locinfo::_Getmonths(void)const " (?_Getmonths@_Locinfo@std@@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 " (?_W_Getdays@_Locinfo@std@@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 " (?_W_Getmonths@_Locinfo@std@@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.

integrade with conan, pkg not found

Describe the bug
Enable CONAN option in StandardSettings.cmake, then add conanfile.txt:

[requires]
fmt/7.0.3

[generators]
cmake

To Reproduce
Steps to reproduce the behavior:

  1. Reload in CMake tab
  2. enter cmake-build-debug directory

    make

  3. See error

Scanning dependencies of target ADemo_LIB
[ 12%] Building CXX object CMakeFiles/ADemo_LIB.dir/src/tmp.cpp.o
Checking /mnt/d/sourcecode/cpp/modern-cpp-template-navono/src/tmp.cpp ...
/mnt/d/sourcecode/cpp/modern-cpp-template-navono/src/tmp.cpp:3:0: style: The function 'add' is never used. [unusedFunction]

^
nofile:0:0: information: Unmatched suppression: missingInclude [unmatchedSuppression]

[ 25%] Linking CXX static library lib/libADemo_LIB.a
[ 25%] Built target ADemo_LIB
Scanning dependencies of target ADemo
[ 37%] Building CXX object CMakeFiles/ADemo.dir/src/main.cpp.o
Checking /mnt/d/sourcecode/cpp/modern-cpp-template-navono/src/main.cpp ...
/mnt/d/sourcecode/cpp/modern-cpp-template-navono/src/main.cpp:7:10: fatal error: fmt/format.h: No such file or directory
7 | #include <fmt/format.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/ADemo.dir/build.make:82: CMakeFiles/ADemo.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:172: CMakeFiles/ADemo.dir/all] Error 2
make: *** [Makefile:160: all] Error 2


Disable Conan option, add conan integrat command and link library in root CMakeLists.txt like this:

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
...
target_link_libraries(
${PROJECT_NAME}
PUBLIC
CONAN_PKG::fmt
)

reload cmake, and make, it works.


Expected behavior
make successful.


Screenshots


Desktop (please complete the following information):

  • OS: [e.g. Windows]: Windows 10
  • Version [e.g. 10]: 2004
  • IDE: CLion 2020.3.3
  • dev: WSL2 (Ubuntu 20.04 )

Additional context
Clion connect WSL2 environment.

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!

[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

[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
  )

[SUGGESTION] Improve spelling and description of ccache

The preferred spelling of ccache is “Ccache” or “ccache”, so I suggest using the former variant. Also, I think that it would be better to say “speed up rebuild time” instead of “speed up build time” since that’s more accurate.

[FEATURE] Add a little more eloborations on which clang-tidy checks going to used.

clang-tidy has set of checks and putted under the some flags. I think it's better to be explicit about which checks are available. I think it's better to list them in the corresponding CMake module of the template, StaticAnalyzers.cmake.

I make a commit, which available in here: https://github.com/p1v0t/modern-cpp-template/commit/f64f3d3ec76078f8200ac5c794c5e80661a71da3

I can pull it, if you people are see whether its useful or not.

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

[BUG] Workflow syntax error on build action from PR #5

Describe the bug
In the file merged from #5, according to GitHub, INSTALL_LOCATION: "d:/a/.local", is invalid YAML syntax:

Invalid workflow file

You have an error in your yaml syntax on line 26.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to GitHub Actions,
  2. Click on .github/workflows/build.yml,
  3. On the center-right panel, click on Merge pull request #5 from thebino/Feature/PipelineRefactor,
  4. Scroll down to line 26 to see the error.

Expected behavior
The workflow is expected to run (on the creation of a tag) and create a release with artefacts from the build results.

Screenshots
N/A

Desktop (please complete the following information):
Rather than a PC, the following refers to the GitHub Actions' container:

  • OS: Windows
  • Version: Latest

Additional context

  • Environment script: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat
  • Compiler: MSVC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.