Welcome to the C++ Project Template! This repository provides a basic setup for a C++ project using CMake. It includes scripts for both PowerShell (Windows) and Bash (Linux) to streamline the build process.
C++-Project-Template/
├── build/ # Directory where build artifacts will be generated
├── src/ # Directory containing the source code
├── scripts/
│ ├── build.ps1 # PowerShell script for building on Windows
│ └── build.sh # Bash script for building on Linux
├── CMakeLists.txt # CMake configuration file
└── README.md # This file- CMake: Make sure CMake is installed on your system. You can download it from here.
- Open PowerShell.
- Navigate to the project directory.
- Run the PowerShell build script:
./scripts/build.ps1
- Navigate to the build directory:
cd build
- Run
maketo build the project:mingw32-make - Run the output binary:
./output_binary.exe
- Open a terminal.
- Navigate to the project directory.
- Make the Bash script executable (only required once):
chmod +x scripts/build.sh
- Run the Bash build script:
./scripts/build.sh
- Navigate to the build directory:
cd build - Run
maketo build the project:make
- Run the output binary:
./output_binary
- Add your C++ source files to the
srcdirectory. - Modify the
CMakeLists.txtfile to include your source files and any necessary libraries or dependencies.
- Ensure CMake is installed and added to your system's PATH.
- Check the output of the build scripts for any errors or warnings.
- Make sure you have the necessary build tools installed (
mingw32-makefor Windows andmakefor Linux).