this repo has no description
1option(USE_CCACHE "Use ccache to speed up compilation when found on the system" TRUE)
2
3find_program(CCACHE_PROGRAM ccache)
4if(USE_CCACHE AND CCACHE_PROGRAM)
5 # Support Unix Makefiles and Ninja
6 set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
7
8 # Support for Xcode
9 get_property(RULE_LAUNCH_COMPILE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
10 if(RULE_LAUNCH_COMPILE AND CMAKE_GENERATOR STREQUAL "Xcode")
11 # Set up wrapper scripts
12 configure_file(cmake/templates/launch-c.in launch-c)
13 configure_file(cmake/templates/launch-cxx.in launch-cxx)
14 execute_process(COMMAND chmod a+rx
15 "${CMAKE_BINARY_DIR}/launch-c"
16 "${CMAKE_BINARY_DIR}/launch-cxx")
17
18 # Set Xcode project attributes to route compilation through our scripts
19 set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_BINARY_DIR}/launch-c")
20 set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_BINARY_DIR}/launch-cxx")
21 set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_BINARY_DIR}/launch-c")
22 set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${CMAKE_BINARY_DIR}/launch-cxx")
23 endif()
24endif()
25