Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add FindCCache.cmake script for detecting ccache
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |