Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (28 sloc)
964 Bytes
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
# (c) https://github.com/dev-cafe/autocmake/blob/master/AUTHORS.md | |
# licensed under BSD-3: https://github.com/dev-cafe/autocmake/blob/master/LICENSE | |
#.rst: | |
# | |
# Adds ccache support. | |
# The user should export the appropriate environment variables to | |
# tweak the program's behaviour, as described in its manpage. | |
# Notice that some additional compiler flags might be needed in order | |
# to avoid unnecessary warnings. | |
# | |
# Variables defined:: | |
# | |
# CCACHE_FOUND | |
# | |
# autocmake.yml configuration:: | |
# | |
# docopt: "--ccache=<USE_CCACHE> Toggle use of ccache <ON/OFF> [default: ON]." | |
# define: "'-DUSE_CCACHE={0}'.format(arguments['--ccache'])" | |
if(USE_CCACHE) | |
find_program(CCACHE_FOUND ccache) | |
if(CCACHE_FOUND) | |
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) | |
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) | |
message(STATUS "Compiling with ccache") | |
else() | |
message(STATUS "ccache not available") | |
endif() | |
endif() |