Skip to content

C++ code based on the amazing playlist by The Cherno structured with CMake.

Notifications You must be signed in to change notification settings

scar027/cpp-cherno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic C++ with CMake

C++ code based on the amazing playlist by The Cherno structured with CMake.

CMake

Check if CMake is installed in your system by running

cmake --version

in the Terminal. Install it if it is not installed. This build currently requires a minimum CMake version of 3.22 but you can try changing that in the root CMakeLists.txt file and verify if your code compiles if you face any issues because of that.

Header files for functions have been stored in sample-library in the include directory and their definitions are stored in the src directory. The main file lies in the examples directory.

The CMakeLists.txt of the src directory should be updated when new function definitions are created.

Build Instructions

VSCode

  1. Install the CMake extension by twxs and the CMake Tools extension by Microsoft.
  2. Open Command Palette and select CMake: Scan for kits. CMake should automatically configure your project now and once its done you can simply click the triangular play button at the bottom of the IDE to run your code.

Terminal

Open a new Terminal in the root folder of the project and do the following:

  1. Create a new directory called 'build' to store your build files and change your directory from the root directory to the build directory.
mkdir build && cd build
  1. Use CMake and Make to build your project from the build directory
cmake ..
make
  1. Run the main executable from the build directory
./examples/main

About

C++ code based on the amazing playlist by The Cherno structured with CMake.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published