Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cashtann/cmake-template
My custom simple CMake Template. I'm lazy, so this template is for me (and others if they want) to download.
https://github.com/cashtann/cmake-template
Last synced: about 2 months ago
JSON representation
My custom simple CMake Template. I'm lazy, so this template is for me (and others if they want) to download.
- Host: GitHub
- URL: https://github.com/cashtann/cmake-template
- Owner: Cashtann
- Created: 2024-06-02T14:41:32.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T19:38:21.000Z (5 months ago)
- Last Synced: 2024-07-26T21:28:14.650Z (5 months ago)
- Language: CMake
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CMake Project Template (Basic)
### Golden quote - "It works on my machine"
My custom simple CMake Template (rather for Linux because of .sh scripts). I'm lazy, so this template is for me (and others if they want) to download.
This template is fairly simple and very basic, as I mentioned I use it when I want to fast and easly make new project.
I use `CMake` and `Make` to generate and build project.
Clone this repo:
```
gh repo clone Cashtann/CMake-Template
```**First of all, you may need to make those bash scripts executable, so in the project directory paste in these commands:**
```
chmod +x setupCMake.sh compile.sh run.sh
```### Commands to use in project directory (bash scripts):
**CreateCMake files**This creates CMake files in `build` directory.
```
./setupCmake.sh
```
This script is just bash `cmake -B build` (if you want to make it on Windows, you may need to use `cmake -B build -G "MinGW Makefiles"`).**Build (compile) project**
Compiles project. Output files (executable and libs) should be somewhere inside `./bin` folder.
```
./compile.sh
```
This script is just bash `cd build && make && cd ..`.**Run project**
Compiles project and runs the executable file.
File location may differ depending on *Build mode (Debug/Release*) -> set in the CMakeLists.txt file.
May not work if file if generated in a different directory. Executable file should be somewhere in `./bin` directory.
```
./run.sh
```
This script is the same as `compile.sh` but also has `cd bin/Linux/Debug && ./run && cd ..`.