To use, put AutoCCache.cmake
in a directory named cmake
at your project
root, and add these two lines to CMakeLists.txt
:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
include(AutoCCache)
The AutoCCache script will automatically detect if ccache is available at CMake configuration time, and use it when available (unless -DAUTO_CCACHE=OFF
is passed to CMake). To install ccache on Ubuntu, use sudo apt install ccache
.