Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLartians committed Oct 14, 2019
1 parent 999ed6c commit aaeee3e
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions README.md
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_.

0 comments on commit aaeee3e

Please sign in to comment.