Update build script for Lua
[liba.git] / cmake / FindCCache.cmake
blobc14b72145c7f109276f742079c262fccf5fe47dc
1 #.rst:
2 # FindCCache
3 # ----------
5 # Find ccache executable. https://ccache.dev/manual/latest.html
7 # Result Variables
8 # ^^^^^^^^^^^^^^^^
10 # This module defines the following variables:
12 # ``CCACHE_FOUND``
14 # ``CCACHE_EXECUTABLE``
16 # ``CCACHE_VERSION``
18 include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
19 find_program(CCACHE_EXECUTABLE ccache)
20 mark_as_advanced(CCACHE_EXECUTABLE)
22 if(EXISTS "${CCACHE_EXECUTABLE}")
23   execute_process(COMMAND ${CCACHE_EXECUTABLE} --version OUTPUT_VARIABLE CCACHE_VERSION)
24   string(REGEX REPLACE "ccache version ([^\n ]+).*" "\\1" CCACHE_VERSION "${CCACHE_VERSION}")
25 endif()
27 find_package_handle_standard_args(CCache
28   FOUND_VAR
29     CCACHE_FOUND
30   REQUIRED_VARS
31     CCACHE_EXECUTABLE
32   VERSION_VAR
33     CCACHE_VERSION