An open API service indexing awesome lists of open source software.

https://github.com/DarkWanderer/cmake_template

Template for cross-platform VisualStudio-compatible CMake project with GitHub CI
https://github.com/DarkWanderer/cmake_template

cmake cross-platform debugging template visual-studio

Last synced: about 1 year ago
JSON representation

Template for cross-platform VisualStudio-compatible CMake project with GitHub CI

Awesome Lists containing this project

README

          

# cmake_template

This repository provides a template for a GitHub-based CMake project which supports building & debugging using Visual Studio on both Windows and Linux

# Quick Start

1. Setup WSL subsystem: https://learn.microsoft.com/en-us/windows/wsl/install
1. Install required packages on WSL: `sudo apt-get install gcc g++ gdb cmake`
1. Clone this repository
1. Open the cloned repository as "directory" in Visual Studio (as opposed to "open solution")
1. Open Visual Studio settings, find CMake section, set following option:
![image](https://github.com/DarkWanderer/cmake_template/assets/2542609/d3661d3b-f666-4b29-911b-d11613343e3a)
1. Select target machine, configuration and target: ![image](https://github.com/DarkWanderer/cmake_template/assets/2542609/85dc4c62-b955-4ad2-a692-d8b94b9e4eea)
1. Press "Debug" and enjoy seamless debugging of a Linux binary in Visual Studio

# Things to try

* Linux: Launch sanitizers.exe executable with different `sanitize` configurations
* Linux: Put a breakpoint in helloworld.cpp and run it
* Windows: Run/debug tests with `x64 sanitize=address` config