Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  1. Create CMakeLists.txt
touch CMakeLists.txt

Docker Setup and uses

  1. Build and run the project in dev mode
docker compose up --build

This will pull & build images and create necessary network and volumes

  1. Stop containers (if needed)
docker compose stop

The containers are set to restart automatically; stop them manually if not needed

  1. Restart containers
docker compose start

Start project

docker compose exec dev bash -c "cmake -S . -B build && cmake --build build && ./build/hello"

replace ./build/hello to the name of your executable (cf CMakeLists.txt last line add_executable)

docker compose exec dev bash -c "rm -rf build/*"

Command to run inside container

  1. Build with Ninja (if you installed it):
cmake -S . -B build        # configure build directory
cmake --build build       # compile the project
./build/hello             # run the resulting executable
  1. Keep the container open after running a command:
make -C build
  1. Clean ./build folder if needed
rm -rf build/*

About

Second year IT exercises : going further C++

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages