{"id":14984820,"url":"https://github.com/sheepgrass/cpp_project_framework","last_synced_at":"2025-04-10T22:38:26.866Z","repository":{"id":44556881,"uuid":"294607981","full_name":"sheepgrass/cpp_project_framework","owner":"sheepgrass","description":"C++ Project Framework is a framework for creating C++ project.","archived":false,"fork":false,"pushed_at":"2023-06-10T07:37:29.000Z","size":287,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-03T09:22:23.452Z","etag":null,"topics":["c-plus-plus","cmake","conan","cpp","cross-platform","doxygen","doxygen-documentation","framework","google-test","gtest","jenkins","jenkins-pipeline","project","unit-test"],"latest_commit_sha":null,"homepage":"https://sheepgrass.github.io/cpp_project_framework/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheepgrass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-11T06:01:27.000Z","updated_at":"2024-03-21T17:11:33.000Z","dependencies_parsed_at":"2024-09-24T15:30:03.318Z","dependency_job_id":null,"html_url":"https://github.com/sheepgrass/cpp_project_framework","commit_stats":{"total_commits":216,"total_committers":1,"mean_commits":216.0,"dds":0.0,"last_synced_commit":"07cf2aa27b9d9996ac855750eb436e46ccd54561"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepgrass%2Fcpp_project_framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepgrass%2Fcpp_project_framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepgrass%2Fcpp_project_framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheepgrass%2Fcpp_project_framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheepgrass","download_url":"https://codeload.github.com/sheepgrass/cpp_project_framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239284906,"owners_count":19613544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cmake","conan","cpp","cross-platform","doxygen","doxygen-documentation","framework","google-test","gtest","jenkins","jenkins-pipeline","project","unit-test"],"created_at":"2024-09-24T14:09:43.042Z","updated_at":"2025-02-18T03:31:56.904Z","avatar_url":"https://github.com/sheepgrass.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ Project Framework\n\nC++ Project Framework is a framework for creating C++ project.\n\n## Canonical Project Structure for C++\n\nCanonical Project Structure:\n\u003chttp://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1204r0.html\u003e\n\nThe Pitchfork Layout:\n\u003chttps://api.csswg.org/bikeshed/?force=1\u0026url=https://raw.githubusercontent.com/vector-of-bool/pitchfork/develop/data/spec.bs\u003e\n\n```c++\n\u003cname\u003e/\n├── \u003cname\u003e/\n│   └── ...\n├── \u003cmodule\u003e/\n│   ├── \u003cmodule\u003e.h        // header file containing mainly module declarations\n│   ├── \u003cmodule\u003e.hpp      // header file containing module declarations and/or definitions\n│   ├── \u003cmodule\u003e.cpp      // source file containing module definitions\n│   ├── \u003cmodule\u003e.test.cpp // source file containing module unit tests\n│   └── main.cpp          // source file containing the main function for exe\n├── ...\n└── tests/ // functional/integration tests\n    ├── benchmarks/ // benchmark/performance tests\n    │   ├── \u003cbenchmark\u003e/\n    │   │   └── \u003cbenchmark\u003e.benchmark.cpp // source file containing module benchmark tests\n    │   └── ...\n    └── ...\n```\n\n## Prerequisites\n\n```yaml\nBuild System Generator: CMake \u003e= 3.10\nBuild System: GNU Make \u003e= 4.2 (Linux), MSBuild \u003e= 14.0 (Visual Studio 2015) (Windows)\nCompiler: g++ \u003e= 9.1 (Linux), MSVC \u003e= 14.0 (Visual Studio 2015) (Windows)\nVersion Control System (VCS): Git \u003e= 2.16\nPackage Manager Scripting: Python \u003e= 3.6\nC++ Standard: \u003e= C++14\n```\n\n## Optional Prerequisites\n\n```yaml\nIntegrated Development Environment (IDE): Visual Studio Code \u003e= 1.49\nVisual Studio Code Extensions:\n    C/C++ \u003e= 1.0.1\n    C++ Intellisense \u003e= 0.2.2\n    Clang-Format \u003e= 1.9.0\n    CMake \u003e= 0.0.17\n    CMake Tools \u003e= 1.4.2\n    Python \u003e= 2020.8\n    Remote - SSH \u003e= 0.55.0\n    Remote Development \u003e= 0.20.0\n    GitLens \u003e= 10.2.2\n    Doxygen Documentation Generator \u003e= 1.1.0\n    C++ TestMate \u003e= 3.6.23\n    Five Server (Live Server) \u003e= 0.0.34\nContinous Integration (CI): Jenkins \u003e= 2.319.1\nJenkins Running: Java 8 or 11 (OpenJDK JDK/JRE 8 or 11) \u003e= 1.8.0\nJenkins Plugins:\n    Locale \u003e= 1.4\n    Pipeline \u003e= 2.6\n    Git \u003e= 4.10.1\n    Blue Ocean \u003e= 1.25.2\n    xUnit \u003e= 3.0.5\n```\n\n## Recommended C++ Development Environment\n\n\u003chttps://www.reddit.com/r/cpp/comments/af74l1/recommendations_for_setting_up_a_modern_c_dev/\u003e\n\n```yaml\nbuild system generator: CMake\nbuild system: Ninja\ncompiler: clang++ (cross-platform), MSBuild/MSVC (Windows), g++ (Linux)\nIntegrated Development Environment (IDE): Visual Studio Code, Qt Creator\nstatic code analyzers: clang-tidy, Cppcheck, Clazy\nsource code formatter: clang-format\nsource code documentation generator: Doxygen\nsoftware distribution packaging system: CPack\nC++ libraries:\n    general-purpose: C++ Standard Library\n    general-purpose: Boost C++ Libraries\n    string formatting: fmt\n    logging: spdlog\n    automated testing: Google Test / Google Mock\n    graphical user interface (GUI): Qt\npackage manager: Conan, vcpkg\ncontinuous integration (CI): Jenkins, CDash\nversion control system (VCS): Git\ncode coverage: OpenCppCoverage (Windows), gcov + gcovr (Linux)\n```\n\n## Chosen C++ Development Environment\n\n\u003chttps://en.cppreference.com/w/cpp/compiler_support\u003e\n\n```yaml\n# Required (manual install)\nBuild System Generator: CMake \u003e= 3.10\nBuild System: GNU Make \u003e= 4.2 (Linux), MSBuild \u003e= 14.0 (Visual Studio 2015) (Windows)\nCompiler: g++ \u003e= 9.1 (Linux), MSVC \u003e= 14.0 (Visual Studio 2015) (Windows)\nVersion Control System (VCS): Git \u003e= 2.16\nPackage Manager Scripting: Python \u003e= 3.6 (or Anaconda3 on Windows)\nC++ Standard: \u003e= C++14\n\n# Required (distributed with manual installed tools)\nTesting Tool: CTest (CMake)\nSoftware Distribution Packaging System: CPack (CMake)\nPython Package Installer: pip \u003e= 9.0 (Python)\n\n# Required (auto installed by C++ Project Framework)\nPackage Manager: Conan (pip)\nCode Coverage Report: gcovr (pip), OpenCppCoverage (Windows)\n\n# C++ Libraries\nGeneral Purpose: C++ Standard Library (compiler included)\nGeneral Purpose: Boost (boost)\nUnit Test Framework: Google Test (gtest)\nLogging: Boost Log (boost::log)\nEmbedded Local Key-Value Store: RocksDB (rocksdb)\nEmbedded Local SQL Database:  SQLite (sqlite)\n\n# Optional\nIntegrated Development Environment (IDE): Visual Studio Code \u003e= 1.49\nSource Code Documentation Generator: Doxygen \u003e= 1.8\nGraphical User Interface: Qt\nContinous Integration (CI): Jenkins \u003e= 2.319.1\nDebugger: gdb (Linux), WinDbg (Windows), Visual Studio Debugger (Windows)\nPerformance Profiler: perf (Linux), gprof (Linux), orbit (Linux, Windows)\nSource Code Formatter: ClangFormat (clang-format)\n```\n\n## Similar Projects Creating C++ Project Framework\n\nPitchfork\n\u003chttps://github.com/vector-of-bool/pitchfork\u003e\n\n```yaml\nPitchfork is a set of conventions for native C and C++ projects. The most prominent being the project layout conventions.\n```\n\nBoiler plate for C++ projects\n\u003chttps://github.com/bsamseth/cpp-project\u003e\n\n```yaml\nThis is a boiler plate for C++ projects. What you get:\n\nSources, headers and mains separated in distinct folders\nUse of modern CMake for much easier compiling\nSetup for tests using doctest\nContinuous testing with Travis-CI and Appveyor, with support for C++17.\nCode coverage reports, including automatic upload to Coveralls.io and/or Codecov.io\nCode documentation with Doxygen\n```\n\ncpp-project-template\n\u003chttps://github.com/Bo-Yuan-Huang/cpp-starter\u003e\n\n```yaml\nThis is a starting template for C++ projects that supports:\n\nHierarchical sources and headers\nAccess to Google Tests\nUse of CMake for much easier compiling\nCode documentation with Doxygen\nContinuous testing with Travis-CI\nCode coverage with Coveralls.io\nStatic analysis with Coverity Sacn\n```\n\nC++ Project Template\n\u003chttps://github.com/TimothyHelton/cpp_project_template\u003e\n\n```yaml\nWhen setting out on a new project in C++ there are a few configuration steps which need to be completed prior to actually getting down to writing code. This repository is going to be a C++ project template that already has the following components:\n\nDirectory Structure\nMake Build (CMake)\nUnit Test Framework (Google Test)\nAPI Documentation (Doxygen)\n```\n\nmoderncpp-project-template\n\u003chttps://github.com/madduci/moderncpp-project-template\u003e\n\n```yaml\nThis repository aims to represent a template for Modern C++ projects, including static analysis checks, autoformatting, a BDD/TDD capable test-suite and packaging\n\nRequirements\na modern C++17 compiler (gcc-8, clang-6.0, MSVC 2017 or above)\ncmake 3.10+\nconan 1.4+\nconan_package_tools (optional)\ncppcheck (optional)\nclang-format (optional)\nclang-check (optional)\n\nFeatures\nCMake-based project management, including dependencies\nConan support for dependency management in CMake, completely optional\nAdditional tools such as clang-format and cppcheck\nSupport for shared/static libraries, including generation of export information\nBasic CPack configuration for redistributables\nGitHub Actions\n```\n\nCMake-Jenkins-CPP Framework\n\u003chttps://github.com/planetpratik/CMake-Jenkins-CPP\u003e\n\n```yaml\nA Cross-Platform Modern C++ Project Framework Set Up Using CMake, Jenkins \u0026 Vcpkg\n\nGoals :-\nTo create a Cross-Platform C++ project framework using CMake which follows same project structure as FieaGameEngine Project ( originally developed using Visual Studio 2017 ).\nTo support Continuous Integration using Jenkins.\nTo support better dependency management using Vcpkg as a package manager.\nTo be easily able to bootstrap cross-platform C++ project using CMake \u0026 Jenkins with minimum efforts.\n```\n\n## Useful Resources for C++\n\ncppreference\n\u003chttp://www.cppreference.com/\u003e\n\n```yaml\nOur goal is to provide programmers with a complete online reference for the C and C++ languages and standard libraries, i.e. a more convenient version of the C and C++ standards.\n```\n\ncplusplus\n\u003chttps://www.cplusplus.com/\u003e\n\n```yaml\nDescription of the most important classes, functions and objects of the Standard Language Library, with descriptive fully-functional short programs as examples\n```\n\nC++ Papyrus - C++ Annotations about Modern C++\n\u003chttps://github.com/caiorss/C-Cpp-Notes\u003e\n\n```yaml\nThis repository contains annotations and examples about moodern C++, system programming and building systems for C and C++.\n```\n\nAwesome C++\n\u003chttps://github.com/fffaraz/awesome-cpp\u003e\n\u003chttps://awesome-cpp.readthedocs.io/en/latest/README.html\u003e\n\n```yaml\nA curated list of awesome C++ (or C) frameworks, libraries, resources, and shiny things. Inspired by awesome-... stuff.\n```\n\n## Package C++ Project Framework Python Project\n\n[How To Package Your Python Code](https://python-packaging.readthedocs.io/en/latest/index.html)\n\n[Packaging Python Projects](https://packaging.python.org/tutorials/packaging-projects/)\n\n[Building and Distributing Packages with Setuptools](https://setuptools.pypa.io/en/latest/userguide/index.html)\n\n[What Are Python Wheels](https://realpython.com/python-wheels/)\n\nGo to `cpp_project_framework` root folder first, activate python virtual evironment (create it if not yet created), then follow below procedures:\n\n### Install C++ Project Framework Python Package Locally\n\n```bash\n# Upgrade pip to latest version\npython -m pip install --upgrade pip\n\n# Install the package locally\npython -m pip install .\n```\n\n### Generate C++ Project Framework Python Distribution Archives\n\n```bash\n# Upgrade PyPA's build to latest version\npython -m pip install --upgrade build\n\n# Generate distribution archives in dist directory\npython -m build\n\n# Check the generated archives\nls dist\ncpp_project_framework-1.0.0-py3-none-any.whl\ncpp_project_framework-1.0.0.tar.gz\n```\n\nThe `tar.gz` file is a source archive whereas the `.whl` file is a built distribution.\n\n### Upload Generated C++ Project Framework Python Distribution Archives to Test Python Package Index (TestPyPI)\n\n```bash\n# Upgrade PyPI's twine to latest version\npython -m pip install --upgrade twine\n\n# Upload all of the arhives under dist directory to TestPyPI\npython -m twine upload --repository testpypi dist/*\n```\n\n### Install C++ Project Framework Python Package from TestPyPI\n\n```bash\n# Upgrade pip to latest version\npython -m pip install --upgrade pip\n\n# Install the package from TestPyPI\npython -m pip install --index-url https://test.pypi.org/simple/ --no-deps cpp_project_framework\n```\n\n## Create New C++ Project by Python Script with Template\n\nAfter installed the C++ project framework python package (namely `cpp_project_framework`), input the required parameters as prompted in below python script and a new C++ project with `C++ Project Framework` project structure will be created:\n\nMethod 1 (by calling C++ project framework python module):\n\n```bash\npython -m cpp_project_framework.create_new_project\n```\n\nMethod 2 (by running C++ project framework python script):\n\n```bash\ncreate_new_cpp_project\n```\n\n## Visual Studio CMake Settings\n\n[CMake projects in Visual Studio](https://docs.microsoft.com/en-gb/cpp/build/cmake-projects-in-visual-studio)\n\n[CMakeSettings.json schema reference](https://docs.microsoft.com/en-gb/cpp/build/cmakesettings-reference)\n\n### Allow Building in Different Directories per Build Type\n\nProject \u003e CMake Settings\n\nCMakeSettings.json\n\n```json\n{\n    \"buildRoot\": \"${projectDir}\\\\${configurationType}\"\n}\n```\n\n## Visual Studio Code CMake Tools Settings\n\n[Configuring CMake Tools](https://vector-of-bool.github.io/docs/vscode-cmake-tools/settings.html)\n\n### Allow Building in Different Directories per Build Type\n\n\u003chttps://github.com/microsoft/vscode-cmake-tools/issues/151\u003e\n\nFile \u003e Preferences \u003e Settings \u003e Extensions \u003e CMake Tools \u003e Cmake: Build Directory\n\n.vscode/settings.json\n\n```json\n{\n    \"cmake.buildDirectory\": \"${workspaceFolder}/${buildType}\"\n}\n```\n\n## Visual Studio Code C++ Include Path Setting\n\n.vscode/c_cpp_properties.json\n\n```json\n{\n    \"configurations\": [\n        {\n            \"includePath\": [\n                \"${workspaceFolder}/**\",\n                \"~/.conan/data/**\"\n            ],\n            \"windowsSdkVersion\": \"10.0.10240.0\"\n        }\n    ]\n}\n```\n\n## Manually Specify a Python Interpreter\n\n\u003chttps://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter\u003e\n\nFile \u003e Preferences \u003e Settings \u003e Extensions \u003e Python \u003e Python: Default Interpreter Path\n\n.vscode/settings.json\n\n```json\n{\n    \"python.defaultInterpreterPath\": \"./.venv/bin/python\"\n}\n```\n\n## C++ TestMate Visual Studio Code Extension for Test Explorer Setting\n\nFile \u003e Preferences \u003e Settings \u003e Extensions \u003e C++ TestMate \u003e TestMate \u003e Cpp \u003e Tests: Executables\n\n.vscode/settings.json\n\n```json\n{\n    \"testMate.cpp.test.executables\": \"{build,Build,BUILD,out,Out,OUT,Debug,Release}/**/*{test,Test,TEST}*\"\n}\n```\n\n## C++ Code Formatting using Visual Studio Code with ClangFormat\n\n\u003chttps://code.visualstudio.com/docs/cpp/cpp-ide#_code-formatting\u003e\n\n\u003chttps://clang.llvm.org/docs/ClangFormatStyleOptions.html\u003e\n\nFormat an entire file with Format Document (Shift+Alt+F) or just the current selection with Format Selection (Ctrl+K Ctrl+F) in right-click context menu.\n\n### Create ClangFormat File inside Visual Studio Code Workspace\n\n```yaml\n# .clang-format\nUseTab: Never\nIndentWidth: 4\nBreakBeforeBraces: Allman\nAllowShortIfStatementsOnASingleLine: false\nIndentCaseLabels: false\nColumnLimit: 0\nPointerAlignment: Left\nAccessModifierOffset: -4\n```\n\n## Setup Remote SSH for Visual Studio Code\n\n\u003chttps://code.visualstudio.com/docs/remote/ssh\u003e\n\nStart by selecting `Remote-SSH: Add New SSH Host...` from the Command Palette (`F1`, `Ctrl+Shift+P`) or clicking on the `Add New` icon in the SSH `Remote Explorer` in the Activity Bar.\n\n%USERPROFILE%/.ssh/config\n\n```\nHost curtis@127.0.0.1:10022\n  HostName ubuntu\n  User curtis\n  Port 10022\n  IdentityFile %USERPROFILE%\\\\.ssh\\\\id_rsa\n```\n\n### Generate SSH Key Pair\n\n\u003chttps://code.visualstudio.com/docs/remote/troubleshooting#_quick-start-using-ssh-keys\u003e\n\n\nOn Linux SSH Server Side:\n\n```bash\n# Linux\ncd ~/.ssh\nssh-keygen -t rsa -b 4096\ncat id_rsa.pub \u003e\u003e authorized_keys\nchmod 644 authorized_keys\n```\n\n`id_rsa.pub` is the **`public`** key generated and `id_rsa` is the **`private`** key generated.\n`authorized_keys` is the file with keys that SSH server accepted for.\n\nOn Windows SSH Client Side:\n\nCopy `id_rsa` from `~/.ssh/id_rsa` on Linux SSH server side to `%USERPROFILE%/.ssh/id_rsa` on Windows SSH client side.\n\n## Setup Git\n\n\u003chttps://stackoverflow.com/questions/68775869/support-for-password-authentication-was-removed-please-use-a-personal-access-to\u003e\n\n### Configure Git Client User\n\n```bash\ngit config --global user.name \"Curtis Lo\"\ngit config --global user.email \"github_email\"\ngit config -l\n```\n\n### Clone Git Repository\n\n```bash\ngit clone https://github.com/sheepgrass/cpp_project_framework.git\n```\n\n### Remember Git Credential\n\n```bash\ngit config --global credential.helper cache\n```\n\n## Install Build Essential (GCC, Make)\n\n```bash\n# Linux (Ubuntu)\nsudo apt install build-essential\n```\n\n## Install CMake\n\n```bash\n# Linux (Ubuntu)\nsudo apt-get install cmake\n```\n\n## Create Python Virtual Environment under Current Project\n\n```bash\n# Linux\npython3 -m venv .venv\nsource .venv/bin/activate\n...\ndeactivate\n```\n\n```cmd\n# Windows\n%LOCALAPPDATA%\\Continuum\\anaconda3\\python.exe -m venv .venv\n.venv\\Scripts\\activate\n...\ndeactivate\n```\n\n## Install Conan\n\n\u003chttps://docs.conan.io/en/latest/installation.html\u003e\n\n```bash\nsource .venv/bin/activate\npip install -U conan\nconan\n```\n\n## Search for Repository (Package Recipes) in ConanCenter\n\n\u003chttps://conan.io/center\u003e\n\n```bash\nconan search --remote=conan-center g3log\nconan inspect g3log/1.3.3\n```\n\n## Create Conan File\n\n\u003chttps://docs.conan.io/en/latest/getting_started.html\u003e\n\n```ini\n# conanfile.txt\n[requires]\n\n[generators]\ncmake_multi\n```\n\n## Conan Multi-configuration Generator\n\n\u003chttps://docs.conan.io/en/latest/integrations/build_system/cmake/cmake_multi_generator.html\u003e\n\n## Conan for New GCC ABI\n\n[How to manage the GCC \u003e= 5 ABI](https://docs.conan.io/en/latest/howtos/manage_gcc_abi.html)\n\nWhen Conan creates the default profile the first time it runs, it adjusts the `compiler.libcxx` setting to `libstdc++` for backwards compatibility. However, if you are using GCC \u003e= 5 your compiler is likely to be using the new CXX11 ABI by default (`libstdc++11`).\n\nIf you want Conan to use the new ABI, edit the default profile at `~/.conan/profiles/default` adjusting `compiler.libcxx=libstdc++11` or override this setting in the profile you are using.\n\n```bash\n# Linux\nvim ~/.conan/profiles/default\n```\n\n```ini\n[settings]\nos=Linux\nos_build=Linux\narch=x86_64\narch_build=x86_64\ncompiler=gcc\ncompiler.version=9\ncompiler.libcxx=libstdc++11\nbuild_type=Release\n```\n\n## CMake Build Types\n\n```ini\nCMAKE_BUILD_TYPE=[Debug|Release|MinSizeRel|RelWithDebInfo]\n```\n\n## Install Required Dependencies by Conan\n\n\u003chttps://docs.conan.io/en/latest/reference/commands/consumer/install.html\u003e\n\n```bash\nconan install . -b missing -s build_type={CMAKE_BUILD_TYPE} -if {CMAKE_BUILD_TYPE}\n```\n\n## Conan Package Location\n\n```bash\n# Linux\n~/.conan/data\n```\n\n```cmd\n# Windows\n%USERPROFILE%\\.conan\\data\n```\n\n## Generate CMake Project\n\n\u003chttps://cmake.org/cmake/help/latest/manual/cmake.1.html#generate-a-project-buildsystem\u003e\n\n```bash\ncmake -S . -B {CMAKE_BUILD_TYPE} -DCMAKE_BUILD_TYPE={CMAKE_BUILD_TYPE} [-G \"Visual Studio 14 2015\" -A x64]\n```\n\n## Build CMake Project\n\n\u003chttps://cmake.org/cmake/help/v3.14/manual/cmake.1.html#build-a-project\u003e\n\n```bash\ncmake --build {CMAKE_BUILD_TYPE} [--clean-first -j4 -v]\n```\n\n## Build Specific Target of CMake Project\n\n\u003chttps://cmake.org/cmake/help/v3.14/manual/cmake.1.html#build-a-project\u003e\n\n```bash\ncmake --build {CMAKE_BUILD_TYPE} --target {CMAKE_BUILD_TARGET} [-j4 -v]\n```\n\n## Open CMake Generated Project\n\n\u003chttps://cmake.org/cmake/help/latest/manual/cmake.1.html#open-a-project\u003e\n\n```bash\ncmake --open {CMAKE_BUILD_TYPE}\n```\n\n## Generate CMake Installer by CPack\n\n\u003chttps://cmake.org/cmake/help/latest/manual/cpack.1.html#manual:cpack(1)\u003e\n\n```bash\ncd {CMAKE_BUILD_TYPE} \u0026\u0026 cpack -C {CMAKE_BUILD_TYPE} [-G ZIP]\n```\n\n## Create Conan Package Recipe\n\n\u003chttps://docs.conan.io/en/latest/creating_packages/getting_started.html\u003e\n\n```bash\nmkdir package \u0026\u0026 cd package\nconan new {CMAKE_PROJECT_NAME}/{CMAKE_PROJECT_VERSION} -t\n```\n\n## Create Conan Package\n\n\u003chttps://docs.conan.io/en/latest/creating_packages/getting_started.html\u003e\n\n```bash\nconan create . demo/testing\n```\n\n## Download Existing Package Recipe\n\n\u003chttps://docs.conan.io/en/latest/reference/commands/misc/download.html\u003e\n\n```bash\nconan download g3log/1.3.3@ -re\n```\n\n## Copy Existing Recipe and Package to Another User Channel\n\n\u003chttps://docs.conan.io/en/latest/reference/commands/misc/copy.html\u003e\n\n```bash\nconan copy g3log/1.3.3@ sheepgrass/modified\n```\n\n## Conan Center Index Recipes\n\n\u003chttps://github.com/conan-io/conan-center-index/tree/master/recipes\u003e\n\n## Modify Existing Package Recipe\n\n\u003chttps://docs.conan.io/en/latest/howtos/collaborate_packages.html\u003e\n\n\u003chttps://dmerej.info/blog/post/chuck-norris-part-4-python-ctypes/\u003e\n\n\u003chttps://stackoverflow.com/questions/63670642/cant-create-boost-conan-package-from-conan-center-index-conanfile-didnt-spec\u003e\n\n```bash\n# Linux\nmkdir g3log \u0026\u0026 cd g3log\nconan download g3log/1.3.3@ -re\ncp -rv ~/.conan/data/g3log/1.3.3/_/_/export/* .\ncp -rv ~/.conan/data/g3log/1.3.3/_/_/export_source/* .\nconan create . 1.3.3@sheepgrass/modified\nconan upload g3log/1.3.3@sheepgrass/modified --all -r=local\n```\n\n```cmd\n# Windows\nmkdir g3log \u0026\u0026 cd g3log\nconan download g3log/1.3.3@ -re\nxcopy %USERPROFILE%\\.conan\\data\\g3log\\1.3.3\\_\\_\\export\\* . /E\nxcopy %USERPROFILE%\\.conan\\data\\g3log\\1.3.3\\_\\_\\export_source\\* . /E\nconan create . 1.3.3@sheepgrass/modified\nconan upload g3log/1.3.3@sheepgrass/modified --all -r=local\n```\n\n### Create Patch File in Unified Diff Format for Existing Package using WinMerge\n\n\u003chttps://docs.conan.io/en/latest/reference/tools.html#tools-patch\u003e\n\n1. Set original source file as 1st file\n\n2. Set modified source file as 2nd file\n\n3. Compare them\n\n4. In menu, select \"Tools \u003e Generate Patch...\"\n\n5. Set \"Result\" to target patch file path and name with extension *.patch\n\n6. Set \"Format \u003e Style:\" to \"Unified\"\n\n7. Set \"Format \u003e Context:\" to \"3\"\n\n8. Set \"Whitespaces\" to \"Compare\"\n\n9. Uncheck \"Ignore blank lines\"\n\n10. Check \"Case sensitive\"\n\n11. Check \"Ignore carriage return differences (Windows/Unix/Mac)\"\n\n12. Click \"OK\" to generate patch file\n\n13. Modify patch file to make diff path relative to \"source_subfolder\"\n\n14. Add patch file to conandata.yml:\n\n    ```yaml\n    patches:\n    [version]:\n    - base_path: source_subfolder\n        patch_file: patches/?.patch\n    ```\n\n15. Calculate MD5 checksum for the patch file:\n\n    ```cmd\n    certutil -hashfile ?.patch md5\n    ```\n\n16. Add patch file to conanmanifest.txt:\n\n    ```txt\n    export_source/patches/?.patch: [md5]\n    ```\n\n17. Add patch files to export sources of conan recipe file conanfile.py:\n\n    ```python\n    exports_sources = [\"CMakeLists.txt\", \"patches/*\"]\n    ```\n\n18. Add patch snippet to conan recipe file conanfile.py:\n\n    ```python\n    if \"patches\" in self.conan_data and self.version in self.conan_data[\"patches\"]:\n        for patch in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**patch)\n    ```\n\n## Get List of Conan Repository Servers (Remotes) in Use\n\n\u003chttps://docs.conan.io/en/latest/uploading_packages/uploading_to_remotes.html\u003e\n\n```bash\nconan remote list\n```\n\n## Add Conan Repository Server (Remote)\n\n```bash\nconan remote add local http://localhost:9300\n```\n\n## Search Conan Package\n\n```bash\nconan search {PACKAGE_NAME} -r=local\n```\n\n## Upload Conan Package to Conan Repository Server (Remote)\n\n\u003chttps://docs.conan.io/en/latest/uploading_packages/uploading_to_remotes.html\u003e\n\n```bash\nconan upload {CMAKE_PROJECT_NAME}/{CMAKE_PROJECT_VERSION}@demo/testing --all -r=local\n```\n\n## Remove Local Conan Package Cache\n\n```bash\nconan remove {CMAKE_PROJECT_NAME}*\n```\n\n## Run Simple Open Source Conan Repository Server\n\n\u003chttps://docs.conan.io/en/latest/uploading_packages/running_your_server.html\u003e\n\n```bash\nconan_server\n```\n\n## Simple Open Source Conan Repository Server Config File Location\n\n```bash\n# Linux\n~/.conan_server/server.conf\n```\n\n```cmd\n# Windows\n%USERPROFILE%\\.conan_server\\server.conf\n```\n\n## Simple Open Source Conan Repository Server Package Location\n\n```bash\n# Linux\n~/.conan_server/data\n```\n\n```cmd\n# Windows\n%USERPROFILE%\\.conan_server\\data\n```\n\n## Add C++ Project Framework Package to Conan Center Index (conan-center-index)\n\n\u003chttps://github.com/sheepgrass/conan-center-index/blob/master/docs/how_to_add_packages.md\u003e\n\n### Test C++ Project Framework Conan Recipe Locally using Conan Hooks\n\n\u003chttps://github.com/sheepgrass/conan-center-index/blob/master/docs/how_to_add_packages.md#test-the-recipe-locally\u003e\n\n\u003chttps://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md\u003e\n\n```bash\ncd conan-center-index\npython -m venv .venv\n.venv/Scripts/activate\npython -m pip isntall --upgrade pip\npython -m pip install conan\n\nconan config install https://github.com/conan-io/hooks.git -sf hooks -tf hooks\nconan config set hooks.conan-center\n\ncd recipes/cpp_project_framework/all\nconan create conanfile.py cpp_project_framework/1.0.0@\n```\n\n## Set BUILD_TYPE Environment Variable\n\n```bash\n# Linux\nexport BUILD_TYPE=Debug\n```\n\n```cmd\n# Windows\nset BUILD_TYPE=Debug\n```\n\n## Activate Python Virtual Environment\n\n```bash\n# Linux\n`make venv_activate`\n```\n\n```cmd\n# Windows\nmake venv_activate\n```\n\n## Make Steps\n\n```bash\n# Set Build Type\nexport BUILD_TYPE=Debug\n\n# Create Virtual Environment\nmake venv_create\n\n# Activate Virtual Environment\nmake venv_activate\n\n# Install Conan Package Manager\nmake pip_install_conan\n\n# Install Project Dependencies\nmake conan_install\n\n# Create CMake Project\nmake cmake_project\n\n# Open Generated Project in Default IDE\nmake cmake_open\n\n# List of CMake Build Targets\nmake help\n\n# Build Specific CMake Target\nmake target CMAKE_BUILD_TARGET=\u003ctarget\u003e\n\n# Build Project\nmake build\n\n# Test Project\nmake test\n\n# Create Code Coverage Report\nmake coverage\n\n# Create Package/Installer\nmake package\n\n# Create New Conan Package Recipe\nmake recipe_create\n\n# Create Conan Test Package\nmake conan_package_test\n\n# Create Conan Package\nmake conan_package\n\n# Start Local Conan Repository Server\nmake conan_start_local\n\n# Add Local Conan Repository Server to Remote List\nmake conan_add_local\n\n# Upload Conan Test Package to Local Conan Repository Server\nmake conan_upload_local_test\n\n# Upload Conan Package to Local Conan Repository Server\nmake conan_upload_local\n\n# Generate Source Code Documentation\nmake doxygen\n```\n\n## Remove Steps\n\n```bash\n# Remove Source Code Documentation\nmake doxygen_delete\n\n# Remove Conan Package from Local Conan Repository Server\nmake conan_remove_local\n\n# Remove Conan Package from Cache\nmake conan_remove_cache\n\n# Clean Project\nmake clean\n\n# Delete Whole Build Folder\nmake delete\n\n# Deactivate Virtual Environment\nmake venv_deactivate\n\n# Delete Whole Virtual Environment\nmake venv_delete\n```\n\n## Support Google Test\n\n\u003chttps://github.com/google/googletest\u003e\n\n\u003chttps://raymii.org/s/tutorials/Cpp_project_setup_with_cmake_and_unit_tests.html\u003e\n\n\u003chttps://gitlab.kitware.com/cmake/community/-/wikis/doc/ctest/Testing-With-CTest\u003e\n\n```ini\n# conanfile.txt\n[build_requires]\ngtest/1.10.0\n```\n\n```cmake\n# CMakeLists.txt (root project)\nenable_testing()\n...\nadd_subdirectory(${SUB_PROJECT_PATH})\n```\n\n```cmake\n# CMakeLists.txt (subdirectory project)\nenable_testing()\nset(TEST_EXE ${PROJECT_NAME}.test)\nset(TEST_SRC_FILES ${PROJECT_NAME}.test.cpp)\nadd_executable(${TEST_EXE} ${TEST_SRC_FILES})\nconan_target_link_libraries(${TEST_EXE})\nadd_test(NAME ${TEST_EXE} COMMAND ${TEST_EXE})\n```\n\n## Run CMake Tests by CTest\n\n\u003chttps://cmake.org/cmake/help/latest/manual/ctest.1.html\u003e\n\n```bash\ncd {CMAKE_BUILD_TYPE} \u0026\u0026 ctest -C {CMAKE_BUILD_TYPE}\n```\n\n## Generate Unit Test Code Coverage Report by gcov and lcov\n\n\u003chttps://jhbell.com/using-cmake-and-gcov\u003e\n\n\u003chttps://github.com/jhbell/cmake-gcov\u003e\n\n\u003chttps://dr-kino.github.io/2019/12/22/test-coverage-using-gtest-gcov-and-lcov/\u003e\n\n\u003chttps://github.com/dr-kino/BraveCoverage\u003e\n\n\u003chttps://stackoverflow.com/questions/37978016/cmake-gcov-c-creating-wrong-gcno-files\u003e\n\n\u003chttps://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake\u003e\n\n\u003chttps://stackoverflow.com/questions/13116488/detailed-guide-on-using-gcov-with-cmake-cdash\u003e\n\n\u003chttps://medium.com/@naveen.maltesh/generating-code-coverage-report-using-gnu-gcov-lcov-ee54a4de3f11\u003e\n\n\u003chttp://ltp.sourceforge.net/coverage/lcov.php\u003e\n\n```bash\n# Generate gcov info file with g++ compiler flags \"-fprofile-arcs -ftest-coverage\" or simply \"--coverage\"\ng++ -o main -fprofile-arcs -ftest-coverage main_test.cpp -L /usr/lib -I/usr/include\ng++ -o main --coverage main_test.cpp -L /usr/lib -I/usr/include\n\n# Generate gcov data file from generated gcov info file\ngcov -b ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp -o ${GCOV_OBJECT_DIR}\n\nlcov --capture --directory ${GCOV_OBJECT_DIR} --output-file coverage.info\ngenhtml coverage.info --output-directory .\n```\n\n## Generate Unit Test Code Coverage Report by gcovr\n\n\u003chttps://gcovr.com/en/stable/guide.html\u003e\n\n\u003chttps://github.com/gcovr/gcovr\u003e\n\n```bash\n# Compile and generate binary object files with debug info and coverage info without optimization\ng++ --coverage -g -O0 -o main main_test.cpp -L /usr/lib -I/usr/include\n\n# Install gcovr\nsource .venv/bin/activate\npip install -U gcovr\n\n# Generate coverage report by gcovr (tabular report on console)\ngcovr -r ${CMAKE_CURRENT_SOURCE_DIR} --object-directory ${CMAKE_CURRENT_BINARY_DIR}\n\n# Generate coverage report by gcovr (text file output)\ngcovr -r ${CMAKE_CURRENT_SOURCE_DIR} --object-directory ${CMAKE_CURRENT_BINARY_DIR} -o gcov_report.txt\n\n# Generate coverage report by gcovr (html file output)\ngcovr -r ${CMAKE_CURRENT_SOURCE_DIR} --object-directory ${CMAKE_CURRENT_BINARY_DIR} --html-details gcov_report.html\n```\n\n## Generate Unit Test Code Coverage Report by OpenCppCoverage for Windows\n\n\u003chttps://github.com/OpenCppCoverage/OpenCppCoverage\u003e\n\n```bash\n# Generate coverage report by OpenCppCoverage\nOpenCppCoverage.exe --sources \"${NATIVE_CURRENT_SOURCE_DIR}\" -- \"${NATIVE_UNIT_TEST_EXE_PATH}\" --working_dir \"${NATIVE_UNIT_TEST_EXE_DIR}\" --export_type html:\"${NATIVE_COVERAGE_TARGET_DIR}\"\n```\n\n## Generate Source Code Documentation by Doxygen\n\n\u003chttps://www.doxygen.nl/manual/starting.html\u003e\n\n\u003chttps://github.com/doxygen/doxygen\u003e\n\n```ini\n# conanfile.txt\n[build_requires]\ndoxygen/1.8.20\n```\n\n```bash\n# Generate Doxygen Config File\ndoxygen -g\n\n# Generate Source Code Documentation\ndoxygen\n```\n\n## View Test Coverage Report or Doxygen Documentation by Five Server Visual Studio Code Extension\n\n\u003chttps://marketplace.visualstudio.com/items?itemName=yandeu.five-server\u003e\n\n```\nRight-Click a File in the Explorer \u003e Open with Five Server\n```\n\nExample Test Coverage Report Path:\n`Debug/cpp_project_framework/coverage/CoverageReport-2020-01-01-01h01m01s/CoverageReport.html`\n\nExample Doxygen Documentation Path:\n`doxygen/html/index.html`\n\n## Preferred Doxygen Documentation Rules\n\n### Overall styles: C++ style /// \u003e Javadoc style /** */, (Qt style /*! */ or //! not preferred)\n\n### File documentation: Javadoc style\n\n```c++\n/**\n* @file    cpp_project_framework.h\n* @author  Curtis Lo\n* @brief   This file is just a dummy header file\n*/\n```\n\n### Single line brief description: C++ style\n\n```c++\n/// Get the test case name of current test case\n#define GET_TEST_CASE_NAME() ((test_info_-\u003etest_suite_name() + std::string(\".\") + test_info_-\u003ename()).c_str())\n```\n\n### Brief description with other documenation: C++ style with @brief command\n\n```c++\n/// @brief Execute the code block with scoped trace\n/// @param code code to be executed with scoped trace\n#define SCOPED_TRACE_CODE_BLOCK(code) { SCOPED_TRACE(GET_TEST_CASE_NAME()); code; }\n```\n\n### Brief description after member: C++ style\n\n```c++\nstd::map\u003cstd::string /* name */, ObjectPtr\u003e objects; ///\u003c objects to be managed\n```\n\n### Paremeter inline documentation: Javadoc style\n\n```c++\nvirtual ObjectPtr Get(const std::string\u0026 name /**\u003c [in] name of the object */)\n```\n\n### Brief description for variables\n\nBrief description sentence for variables must start with lowercase word\n\n```c++\nstd::map\u003cstd::string /* name */, ObjectPtr\u003e objects; ///\u003c objects to be managed\n```\n\n```c++\nvirtual ObjectPtr Get(const std::string\u0026 name /**\u003c [in] name of the object */)\n```\n\n### Brief description for files, classes, functions, methods\n\nBrief description sentence for files, classes, functions, methods, macro functions must start with captalized word\n\n```c++\n/**\n* @file    cpp_project_framework.h\n* @author  Curtis Lo\n* @brief   This file is just a dummy header file\n*/\n```\n\n```c++\n/// Get the test case name of current test case\n#define GET_TEST_CASE_NAME() ((test_info_-\u003etest_suite_name() + std::string(\".\") + test_info_-\u003ename()).c_str())\n```\n\n## Preferred C++ Programming Styles\n\nGoogle C++ Style Guide\n\u003chttps://google.github.io/styleguide/cppguide.html\u003e\n\nGROMACS Style Guide\n\u003chttp://manual.gromacs.org/current/dev-manual/style.html\u003e\n\nISO C++ Coding Standards\n\u003chttps://isocpp.org/wiki/faq/coding-standards\u003e\n\n### C++ Naming Styles\n\n#### C++ General Naming Rules\n\nFor the purposes of the naming rules below, a \"word\" is anything that you would write in English without internal spaces. This includes abbreviations, such as acronyms and initialisms. For names written in mixed case (also sometimes referred to as \"camel case\" or \"Pascal case\"), in which the first letter of each word is capitalized, prefer to capitalize abbreviations as single words, e.g., StartRpc() rather than StartRPC(), Id rather than ID, UtcTimestamp rather than UTCTimestamp.\n\n#### C++ Variable Names (all kinds of variables including but not limited to followings: global, local, const, static, member, parameters)\n\nThe names of variables (including function parameters) and data members are all lowercase, with underscores between words, i.e. snake case =\u003e snake_case\n\nFor simplicity and easy memorization of the naming rule, prefix or suffix should not be added to the variable names for different type of variables. For examples, the followings naming styles are not preferred: leading \"k\" in constant variables, prefix \"g_\" in global variables, trailing underscore in data member variables. This also makes easier to move variables to different scopes without renaming them.\n\n#### C++ Type Names (all kinds of types including but not limited to followings: struct, class, enum, typedef, using alias)\n\nType names start with a capital letter and have a capital letter for each new word, with no underscores, i.e. camel case =\u003e CamelCase\n\n#### C++ Function Names (function and member method)\n\nFunction names start with a capital letter and have a capital letter for each new word, with no underscores, i.e. camel case =\u003e CamelCase\n\n#### C++ Namespace Names (namespace)\n\nThe names of namespaces are all lowercase, with underscores between words, i.e. snake case =\u003e snake_case\n\n#### C++ Macro Names (#define, including but not limited to followings: macro constant, macro function)\n\nMacros should not be used. However, if they are absolutely needed, then they should be named with all capitals and underscores, i.e. macro case =\u003e MACRO_CASE\n\n#### C++ Enumerator Member Names (enum member)\n\nThe names of enumerator members are all lowercase, with underscores between words, i.e. snake case =\u003e snake_case\n\n#### C++ Main File Name (file containing the main() entry function)\n\nMain file name must have the same name as the final program binary name which should be all lowercase, with underscores between words, i.e. snake case =\u003e snake_case\n\n#### C++ Class File Names (file containing a single class declaration and/or definition)\n\nClass file names must have the same name as the single class name it contains which should start with a capital letter and have a capital letter for each new word, with no underscores, i.e. camel case =\u003e CamelCase\n\n#### C++ Template Parameter Names\n\nTemplate parameters should follow the naming style for their category: type template parameters should follow the rules for type names, and non-type template parameters should follow the rules for variable names.\n\n#### C++ Unit Test Test Suite Names\n\nUnit test test suite names must follow the nameing convention of type/class names with \"Test\" as postfix, i.e. camel case =\u003e CamelCaseTest\n\n#### C++ Unit Test Test Case Names\n\nUnit test test case names must follow the nameing convention of function names, i.e. camel case =\u003e CamelCase\n\n#### C++ Benchmark Function Names\n\nBenchmark Function names must follow the nameing convention of function names with \"Benchmark\" as postfix, i.e. camel case =\u003e CamelCaseBenchmark\n\n### C++ Code Formatting Styles\n\n#### C++ Indentation\n\nUse 4 spaces at a time for indentation. Do not use tabs in code. You should set your editor to emit spaces when you hit the tab key.\n\n#### C++ Comments\n\nOffset by exactly 1 space from the comment mark (e.g. //, /// or /*).\n\n```c++\n/// Structure representing a UTC date\nstruct UtcDate\n```\n\n#### C++ Alignment of Comments\n\nOffset by exactly 1 space from the end of longest line to be aligned.\n\n```c++\nconstexpr uint32_t utc_date_null_value = UINT32_MAX; ///\u003c null value for UtcDate\nconstexpr uint16_t year_null_value = UINT16_MAX;     ///\u003c null value for year\nconstexpr uint8_t month_null_value = UINT8_MAX;      ///\u003c null value for month\nconstexpr uint8_t day_null_value = UINT8_MAX;        ///\u003c null value for day\n```\n\n#### C++ Integer Literal\n\nInteger literal\n\u003chttps://en.cppreference.com/w/cpp/language/integer_literal\u003e\n\nFundamental types\n\u003chttps://en.cppreference.com/w/cpp/language/types\u003e\n\n```text\nSigned 8-bit integer (int8_t or char): 0 (no suffix)\nUnsigned 8-bit integer (uint8_t or unsigned char): 0U (suffix with U)\nSigned 16-bit integer (int16_t or short): 0 (no suffix)\nUnsigned 16-bit integer (uint16_t or unsigned short): 0U (suffix with U)\nSigned 32-bit integer (int32_t or long): 0L (suffix with L)\nUnsigned 32-bit integer (uint32_t or unsigned long): 0UL (suffix with UL)\nSigned 64-bit integer (int64_t or long long): 0LL (suffix with LL)\nUnsigned 64-bit integer (uint64_t or unsigned long long): 0ULL (suffix with ULL)\n```\n\n#### C++ Include Header Ordering\n\nGoogle C++ Style Guide: Names and Order of Includes\n\u003chttps://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes\u003e\n\nInclude header ordering should follow above \"Google C++ Style Guide: Names and Order of Includes\".\nExcept \"All of a project's header files should be listed as descendants of the project's source directory without use of UNIX directory aliases . (the current directory) or .. (the parent directory).\" as its useful for identifying same project headers.\n\nInclude headers in the following order: Related header, C system headers, C++ standard library headers, other libraries' headers, your project's headers.\nSeparate each non-empty group with one blank line.\nWithin each section the includes should be ordered alphabetically.\n\nC system headers (e.g. \\\u003cstdlib.h\u003e) and C++ standard library headers (e.g. \\\u003ccstdlib\u003e) must be enclosed by angle brackets\nOther headers (e.g. \"boost/asio.hpp\") must be enclosed by double quotes\n\nIn dir/foo.cc or dir/foo_test.cc, whose main purpose is to implement or test the stuff in dir2/foo2.h, order your includes as follows:\n\n```text\ndir2/foo2.h.\nA blank line\nC system headers (more precisely: headers in angle brackets with the .h extension), e.g., \u003cunistd.h\u003e, \u003cstdlib.h\u003e.\nA blank line\nC++ standard library headers (without file extension), e.g., \u003calgorithm\u003e, \u003ccstddef\u003e.\nA blank line\nOther libraries' .h files.\nA blank line\nYour project's .h files.\n```\n\nFor example, the includes in google-awesome-project/src/foo/internal/fooserver.cc might look like this:\n\n```c++\n#include \"foo/server/fooserver.h\"\n\n#include \u003csys/types.h\u003e\n#include \u003cunistd.h\u003e\n\n#include \u003cstring\u003e\n#include \u003cvector\u003e\n\n#include \"base/basictypes.h\"\n#include \"base/commandlineflags.h\"\n\n#include \"foo/server/bar.h\"\n```\n\n## Support Microbenchmark Performance Test\n\nMicro benchmarking libraries for C++\n\u003chttps://www.bfilipek.com/2016/01/micro-benchmarking-libraries-for-c.html\u003e\n\nGoogle Benchmark\n\u003chttps://github.com/google/benchmark\u003e\n\nsltbench\n\u003chttps://github.com/ivafanas/sltbench\u003e\n\nSkyPat\n\u003chttps://github.com/skymizer/SkyPat\u003e\n\n```ini\n# conanfile.txt\n[build_requires]\nbenchmark/1.5.1\n```\n\n## Use Git Submodules\n\nGit Tools - Submodules\n\u003chttps://www.git-scm.com/book/en/v2/Git-Tools-Submodules\u003e\n\ngit-submodule - Initialize, update or inspect submodules\n\u003chttps://git-scm.com/docs/git-submodule\u003e\n\n```bash\ngit submodule add \u003crepository url\u003e [\u003csubmodule name\u003e]\n```\n\n## List GCC Default Include and Library Paths\n\nLibrary path in gcc:\n\u003chttps://transang.me/library-path-in-gcc/\u003e\n\n### List GCC Default Include Paths\n\nWhat are the GCC default include directories?:\n\u003chttps://stackoverflow.com/questions/4980819/what-are-the-gcc-default-include-directories\u003e\n\n```bash\necho | gcc -xc++ -E -Wp,-v - 2\u003e\u00261 | grep '^[[:space:]]*/' | sed 's/^[[:space:]]*//'\n```\n\n### List GCC Default Library Paths\n\nHow to print the ld(linker) search path:\n\u003chttps://stackoverflow.com/questions/9922949/how-to-print-the-ldlinker-search-path\u003e\n\n```bash\ngcc -print-search-dirs | sed '/^lib/b 1;d;:1;s,/[^/.][^/]*/\\.\\./,/,;t 1;s,:[^=]*=,:;,;s,;,;  ,g' | tr \\; \\\\012 | tr : \\\\012 | grep '^[[:space:]]*/' | sed 's/^[[:space:]]*//'\n```\n\n## Bash Auto Completion of Makefile Targets\n\nbash completion of makefile target:\n\u003chttps://stackoverflow.com/questions/4188324/bash-completion-of-makefile-target\u003e\n\nHow to add bash auto completion in Ubuntu Linux:\n\u003chttps://www.cyberciti.biz/faq/add-bash-auto-completion-in-ubuntu-linux/\u003e\n\nAdd below line to `~/.bashrc` file to enable auto completion of CMake build targets using `bash-completion` Linux package:\n\n```bash\ncomplete -W \"\\`make help 2\u003e/dev/null | grep -oE '^\\.\\.\\. [a-zA-Z0-9_.-]+' | sed 's/\\.\\.\\. //'\\`\" cmake\n```\n\nAdd below line to `~/.bashrc` file to enable auto completion of Makefile targets using `bash-completion` Linux package:\n\n```bash\ncomplete -W \"\\`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' ?akefile | sed 's/[^a-zA-Z0-9_.-]*$//'\\`\" make\n```\n\nAdd below line instead of above one to `~/.bashrc` file to enable auto completion of Makefile targets with CMake build targets using `bash-completion` Linux package:\n\n```bash\ncomplete -W \"\\`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' ?akefile | sed 's/[^a-zA-Z0-9_.-]*$//'\\` \\`make help 2\u003e/dev/null | grep -oE '^\\.\\.\\. [a-zA-Z0-9_.-]+' | sed 's/\\.\\.\\. /CMAKE_BUILD_TARGET-/'\\`\" make\n```\n\nSource `~/.bashrc` file after making the change to make it take effect:\n\n```bash\nsource ~/.bashrc\n```\n\n## Install Jenkins\n\nInstalling Jenkins - WAR files:\n\u003chttps://www.jenkins.io/doc/book/installing/war-file/\u003e\n\n```bash\npython -c \"import os, requests; os.makedirs(os.path.expanduser(r'$(JENKINS_HOME)'), mode=0o755, exist_ok=True); open(os.path.join(os.path.expanduser(r'$(JENKINS_HOME)'), 'jenkins.war'), 'wb').write(requests.get('https://get.jenkins.io/war-stable/latest/jenkins.war', allow_redirects=True).content)\"\n```\n\n## Start Jenkins Web Application\n\n```bash\njava -jar $(JENKINS_HOME)/jenkins.war --httpPort=8080\n```\n\n## Jenkins Home Folder Location\n\n```bash\n# Linux\n~/.jenkins\n```\n\n```cmd\n# Windows\n%USERPROFILE%\\.jenkins\n```\n\n## Continuous Integration for C++ Projects with Jenkins\n\nJenkins - Pipeline:\n\u003chttps://www.jenkins.io/doc/book/pipeline/\u003e\n\nContinuous Integration for C/C++ Projects with Jenkins and Conan:\n\u003chttps://www.jenkins.io/blog/2017/07/07/jenkins-conan/\u003e\n\nIntroduction into an Automated C++ Build Setup with Jenkins and CMake:\n\u003chttps://thoughts-on-coding.com/2019/03/27/introduction-into-build-automation-setup-with-jenkins-and-cmake/\u003e\n\nJenkins - Blue Ocean:\n\u003chttps://www.jenkins.io/doc/book/blueocean/\u003e\n\nVisual Pipeline Creation in Blue Ocean:\n\u003chttps://www.youtube.com/watch?v=LzFmTiH8nos\u003e\n\n## Gather Test Results with xUnit Plugin for Jenkins\n\nJenkins - Recording tests and artifacts:\n\u003chttps://www.jenkins.io/doc/pipeline/tour/tests-and-artifacts/\u003e\n\nxUnit plugin - step([$class: 'XUnitPublisher']): Publish xUnit test result report:\n\u003chttps://www.jenkins.io/doc/pipeline/steps/xunit/\u003e\n\nJenkins Core - archiveArtifacts: Archive the artifacts:\n\u003chttps://www.jenkins.io/doc/pipeline/steps/core/#archiveartifacts-archive-the-artifacts\u003e\n\nApache Ant - Directory-based Tasks - Patterns:\n\u003chttps://ant.apache.org/manual/dirtasks.html#patterns\u003e\n\n### Gather CTest Results with xUnit Plugin for Jenkins\n\nProducing CTest results in Jenkins (xUnit \u003e= 1.58):\n\u003chttps://stackoverflow.com/questions/21633716/producing-ctest-results-in-jenkins-xunit-1-58\u003e\n\nctest(1):\n\u003chttps://cmake.org/cmake/help/latest/manual/ctest.1.html\u003e\n\nJenkinsfile\n\n```groovy\npipeline {\n  agent any\n  stages {\n    stage('Test') {\n      steps {\n        sh \"cd ${env.BUILD_TYPE} \u0026\u0026 ctest -C ${env.BUILD_TYPE} -T Test --no-compress-output\"\n      }\n      post {\n        always {\n          archiveArtifacts artifacts: \"${env.BUILD_TYPE}/Testing/**/*.xml\", fingerprint: true\n          xunit (\n            thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ],\n            tools: [\n              CTest(pattern: \"${env.BUILD_TYPE}/Testing/**/*.xml\", deleteOutputFiles: true, failIfNotNew: false, skipNoTestFiles: true, stopProcessingIfError: true)\n            ]\n          )\n        }\n      }\n    }\n  }\n}\n```\n\n### Gather Google Test Results with xUnit Plugin for Jenkins\n\nUsing gtest in jenkins:\n\u003chttps://stackoverflow.com/questions/11540633/using-gtest-in-jenkins\u003e\n\nAdvanced googletest Topics - Generating an XML Report:\n\u003chttps://google.github.io/googletest/advanced.html#generating-an-xml-report\u003e\n\nJenkinsfile\n\n```groovy\npipeline {\n  agent any\n  stages {\n    stage('Test') {\n      environment {\n        GTEST_OUTPUT = 'xml:../gtest/'\n      }\n      steps {\n        sh \"cd ${env.BUILD_TYPE} \u0026\u0026 ctest -C ${env.BUILD_TYPE} -T Test --no-compress-output\"\n      }\n      post {\n        always {\n          archiveArtifacts artifacts: \"${env.BUILD_TYPE}/gtest/**/*.xml\", fingerprint: true\n          xunit (\n            thresholds: [ skipped(failureThreshold: '0'), failed(failureThreshold: '0') ],\n            tools: [\n              GoogleTest(pattern: \"${env.BUILD_TYPE}/gtest/**/*.xml\", deleteOutputFiles: true, failIfNotNew: false, skipNoTestFiles: true, stopProcessingIfError: true)\n            ]\n          )\n        }\n      }\n    }\n  }\n}\n```\n\n## Cross Platform Pipeline Support in Jenkins\n\nConditionals in a Declarative Pipeline Jenkinsfile:\n\u003chttps://michakutz.medium.com/conditionals-in-a-declarative-pipeline-jenkinsfile-d1a4a44e93bb\u003e\n\nScripted Pipeline - Flow Control:\n\u003chttps://www.jenkins.io/doc/book/pipeline/syntax/#flow-control\u003e\n\nHow to determine the current operating system in a Jenkins pipeline:\n\u003chttps://stackoverflow.com/questions/44105814/how-to-determine-the-current-operating-system-in-a-jenkins-pipeline\u003e\n\nisUnix: Checks if running on a Unix-like node:\n\u003chttps://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#isunix-checks-if-running-on-a-unix-like-node\u003e\n\nJenkinsfile\n\n```groovy\npipeline {\n  agent any\n  stages {\n    stage('Test') {\n      environment {\n        GTEST_OUTPUT = 'xml:../gtest/'\n      }\n      parallel {\n        stage('Unix') {\n          when { expression { isUnix() } }\n          steps {\n            sh \"cd ${env.BUILD_TYPE} \u0026\u0026 ctest -C ${env.BUILD_TYPE} -T Test --no-compress-output\"\n          }\n        }\n        stage('Windows') {\n          when { expression { !isUnix() } }\n          steps {\n            bat \"\"\"make venv_activate\ncd ${env.BUILD_TYPE} \u0026\u0026 ctest -C ${env.BUILD_TYPE} -T Test --no-compress-output\"\"\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Dynamic Stage Name Support in Jenkins\n\nStage name must be a string literal - Solution:\n\u003chttps://issues.jenkins.io/browse/JENKINS-43820?focusedCommentId=397048\u0026page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-397048\u003e\n\n```groovy\npipeline {\n  agent any\n  stages {\n    stage('Init') {\n      steps {\n        script {\n          env.BUILD_TYPE = input message: 'Set parameters:', parameters: [choice(name: 'BUILD_TYPE', choices: ['Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'], description: 'Build Type')]\n          parallel (\n            \"${env.BUILD_TYPE}\": {\n              stage('Build Type') {\n                echo \"Build Type: ${env.BUILD_TYPE}\"\n              }\n            }\n          )\n        }\n      }\n    }\n  }\n}\n```\n\n## Run Multiple Configurations in Parallel using Declarative Pipeline Matrix in Jenkins\n\nWelcome to the Matrix:\n\u003chttps://www.jenkins.io/blog/2019/11/22/welcome-to-the-matrix/\u003e\n\nSpecifying a matrix of one or more dimensions:\n\u003chttps://docs.cloudbees.com/docs/admin-resources/latest/pipelines/matrix\u003e\n\nPipeline Syntax - when:\n\u003chttps://www.jenkins.io/doc/book/pipeline/syntax/#when\u003e\n\n```groovy\npipeline {\n  agent none\n  stages {\n    stage('Pipeline') {\n      matrix {\n        when {\n          allOf {\n            anyOf {\n              expression { env.BUILD_AGENT_FILTER == 'All' }\n              expression { env.BUILD_AGENT_FILTER == env.BUILD_AGENT }\n            }\n            anyOf {\n              expression { env.BUILD_TYPE_FILTER == 'All' }\n              expression { env.BUILD_TYPE_FILTER == env.BUILD_TYPE }\n              allOf {\n                expression { env.BUILD_TYPE_FILTER == 'Debug and Release' }\n                anyOf {\n                  expression { env.BUILD_TYPE == 'Debug' }\n                  expression { env.BUILD_TYPE == 'Release' }\n                }\n              }\n            not {\n              allOf {\n                expression { env.BUILD_TYPE_FILTER == 'All' }\n                expression { env.BUILD_TYPE == 'Any' }\n              }\n            }\n          }\n        }\n        axes {\n          axis {\n            name 'BUILD_AGENT'\n            values 'Any', 'Linux', 'Windows', 'Docker'\n          }\n          axis {\n            name 'BUILD_TYPE'\n            values 'Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo'\n          }\n        }\n        stages {\n          stage('Check') {\n            options {\n              timeout(time: 5, unit: 'SECONDS')\n            }\n            agent {\n              node {\n                label env.BUILD_AGENT == 'Any' ? '' : env.BUILD_AGENT\n                customWorkspace \"${env.JOB_NAME}/${env.BUILD_AGENT}/${env.BUILD_TYPE}\"\n              }\n            }\n            steps {\n              echo \"Build Agent: ${env.BUILD_AGENT}\"\n              echo \"Build Type: ${env.BUILD_TYPE}\"\n              echo \"Build Workspace: ${env.JOB_NAME}/${env.BUILD_AGENT}/${env.BUILD_TYPE}\"\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Trigger Jenkins Parameterized Build Using API\n\nJenkins : Parameterized Build:\n\u003chttps://wiki.jenkins.io/display/JENKINS/Parameterized+Build\u003e\n\nHow to remotely trigger Jenkins multibranch pipeline project build?:\n\u003chttps://stackoverflow.com/questions/39490150/how-to-remotely-trigger-jenkins-multibranch-pipeline-project-build\u003e\n\njenkins rest api returns 400 nothing is submitted:\n\u003chttps://stackoverflow.com/questions/52101155/jenkins-rest-api-returns-400-nothing-is-submitted\u003e\n\n### Add New User API Token\n\nDashboard \u003e Manage Jenkins \u003e Manager Users \u003e \u003cuser_name\u003e \u003e Configure \u003e API Token \u003e Add new Token\n\n### Parameterized Build HTTP Post Request\n\n```bash\ncurl --location --request POST 'http://localhost:18080/job/cpp_project_framework/job/master/buildWithParameters?BUILD_AGENT=Any\u0026BUILD_TYPE=Debug\u0026ENABLE_DEPLOY_STAGE=true' --user \u003cuser_name\u003e:\u003capi_token\u003e\n```\n\n## Publish HTML Report (Coverage, Doxygen) in Jenkins\n\nHTML Publisher:\n\u003chttps://plugins.jenkins.io/htmlpublisher/\u003e\n\nDeclarative Pipeline: Publishing HTML Reports:\n\u003chttps://www.jenkins.io/blog/2017/02/10/declarative-html-publisher/\u003e\n\n```groovy\npost {\n  success {\n    archiveArtifacts artifacts: \"doxygen/\", fingerprint: true\n    publishHTML target: [\n        allowMissing: false,\n        alwaysLinkToLastBuild: false,\n        keepAll: true,\n        reportDir: 'doxygen/html/',\n        reportFiles: 'index.html',\n        reportName: 'Doxygen'\n    ]\n  }\n}\n```\n\n## Start Jenkins Web Application with No Content Security Policy (CSP)\n\nConfiguring Content Security Policy:\n\u003chttps://www.jenkins.io/doc/book/security/configuring-content-security-policy/\u003e\n\nJenkins - HTML Publisher Plugin - No CSS is displayed when report is viewed in Jenkins Server:\n\u003chttps://stackoverflow.com/questions/35783964/jenkins-html-publisher-plugin-no-css-is-displayed-when-report-is-viewed-in-j\u003e\n\nRun Jenkins with no CSP header value to allow JavaScript and CSS (for HTML Publisher Plugin):\n\n```bash\njava -Dhudson.model.DirectoryBrowserSupport.CSP= -jar $(JENKINS_HOME)/jenkins.war --httpPort=8080\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheepgrass%2Fcpp_project_framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheepgrass%2Fcpp_project_framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheepgrass%2Fcpp_project_framework/lists"}