Skip to content

Commit

Permalink
Add FindCCache.cmake script for detecting ccache
Browse files Browse the repository at this point in the history
  • Loading branch information
vigsterkr committed Aug 5, 2013
1 parent 610c9cf commit 4c6865b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmake/FindCCache.cmake
@@ -0,0 +1,21 @@
find_program(CCACHE
NAMES ccache)

# handle REQUIRED and QUIET options
include(FindPackageHandleStandardArgs)
if (CMAKE_VERSION LESS 2.8.3)
find_package_handle_standard_args(CCache DEFAULT_MSG CCACHE)
else ()
find_package_handle_standard_args(CCache REQUIRED_VARS CCACHE)
endif ()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CCACHE_FLAGS "-Qunused-arguments -fcolor-diagnostics")
#set env CCACHE_CPP2=yes
SET(ENV{CCACHE_CPP} YES)
endif()

mark_as_advanced (
CCACHE
CCACHE_FLAGS
)

0 comments on commit 4c6865b

Please sign in to comment.