A template CMake project to get you started with C++ and tooling

Overview

cpp_starter_project

codecov

Build Status

Build status

CMake

Getting Started

Use the Github template

First, click the green Use this template button near the top of this page. This will take you to Github's 'Generate Repository' page. Fill in a repository name and short description, and click 'Create repository from template'. This will allow you to create a new repository in your Github account, prepopulated with the contents of this project. Now you can clone the project locally and get to work!

$ git clone https://github.com/<user>/<your_new_repo>.git

Remove frameworks you're not going to use

If you know you're not going to use one or more of the optional gui/graphics frameworks (fltk, gtkmm, imgui, etc.), you can remove them with git rm:

$ git rm -r src/<unnecessary_framework>

Dependencies

Note about install commands:

  • for Windows, we use choco.
  • for MacOS, we use brew.
  • In case of an error in cmake, make sure that the dependencies are on the PATH.

Necessary Dependencies

  1. A C++ compiler that supports C++17. See cppreference.com to see which features are supported by each compiler. The following compilers should work:
  • gcc 7+

    Install command
    • Debian/Ubuntu:

        sudo apt install build-essential
      
    • Windows:

        choco install mingw -y
      
    • MacOS:

        brew install gcc
      
  • clang 6+

    Install command
    • Debian/Ubuntu:

        bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
      
    • Windows:

      Visual Studio 2019 ships with LLVM (see the Visual Studio section). However, to install LLVM separately:

        choco install llvm -y
      

      llvm-utils for using external LLVM with Visual Studio generator:

        git clone https://github.com/zufuliu/llvm-utils.git
        cd llvm-utils/VS2017
        .\install.bat
      
    • MacOS:

        brew install llvm
      
  • Visual Studio 2019 or higher

    Install command + Environment setup

    On Windows, you need to install Visual Studio 2019 because of the SDK and libraries that ship with it.

    Visual Studio IDE - 2019 Community (installs Clang too):

    choco install -y visualstudio2019community --package-parameters "add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --includeOptional --passive --locale en-US"
    

    Put MSVC compiler, Clang compiler, and vcvarsall.bat on the path:

    	choco install vswhere -y
    	refreshenv
    
    	# change to x86 for 32bit
    	$clpath = vswhere -products * -latest -prerelease -find **/Hostx64/x64/*
    	$clangpath = vswhere -products * -latest -prerelease -find **/Llvm/bin/*
    	$vcvarsallpath =  vswhere -products * -latest -prerelease -find **/Auxiliary/Build/*
    
    	$path = [System.Environment]::GetEnvironmentVariable("PATH", "User")
    	[Environment]::SetEnvironmentVariable("Path", $path + ";$clpath" + ";$clangpath" + ";$vcvarsallpath", "User")
    	refreshenv
    
  1. Conan

    Install Command
  2. CMake 3.15+

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install cmake
      
    • Windows:

        choco install cmake -y
      
    • MacOS:

        brew install cmake
      

Optional Dependencies

C++ Tools

  • Doxygen

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install doxygen
        sudo apt-get install graphviz
      
    • Windows:

        choco install doxygen.install -y
        choco install graphviz -y
      
    • MacOS:

        brew install doxygen
        brew install graphviz
      
  • ccache

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install ccache
      
    • Windows:

        choco install ccache -y
      
    • MacOS:

        brew install ccache
      
  • Cppcheck

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install cppcheck
      
    • Windows:

        choco install cppcheck -y
      
    • MacOS:

        brew install cppcheck
      
  • include-what-you-use

    Install Command

    Follow instructions here: https://github.com/include-what-you-use/include-what-you-use#how-to-install

GUI libraries

This project can be made to work with several optional GUI frameworks.

If desired, you should install the following optional dependencies as directed by their documentation, linked here:

The following dependencies can be downloaded automatically by CMake and Conan. All you need to do to install them is to turn on a CMake flag during configuration. If you run into difficulty using them, please refer to their documentation, linked here:

  • NANA
  • SDL
  • IMGUI: This framework depends on SFML, and if you are using Linux, you may need to install several of SFML's dependencies using your package manager. See the SFML build tutorial for specifics.

Build Instructions

Build directory

Make a build directory:

mkdir build

Specify the compiler using environment variables

By default (if you don't set environment variables CC and CXX), the system default compiler will be used.

Conan and CMake use the environment variables CC and CXX to decide which compiler to use. So to avoid the conflict issues only specify the compilers using these variables.

CMake will detect which compiler was used to build each of the Conan targets. If you build all of your Conan targets with one compiler, and then build your CMake targets with a different compiler, the project may fail to build.

Commands for setting the compilers
  • Debian/Ubuntu/MacOS:

    Set your desired compiler (clang, gcc, etc):

    • Temporarily (only for the current shell)

      Run one of the followings in the terminal:

      • clang

          CC=clang CXX=clang++
        
      • gcc

          CC=gcc CXX=g++
        
    • Permanent:

      Open ~/.bashrc using your text editor:

        gedit ~/.bashrc
      

      Add CC and CXX to point to the compilers:

        export CC=clang
        export CXX=clang++
      

      Save and close the file.

  • Windows:

    • Permanent:

      Run one of the followings in PowerShell:

      • Visual Studio generator and compiler (cl)

          [Environment]::SetEnvironmentVariable("CC", "cl.exe", "User")
          [Environment]::SetEnvironmentVariable("CXX", "cl.exe", "User")
          refreshenv
        

        Set the architecture using vsvarsall:

          vsvarsall.bat x64
        
      • clang

          [Environment]::SetEnvironmentVariable("CC", "clang.exe", "User")
          [Environment]::SetEnvironmentVariable("CXX", "clang++.exe", "User")
          refreshenv
        
      • gcc

          [Environment]::SetEnvironmentVariable("CC", "gcc.exe", "User")
          [Environment]::SetEnvironmentVariable("CXX", "g++.exe", "User")
          refreshenv
        
    • Temporarily (only for the current shell):

      	$Env:CC="clang.exe"
      	$Env:CXX="clang++.exe"
      

Configure your build

To configure the project and write makefiles, you could use cmake with a bunch of command line options. The easier option is to run cmake interactively:

Configure via cmake-gui:

  1. Open cmake-gui from the project directory:
cmake-gui .
  1. Set the build directory:

build_dir

  1. Configure the generator:

In cmake-gui, from the upper menu select Tools/Configure.

Warning: if you have set CC and CXX always choose the use default native compilers option. This picks CC and CXX. Don't change the compiler at this stage!

Windows - MinGW Makefiles

Choose MinGW Makefiles as the generator:

mingw
Windows - Visual Studio generator and compiler

You should have already set C and CXX to cl.exe.

Choose "Visual Studio 16 2019" as the generator:

default_vs
Windows - Visual Studio generator and Clang Compiler

You should have already set C and CXX to clang.exe and clang++.exe.

Choose "Visual Studio 16 2019" as the generator. To tell Visual studio to use clang-cl.exe:

  • If you use the LLVM that is shipped with Visual Studio: write ClangCl under "optional toolset to use".
visual_studio
  • If you use an external LLVM: write LLVM_v142 under "optional toolset to use".
visual_studio

  1. Choose the Cmake options and then generate:

generate

Configure via ccmake:

with the Cmake Curses Dialog Command Line tool:

ccmake -S . -B ./build

Once ccmake has finished setting up, press 'c' to configure the project, press 'g' to generate, and 'q' to quit.

Build

Once you have selected all the options you would like to use, you can build the project (all targets):

cmake --build ./build

For Visual Studio, give the build configuration (Release, RelWithDeb, Debug, etc) like the following:

cmake --build ./build -- /p:configuration=Release

Troubleshooting

Update Conan

Many problems that users have can be resolved by updating Conan, so if you are having any trouble with this project, you should start by doing that.

To update conan:

$ pip install --user --upgrade conan

You may need to use pip3 instead of pip in this command, depending on your platform.

Clear Conan cache

If you continue to have trouble with your Conan dependencies, you can try clearing your Conan cache:

$ conan remove -f '*'

The next time you run cmake or cmake --build, your Conan dependencies will be rebuilt. If you aren't using your system's default compiler, don't forget to set the CC, CXX, CMAKE_C_COMPILER, and CMAKE_CXX_COMPILER variables, as described in the 'Build using an alternate compiler' section above.

Identifying misconfiguration of Conan dependencies

If you have a dependency 'A' that requires a specific version of another dependency 'B', and your project is trying to use the wrong version of dependency 'B', Conan will produce warnings about this configuration error when you run CMake. These warnings can easily get lost between a couple hundred or thousand lines of output, depending on the size of your project.

If your project has a Conan configuration error, you can use conan info to find it. conan info displays information about the dependency graph of your project, with colorized output in some terminals.

$ cd build
$ conan info .

In my terminal, the first couple lines of conan info's output show all of the project's configuration warnings in a bright yellow font.

For example, the package spdlog/1.5.0 depends on the package fmt/6.1.2. If you were to modify the file cmake/Conan.cmake so that it requires an earlier version of fmt, such as fmt/6.0.0, and then run:

$ conan remove -f '*'       # clear Conan cache
$ rm -rf build              # clear previous CMake build
$ mkdir build && cd build
$ cmake ..                  # rebuild Conan dependencies
$ conan info .

...the first line of output would be a warning that spdlog needs a more recent version of fmt.

Testing

See Catch2 tutorial

Fuzz testing

See libFuzzer Tutorial

Issues
  • Cleanup static checks and code samples

    Cleanup static checks and code samples

    This has a few minor updates to apply what I think should be the default for best practices getting started C++ code:

    • sanitizers enabled by default
    • clang-tidy enabled by default
    • clang-format enabled as a github action

    Plus I tweaked a few of the clang-tidy warnings that are enabled to make them easier to work with and disable warnings that are google project specific.

    To do list:

    • [x] All gcc ENABLE_DEVELOPER_MODE=ON builds fail because the environment does not contain clang-tidy, so it fails at configure time
    • [x] Gcc / LLVM builds on Windows are actually still using MSVC, see here: https://github.com/cpp-best-practices/cpp_starter_project/runs/4991906918?check_suite_focus=true#step:5:63
    • [x] We might have too many builds in the matrix now? Something to consider.
    • [x] After we merge the required changes into project_options, we need to change the version of project_options linked in this branch.
    opened by lefticus 43
  • feat: make the build system reusable and declarative + support Vcpkg + automatically setup MSVC environment

    feat: make the build system reusable and declarative + support Vcpkg + automatically setup MSVC environment

    Fixes #125 Fixes #174 Fixes #40 Fixes #122

    This pull request makes the build system reusable by:

    • Making the Cmake files a Cmake library that is downloadable and reusable from multiple projects. https://github.com/aminya/ProjectOptions/

    • Removing the need for the copy-pasting 500 lines of CMake into different projects

    This makes the build system declarative and reproducible by:

    • Removing dynamic dependency injection
    • Removing unnecessarily Cmake options that can be instead declared

    All the options are exposed as function arguments and can be enabled/added by the user in a declarative way. Optionally there is a way to use global options.

    It also improves upon many of the CMake files. For example, support for Vcpkg is added now, vcvarsall automatically runs, MSVC address sanitizer now works, etc. See this for some of the improvements: https://github.com/aminya/ProjectOptions/releases

    See this for more information: https://github.com/cpp-best-practices/cpp_starter_project/issues/125#issuecomment-924479679

    enhancement needs-merge-approval 
    opened by aminya 31
  • Meta: add more repository maintainers

    Meta: add more repository maintainers

    I am opening this issue specifically because it seems that @lefticus is not able to review and merge all the pull requests, and so many of them are left open. One way to fix this is to add more maintainers to the repository.

    27 PRs are open at the moment https://github.com/lefticus/cpp_starter_project/pulls

    opened by aminya 16
  • Address Sanitizer broken on Windows

    Address Sanitizer broken on Windows

    Hi,

    i noticed that the CI-Builds from this template fail for Windows and MacOS when i enable the AddressSanitizer:

    CMakeLists.txt
    @@ -38,7 +38,7 @@ project_options(
          # ENABLE_USER_LINKER
          # ENABLE_BUILD_WITH_TIME_TRACE
          # ENABLE_UNITY
    -     # ENABLE_SANITIZER_ADDRESS
    +    ENABLE_SANITIZER_ADDRESS
          # ENABLE_SANITIZER_LEAK
          # ENABLE_SANITIZER_UNDEFINED_BEHAVIOR
          # ENABLE_SANITIZER_THREAD
    

    I also noticed this behavior on my local machine on Visual Studio 2019 16.11.9 when enabling AddressSanitizer. Because this happens on CI and my machine i assume something is wrong with how the sanitizer is enabled through project_options? (I decided to open the issue here though as i would start searching here when running into this problem)

    I commited the above on my fork of the template: https://github.com/LtdSauce/cpp_starter_project See actions there for the failed builds. TL;DR: On Windows all executables fail with the following return Code 0xc0000135. That seems to happen when a dll cannot be loaded. On MacOS i have no clue what goes wrong as i never have worked with MacOS before.

    As i am not native to Windows i have no clue how to tackle this issue on my own... Has anyone run into this before and knows how to fix it?

    opened by LtdSauce 15
  • Build type other than RelWithDebInfo fails build on visual studio (multi config build)

    Build type other than RelWithDebInfo fails build on visual studio (multi config build)

    While playing around with the multi configuration generator for VisualStudio, i noticed that i cannot set the BUILD_TYPE to anything else than RelWithDebInfo. Because VisualStudios Generator sets the CMAKE_CONFIGURATION_TYPES to Debug;Release;MinSizeRel;RelWithDebInfo as it could handle multi-configurations. When conan is invoked the Cmake module iterates over CMAKE_CONFIGURATION_TYPES and installs the dependencies for them and puts the build-files and Find.cmake modules in the build directory. Because RelWithDebInfo is the last in the list, my build is only able to find the libraries for RelWithDebInfo... Trying to invoke the Debug configuration with cmake --build build --config Debug leads to errors like the following:

    docopt.lib(docopt.obj) : error LNK2038: Konflikt ermittelt für "_ITERATOR_DEBUG_LEVEL": Der Wert "0" stimmt nicht mit dem Wert "2" in main.obj überein. [C:\Users\ldetj\develop\EnCoDaTr\build-2\src \encodatr.vcxproj]

    Which looks like my Debug-Build is linked to the Libs from the RelWithDebInfo configuration. Is this a bug in the conan module from this project or have i misconfigured something? (I did a fresh configure on the project and build it with the command above)

    Could you or someone else try this aswell? (Do you need more information to reproduce?)

    I reproduced this with a github action by setting the BUILD_TYPE to Debug --> https://github.com/LtdSauce/cpp_starter_project/runs/4967074084?check_suite_focus=true.

    Initial Issue Description. This was just a symptom of the above issue and a deprecated CMake-Cache Hi,

    i'm not shure if i got an issue here or if it is just me beeing stupid.

    It seems that the default build type is not correctly set. When i configure a project created from the cpp-starter-project template and just configure it, i do not get the message "Setting build type to 'RelWithDebInfo' as none was specified." from StandardProjectSettings.cmake:3.

    I injected a message to check if those variables are already set to something:

    message(STATUS "Got CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}' or CMAKE_CONFIGURATION_TYPES: '${CMAKE_CONFIGURATION_TYPES}'")
    

    This got me the following message:

    [cmake] -- Got CMAKE_BUILD_TYPE: '' or CMAKE_CONFIGURATION_TYPE: 'Debug;Release;MinSizeRel;RelWithDebInfo'
    

    Because CMAKE_CONFIGURATION_TYPES is not empty the if evaluates to false and does not set a default for CMAKE_BUILD_TYPE. This later leads to the following error with conan:

    [cmake] -- Conan: Adding bincrafters remote repository (https://bincrafters.jfrog.io/artifactory/api/conan/public-conan) verify ssl (True)
    [cmake] -- Multi-configuration build: 'Debug;Release;MinSizeRel;RelWithDebInfo'!
    [cmake] -- Running Conan for build type 'Debug'
    [cmake] CMake Error at build/conan.cmake:71 (message):
    [cmake]   Please specify in command line CMAKE_BUILD_TYPE
    [cmake]   (-DCMAKE_BUILD_TYPE=Release)
    [cmake] Call Stack (most recent call first):
    [cmake]   build/conan.cmake:430 (_conan_detect_build_type)
    [cmake]   build/_deps/_project_options-src/src/Conan.cmake:39 (conan_cmake_autodetect)
    [cmake]   build/_deps/_project_options-src/src/Index.cmake:174 (run_conan)
    [cmake]   CMakeLists.txt:22 (project_options)
    

    By explicitly setting CMAKE_BUILD_TYPE the conan error is "fixed".

    EDIT: After doing a clean configure the conan error vanished. And i cannot reproduce it. The issue was due to the explanation from The second comment to this issue

    I'm on Windows 10 using the Visual Studio 2019 BuildTools with the MSVC Version 19.29.30037.0.

    Solution

    The error was caused by the generators in the conanfile.txt. cmake_find_package_multi was missing and the other generators just kept overwriting the find_packages of the previous BUILD_TYPE for the libs fetched from conan. By adding that generator and removing all the others the problem is fixed.

    opened by LtdSauce 12
  • Separate toolchain details from build system

    Separate toolchain details from build system

    If you really want to go the extra mile in providing a good example of how modern CMake should be used, it's arguably a good idea to avoid mentioning the details of tools and tool chains (e.g. specific analysers, package managers, compiler flags etc.) from within the CMakeLists.txt files. Those files should be reserved for describing how the source fits together to make binary artefacts.

    The root CMakeLists.txt in particular is doing double duty as a script for enabling many, varied workflows. They could mostly/all be removed from CMake, or isolated into .cmake files which aren't invoked from CMakeLists.txt but are instead invoked using cmake in script mode. The ideal is achieving a clean separation between the build system and the other tools on display in this project.

    Examples:

    • All of the compiler options could be passing in via the cmake configuration command (e.g. using the language flags variables) or collected into toolchain files (example, more explanation). This makes it easier to add or extend tool chain support.
    • The build system could be made package manager-agnostic by removing all reference to Conan. A clean separation is generally encourage by the Conan team, and it's straightforward to achieve using generators such as cmake_find_package.
    • Tools like Clang-Tidy can be enabled from outside the CMakeLists.txt files for cleaner separation.

    In general, if a variable starts with CMAKE_, then it's ideally passed into the build system, rather than set from inside of it.

    wontfix 
    opened by johnmcfarlane 12
  • WIP Feature/add non root user in dev container

    WIP Feature/add non root user in dev container

    Make docker dev container safer to use by logging to a non-root user as described here https://aka.ms/vscode-remote/containers/non-root . Clean up some defaulted arguments. Install cmake_format in the container

    opened by Jason5480 11
  • Have built binaries be generated to 'build/bin/' instead of 'build/src/'

    Have built binaries be generated to 'build/bin/' instead of 'build/src/'

    I find it annoying/confusing that the binaries are generated in builtd/src.

    I'm suggesting a (very!) simple change to have it output to build/bin which makes more sense and should be easier to grasp for newcomers and beginners.

    opened by ShadowMitia 11
  • Catch2 not found: case-insensitive filesystem

    Catch2 not found: case-insensitive filesystem

    On macOS: When I do mkdir build-cpp_starter_project && cd build-cpp_starter_project && cmake ../cpp_starter_project I get

    ...
    ERROR: Requested 'catch2/2.11.0' but found case incompatible 'Catch2'
    Case insensitive filesystem can't manage this
    CMake Error at /Users/benfrantzdale/code/other/build-cpp_starter_project/conan.cmake:402 (message):
      Conan install failed='1'
    Call Stack (most recent call first):
      /Users/benfrantzdale/code/other/build-cpp_starter_project/conan.cmake:497 (conan_cmake_install)
      cmake/Conan.cmake:16 (conan_cmake_run)
      CMakeLists.txt:65 (run_conan)
    

    If I delete my ~/.conan directory, it builds, but then when I go to make I get

     $ make
    Scanning dependencies of target catch_main
    [ 10%] Building CXX object test/CMakeFiles/catch_main.dir/catch_main.cpp.o
    In file included from /Users/benfrantzdale/code/other/cpp_starter_project/test/catch_main.cpp:3:
    /Users/benfrantzdale/.conan/data/catch2/2.11.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/catch2/catch.hpp:482:63: error: expected ';' at end of declaration list
            SourceLineInfo( char const* _file, std::size_t _line ) noexcept
                                                                  ^
    ...
    /Users/benfrantzdale/.conan/data/catch2/2.11.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/catch2/catch.hpp:640:63: error: expected ';' at end of declaration list
            auto substr( size_type start, size_type length ) const noexcept -> StringRef;
                                                                  ^
    /Users/benfrantzdale/.conan/data/catch2/2.11.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/catch2/catch.hpp:643:9: error: 'auto' not allowed in function return type
            auto data() const noexcept -> char const*;
            ^~~~
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    make[2]: *** [test/CMakeFiles/catch_main.dir/catch_main.cpp.o] Error 1
    make[1]: *** [test/CMakeFiles/catch_main.dir/all] Error 2
    make: *** [all] Error 2
    $
    

    which makes it look like it's trying to build catch2 but isn't in C++17 mode. FWIW, https://github.com/bugwelle/cpp-starter-project works (and is why my Conan had Catch2).

    opened by BenFrantzDale 11
  • Feature/cross ide cmake presets

    Feature/cross ide cmake presets

    As discussed with @ddalcino in #161 It would be nice to have a cross IDE project configuration. Now this is available through CMakePresets.json file. A relative new CMake feature introduced in version 3.19 and it is already usable by VS2022 and VSCode and CLion(not tested) in version 3.21. QtCreator will follow soon! I can verify that this work in Windows PC:

    • using Visual Studio 2022 and msvc compiler in Local machine
    • using Visual Studio 2022 and a WSL Ubuntu18.04, Ubuntu20.04 with both gcc and clang
    • using VS Code and msvc compiler in Local machine
    • using VS Code and the Docker image provided in this repo Ubuntu18.04 both with gcc and clang

    It would be nice if a Linux user with CLion and VSCode installe can also verify that this work as expected (@lefticus :))

    • [x] In his Local machine using both gcc and clang in VS Code
    • [x] In his Local machine using both gcc anf clang in CLion (probably more vendor specific options are needed as described here.
    • [x] using VSCode and the Docker image gcc and clang
    • [x] any other inception concept

    Also it would be nice to have some feedback (input and thoughts) from @midnightexigent and @shreyasbharath who implemented #60 and #99 and have experience with VSCode and Docker.

    EDIT: Dockerfile is updated to also support ubuntu focal and the most recent gcc and clang versions (always configurable when build the image). New ${VARIANT} equal to [bionic, focal] should do the job like GCC_VER, LLVM_VER and USE_CLANG

    opened by Jason5480 9
  • Test using setup-python directly for common packages

    Test using setup-python directly for common packages

    • gcovr, conan, ninja, cmake are all fully supported with pip install on all 3 platforms
    • using setup-python and pip3 directly removes one variable from the build process
    • using pip3 directly to install all 3 provides consistency across platforms
    opened by lefticus 8
  • Doxygen was removed?

    Doxygen was removed?

    Hello, I've seen traces of Doxygen on the repo, and on the older version of ccp_starter_project there was a Doxygen.cmake file.

    Is it removed? It's deprecated? I can't find any information on this matter.

    Thanks.

    opened by viniciusferrao 0
  • Imgui examples.

    Imgui examples.

    Imgui and Imgui with docking is in Conan. We could add a small example project using opengl for people to try. I started with an older version of this project that had sfml and imgui. I see that is removed now. I think unless I get busy I'll try to make something and create a pull request. If you guys think this is a good or bad idea let me know. https://conan.io/center/imgui imgui/cci.20220207+1.87.docking imgui/1.87 https://github.com/ocornut/imgui/issues/2109 The docking branch adds alot of nice features to imgui like multiple windows that can be dragged in and out of the main window and be docked multiple ways.

    opened by Sebanisu 0
  • CI Failures on Ubuntu and Windows

    CI Failures on Ubuntu and Windows

    It appears that CI has been failing on all the Ubuntu actions and 2 of the Windows actions since last commit approximate 8 days ago. The commit is only a README.md change, so I suspect there has been environment changes from Github actions' side.

    https://github.com/cpp-best-practices/gui_starter_template/actions/runs/2324681616

    The CI failures are re-producible when you create a project using this project as a template.

    opened by rudikershaw 1
  • Doesn't work with openssl dependency

    Doesn't work with openssl dependency

    Hi I tried to use this however when I add openssl as a dependency it does not compile on windows. I used the template to create a new repo and the only thing I changed was to add openssl: commit

    It then fails all windows builds e.g.: Test (windows-2022, msvc, Visual Studio 17 2022, Debug, On)

    The system cannot find the path specified.
    NMAKE : fatal error U1077: '""C:\Program' : return code '0x1'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.32.31326\bin\HostX64\x64\nmake.exe"' : return code '0x2'
    Stop.
    openssl/3.0.2: ERROR: Package 'b825442d207960b823bd79a908463d7bacb58f1a' build failed
    openssl/3.0.2: WARN: Build folder D:\a\justAOpenSSLCompileTest\justAOpenSSLCompileTest\conan-cache\.conan\data\openssl\3.0.2\_\_\build\b825442d207960b823bd79a908463d7bacb58f1a
    ERROR: openssl/3.0.2: Error in build() method, line 612
    	self._make()
    while calling '_make', line 564
    	self._run_make()
    while calling '_run_make', line 536
    	self.run(" ".join(command), win_bash=self._win_bash)
    	ConanException: Error 2 while executing nmake
    CMake Error at build/conan.cmake:638 (message):
      Conan install failed='1'
    Call Stack (most recent call first):
      build/_deps/_project_options-src/src/Conan.cmake:61 (conan_cmake_install)
      build/_deps/_project_options-src/src/Index.cmake:212 (run_conan)
      build/_deps/_project_options-src/src/DynamicProjectOptions.cmake:147 (project_options)
      CMakeLists.txt:100 (dynamic_project_options)
    

    If I just use a minimal conanfile.txt:

    [requires]
    openssl/3.0.2
    
    [generators]
    cmake_find_package_mult
    

    And call conan install . --install-folder build --build=missing -s build_type=Debug -s cppstd=20 it all works fine.

    It seems to me that somehow the parameters that are passed to conan are wrong

    opened by DominicD 5
  • Env variables left in cache causes gcc-11 builds on ubuntu to fail

    Env variables left in cache causes gcc-11 builds on ubuntu to fail

    Hey! I freshly forked your template on my github account, but the initial commit doesn't pass the CI checks for ubuntu with gcc-11.

    It seems that some cached env variables are resurfacing during the "Configure CMake" step of the workflow, causing gcc to try to use clang includes, thus causing compile errors because of non-existent preprocessor defs (like __has_include())

    "7_Configure CMake.txt" logs: 2022-05-12T15:26:59.9540894Z` LLVM_PATH: /opt/hostedtoolcache/llvm/13.0.0/x64 2022-05-12T15:26:59.9541186Z LD_LIBRARY_PATH: /opt/hostedtoolcache/llvm/13.0.0/x64/lib: 2022-05-12T15:26:59.9541494Z DYLD_LIBRARY_PATH: /opt/hostedtoolcache/llvm/13.0.0/x64/lib: 2022-05-12T15:26:59.9541805Z CPATH: /opt/hostedtoolcache/llvm/13.0.0/x64/lib/clang/13.0.0/include 2022-05-12T15:26:59.9542101Z LDFLAGS: -L/opt/hostedtoolcache/llvm/13.0.0/x64/lib 2022-05-12T15:26:59.9542388Z CPPFLAGS: -I/opt/hostedtoolcache/llvm/13.0.0/x64/include 2022-05-12T15:26:59.9542677Z LIBRARY_PATH: /opt/hostedtoolcache/llvm/13.0.0/x64/lib

    Sadly that's as far as my (non-existing) github actions skills could take me and I couldn't find what sets those environment variables...

    Thanks a lot for your templates, they are amazing!

    opened by marques-bruno 0
Owner
Jason Turner
Host of C++ Weekly YouTube series, co-host of CppCast C++ podcast.
Jason Turner
A template for modern C++ projects using CMake, Clang-Format, CI, unit testing and more, with support for downstream inclusion.

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

Filip Dutescu 1.1k Jul 31, 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
Pitchfork is a Set of C++ Project Conventions

Pitchfork Pitchfork is a set of conventions for native C and C++ projects. The most prominent being the project layout conventions. The layout specifi

null 696 Jul 31, 2022
Starter project for cross platform WebGPU development in C++

A starter code for cross-platform (i.e., web & native) C++ WebGPU projects.

Will Usher 30 Jul 20, 2022
Arduino sample code to help you get started using the Soracom IoT Starter Kit!

Soracom IoT Starter Kit The Soracom IoT Starter Kit includes everything you need to build your first connected device. It includes an Arduino MKR GSM

Soracom Labs 13 Jul 30, 2022
Learn how to connect your Flexispot (LoctekMotion) desk to the internet. This repository contains a collection of scripts to get your started, combined with research and instructions.

(image source: Windows Central) Turn your LoctekMotion/FlexiSpot desk into a smart desk Recently I acquired a new standing desk from FlexiSpot. During

Mick Vleeshouwer 158 Jul 27, 2022
A repo for helping people get started with Competitive Programming and Data Structures & Algorithms

Hack CP DSA Update regarding hacktoberfest: please refer this announcement Wanna improve your problem solving skills ❓ Wanna practice collaborating on

TLE MEC 172 Jul 22, 2022
This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.

100/100 Introduction to ft_printf This is the third project in the 1337 Curriculum #42network . This project is pretty straight forward, recode the pr

Zakaria Yacoubi 4 May 27, 2022
Simple, fast, easy to get started mid-level game engine written in Zig

Alka Game engine written in zig, compatible with master branch. This engine does provide a toolset for you but generally you have to implement how the

Kiakra 21 Jul 27, 2022
Lets be creative this hacktober fest. Get started with contributing to open source.

Be Creative this Hacktoberfest 2021 Lets be creative this hacktober fest. Get started with contributing to open source. ?? Web-Ideas ?? How Can I Cont

B L A C K F U R Y 10 Nov 20, 2021
This is a fork of prboom+ with extra tooling for demo recording and playback, with a focus on speedrunning.

dsda-doom v0.15.1 This is a fork of prboom+ with extra tooling for demo recording and playback, with a focus on speedrunning. Heretic Support (beta) D

Ryan Krafnick 103 Aug 6, 2022
Local OXID Resolver (LCLOR) : Research and Tooling

hazmat5 Local OXID Resolver (LCLOR) : Research and Tooling Welcome to a repository on my research into DCOM's Local OXID Resolution mechanisms, and RP

Alex Ionescu 25 Jun 23, 2022
Tooling and Scripts for Hacking Super Street Fighter II Cabinets

sf-cabinet Tools and utilities for modifying SF2 Cabinets What This repository contains research and tooling around the mini Street Fighter 2 cabinet

wrongbaud 12 Apr 14, 2022
3DO M2 Portfolio OS v3.0 and tooling source dump

3DO M2 Portfolio OS v3.0 The 3DO Opera platform ran an OS called Portfolio. Developed internally at NTG/3DO by several of the same people who develope

null 14 Feb 17, 2022
This repo is for competitive coders. In the readme file you will get the list of questions. You can contribute by adding your solutions or by providing the optimized solutions which are answered already.

Hello, Problem Solvers !!! ?? What it's about? ??‍?? This repository is for Competitive Coders to get started with Open-source. ?? We have curated a l

null 2 Oct 22, 2021
Bear is a tool that generates a compilation database for clang tooling.

ʕ·ᴥ·ʔ Build EAR Bear is a tool that generates a compilation database for clang tooling. The JSON compilation database is used in the clang project to

László Nagy 2.8k Aug 5, 2022
Get Next Line is a project at 42. It is a function that reads a file and allows you to read a line ending with a newline character from a file descriptor

Get Next Line is a project at 42. It is a function that reads a file and allows you to read a line ending with a newline character from a file descriptor. When you call the function again on the same file, it grabs the next line

Mhamed Ajjig 3 May 17, 2022
Some hypervisor research notes. There is also a useful exploit template that you can use to verify / falsify any assumptions you may make while auditing code, and for exploit development.

Introduction Over the past few weeks, I've been doing some hypervisor research here and there, with most of my focus being on PCI device emulation cod

Faith 123 Jun 30, 2022
A template C project using CMAKE, logging library and basic memory handling.

C Project template Aim of this Repository is to create a template repository for C executable projects with following properties: Cmake project Loggin

Aditya Singh Rathore 6 May 23, 2022
FSD-Template - A template UE4.25 project for BP modding.

FSD-Template Project generated by Archengius' UE4 Template Generator. Reflected C++ classes generated by CheatingMuppet & Archengius' UE4SS UHT Genera

null 12 Aug 3, 2022
this is a repo of where you will get to see tic tac toe AI intregrated project

?? Tic-Tac-Toe-AI-Intregrated ?? What is the meaning of AI Intregrated ??‍♀️ ??‍♂️ ❓ ❓ You all have Played Tic Tac Toe in your life if you don't know

Ujjwal 14 Jun 25, 2022
Now get your alerts & updates about home, wherever you are, with an SMS on your mobile! All with a simple NodeMCU project!

Now get your alerts & updates about home, wherever you are, with an SMS on your mobile! All with a simple NodeMCU project!

Priyanka Peddinti 2 Oct 20, 2021
Template for reliable, cross-platform C++ project setup using cmake.

The C++ CMake Project Template cmake-init is a sophisticated copy & paste template for modern C and C++ projects. The main goals include support of al

CG Internals 789 Aug 3, 2022
Get dependencies with cmake

cmake-get A cmake module to get dependencies. This module can be used in config mode or in script mode. Installation The module is just one file 'CMak

Paul Fultz II 59 Feb 14, 2022
Had a tough time playing Microsoft Wordament ? Well WORDament_Solver has your back. It suggests you meaningful words you can use while playing the game and help you top the leaderboard.

WORDament_Solver Had a tough time playing Microsoft Wordament ? Well WORDament_Solver has your back. It suggests you meaningful words you can use whil

Tushar Agarwal 3 Aug 19, 2021
Just getting started with Data Structure and Algorithms? Make your first contribution here and start the journey of learning DSA.

Getting Started ! ✨ If you are just beginning with open source then let's make your first contribution in this repository ! Contributing Tutorial ?? P

amega 3 Apr 18, 2022
It's a simple and free x86_64 architecture operating system created by one person, GoofOS started since 2022

This project is while developing... GoofOS GoofOS is a text operating system for x86 computers. About This is a 32 bit x86_64 graphical operating syst

null 3 May 1, 2022
You may learn how to make successful pull requests and get your first valid open source contribution by using this repository.

Your-First-Contribution You may learn how to make successful pull requests and get your first valid open source contribution by using this repository.

Veshraj Ghimire 25 Jul 31, 2022
GTOS (Growtopia Private Server)'s latest source, everyone started selling so I decided to releasing it on github, enjoy it without spending your dls on that.

GTOSLatest GTOS (Growtopia Private Server)'s latest source, everyone started selling so we (Erben#1337 and Kaan#1337) decided to releasing it on githu

Kaan 19 Jul 13, 2022