-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
999ed6c
commit aaeee3e
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[![Actions Status](https://github.com/TheLartians/Ccache.cmake/workflows/CI/badge.svg)](https://github.com/TheLartians/Ccache.cmake/actions) | ||
|
||
# Ccache.cmake | ||
|
||
Ccache for CMake | ||
|
||
## About | ||
|
||
Ccache.cmake makes it easy to use [_Ccache_](https://ccache.dev) inside a _CMake_ project. | ||
It adds an addition configuration option `USE_CCACHE` that, when enabled, configures CMake to compile sources using the ccache compiler cache. | ||
It is compatible with _Makefile_, _Ninja_ and _Xcode_ targets. | ||
|
||
After [integrating](#how-to-integrate) _Ccache.cmake_, you can configure your project to compile with _Ccache_ with the following command. | ||
|
||
```bash | ||
cmake . -DUSE_CCACHE=YES | ||
``` | ||
|
||
## How to integrate | ||
|
||
### Using [CPM.cmake](https://github.com/TheLartians/CPM) (recomended) | ||
|
||
Run the following from the project's root directory to add CPM to your project. | ||
|
||
```bash | ||
mkdir -p cmake | ||
wget -O cmake/CPM.cmake https://raw.githubusercontent.com/TheLartians/CPM/master/cmake/CPM.cmake | ||
``` | ||
|
||
Add the following lines to the project's `CMakeLists.txt` after calling `project(...)`. | ||
|
||
```CMake | ||
include(cmake/CPM.cmake) | ||
CPMAddPackage( | ||
NAME Ccache.cmake | ||
GITHUB_REPOSITORY TheLartians/Ccache.cmake | ||
VERSION 1.0 | ||
) | ||
``` | ||
|
||
### Using git submodules (not suited for libraries) | ||
|
||
Run the following from the project's root directory. | ||
|
||
```bash | ||
git submodule add https://github.com/TheLartians/Ccache.cmake | ||
``` | ||
|
||
In add the following lines to the project's `CMakeLists.txt` after calling `project(...)`. | ||
|
||
```CMake | ||
add_subdirectory(Ccache.cmake) | ||
``` | ||
|
||
## Dependencies | ||
|
||
_Ccache.cmake_ requires _CMake_ and _cache_. |