When using ccache with CMake, there seems to be two ways to setup the project.
The first one is with RULE_LAUNCH_COMPILE
find_program(CCACHE "ccache")
if(CCACHE)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}")
endif()
The second one is with CMAKE_<LANG>_COMPILER_LAUNCHER:
find_program(CCACHE "ccache")
if(CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif(CCACHE)
Which one is considered best practice? :)
Thanks for your help.