diff --git a/CMakeLists.txt b/CMakeLists.txt index 75f03e79..fc1a9e5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ option( EXIV2_BUILD_SAMPLES "Build sample applications" option( EXIV2_BUILD_PO "Build translations files" OFF ) option( EXIV2_BUILD_EXIV2_COMMAND "Build exiv2 command-line executable" ON ) option( EXIV2_BUILD_UNIT_TESTS "Build unit tests" OFF ) +option( BUILD_WITH_CCACHE "Use ccache to speed up compile time" OFF ) if ( EXIV2_ENABLE_WEBREADY ) set ( EXIV2_ENABLE_CURL ON ) diff --git a/config/findDependencies.cmake b/config/findDependencies.cmake index 9c45d8b4..b7f20ab9 100644 --- a/config/findDependencies.cmake +++ b/config/findDependencies.cmake @@ -58,11 +58,13 @@ if( EXIV2_BUILD_PO ) endif() endif() -find_program(CCACHE_FOUND ccache) -if(CCACHE_FOUND) - message(STATUS "Program ccache found") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +if( BUILD_WITH_CCACHE ) + find_program(CCACHE_FOUND ccache) + if(CCACHE_FOUND) + message(STATUS "Program ccache found") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif() endif() if (EXIV2_BUILD_UNIT_TESTS) diff --git a/config/printSummary.cmake b/config/printSummary.cmake index 20c548d7..c1d7ec3a 100644 --- a/config/printSummary.cmake +++ b/config/printSummary.cmake @@ -41,6 +41,7 @@ OptionOutput( "Building exiv2 command: " EXIV2_BUILD_EXIV2_COMMAND OptionOutput( "Building samples: " EXIV2_BUILD_SAMPLES ) OptionOutput( "Building PO files: " EXIV2_BUILD_PO ) OptionOutput( "Building unit tests: " EXIV2_BUILD_UNIT_TESTS ) +OptionOutput( "Using ccache: " BUILD_WITH_CCACHE ) message( STATUS "------------------------------------------------------------------" )