find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
	get_filename_component(compiler_path "${CMAKE_C_COMPILER}" REALPATH)
	get_filename_component(compiler_name "${compiler_path}" NAME)
	if (NOT ${compiler_name} MATCHES "ccache")
		message(STATUS "Enabling ccache")
		set("CMAKE_C_COMPILER_LAUNCHER" "${CCACHE_PROGRAM}" CACHE FILEPATH "Path to a compiler launcher, usually ccache")
	endif()
endif()
