summaryrefslogtreecommitdiff
path: root/Meta/CMake/setup_ccache.cmake
blob: c3306261557b2c158c4332cb0c834a4f7211a0ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# ccache setup
#

list(APPEND COMPILERS
    "CMAKE_C_COMPILER"
    "CMAKE_CXX_COMPILER"
)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
    foreach(compiler ${COMPILERS})
        get_filename_component(compiler_path "${${compiler}}" REALPATH)
        get_filename_component(compiler_name "${compiler_path}" NAME)
        if (NOT ${compiler_name} MATCHES "ccache")
            set("${compiler}_LAUNCHER" "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher program, e.g. ccache")
        endif()
    endforeach()
endif()