This is a template project for starting a new cmake project.
It includes the following:
- CMake based project for a library, app, and test binaries
- A basic CI script for building on Windows with MSVC and Linux with specific LLVM and GCC versions
- A clang-format file initialized from the Google template
- A vcpkg.json file for easy integration of cmake/cpp packages
- Clone the project into a new folder
- Delete .git folder
- Rename folder to new project name
- git init in new folder
- Create a CMakeUserPresets.json file (see example below) that specifies your vcpkg location
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "MyPC",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/vcpkg/scripts/buildsystems/vcpkg.cmake"
}
},
{
"name": "Windows-MSVC-Debug-MyPC",
"inherits": [
"Windows-MSVC-Debug",
"MyPC"
],
"binaryDir": "${sourceDir}/out/build/MSVC/Debug"
},
{
"name": "Windows-MSVC-Release-MyPC",
"inherits": [
"Windows-MSVC-Release",
"MyPC"
],
"binaryDir": "${sourceDir}/out/build/MSVC/Release"
},
{
"name": "MyMac",
"toolchainFile": "/home/user/repos/vcpkg/scripts/buildsystems/vcpkg.cmake",
"hidden": true
},
{
"name": "OSX-LLVM-Debug-MyMac",
"inherits": ["OSX-LLVM-Debug", "MyMac"],
"binaryDir": "${sourceDir}/out/build/LLVM/Debug"
},
{
"name": "OSX-LLVM-Release-MyMac",
"inherits": ["OSX-LLVM-Release", "MyMac"],
"binaryDir": "${sourceDir}/out/build/LLVM/Release"
},
{
"name": "OSX-GCC-Debug-MyMac",
"inherits": ["OSX-GCC-Debug", "MyMac"],
"binaryDir": "${sourceDir}/out/build/GCC/Debug"
},
{
"name": "OSX-GCC-Release-MyMac",
"inherits": ["OSX-GCC-Release", "MyMac"],
"binaryDir": "${sourceDir}/out/build/GCC/Release"
}
]
}