The goal is to set up a full C++ development environment running on Linux and Windows using CMake as our build system, Visual Studio Code (Linux) / Visual Studio (Windows) as our editor and debugger and Google Test as our test framework. We will focus on the Linux part in this series. Part 1: Basic Setup, get it building Part 2: Visual Studio Code to debug (coming up) Part 3: Testing with GoogleTest (coming up) Sample Code Let’s start by creating a folder and put some sample code we can build and run in there. We will need a with the main function. A simple hello world would be a bit boring so let's add at least one class that is adding up some numbers: src main.cpp { Adder adder = Adder(); added_value = adder.add( , ); :: << added_value << :: ; ; } : ; }; Adder::add( a, b) { (a + b); } // main.cpp # include "adder.h" # include <iostream> int main () int 2 4 std cout std endl return 0 // adder.h # Adder_H ifndef # Adder_H define { class Adder public int add ( , ) int int # endif // adder.cpp # include "adder.h" int int int return CMake, please build this Our project will contain two CMake files. Our “main” CMake file within the root directory and one inside the folder. src The main CMake file bundles our project together and sets some config variables such as the directory the executable should be installed to: (VERSION ) (CppStarter) (INSTALL_DIR ) (src) # CMakeLists.txt cmake_minimum_required 3.5 project set "${CMAKE_CURRENT_SOURCE_DIR}/dist/${CMAKE_BUILD_TYPE}" add_subdirectory As we add the folder as a subdirectory, we should also add a CMakeLists.txt file there which tells our build system which files to compile and where to save the executables to: src ( main.cpp adder.cpp) (TARGETS DESTINATION ) # src/CMakeLists.txt add_executable ${PROJECT_NAME} install ${PROJECT_NAME} ${INSTALL_DIR} And that’s it. With this setup we are ready to build and run our fancy cpp code: >> mkdir build >> build >> cmake .. >> make >> make install cd And to run the code: >> cd dist/release >> ./CppStarter And since it is a bit tedious to type these commands every time, I’d recommend to hack them into a build script. All the code can also be found here: https://github.com/j-o-d-o/cpp_starter/tree/part_1 On Windows, the command will create a Visual Studio solution instead which can be used to build, run and install our code. >> cmake ..