diff --git a/cmake/configuration.cmake b/cmake/configuration.cmake index 62cef8be..3c8df05a 100644 --- a/cmake/configuration.cmake +++ b/cmake/configuration.cmake @@ -301,4 +301,11 @@ else () hibf_config_error ("HIBF platform.hpp build: failed\n${HIBF_PLATFORM_TEST_OUTPUT}") endif () +# ---------------------------------------------------------------------------- +# ccache +# ---------------------------------------------------------------------------- + +include ("${HIBF_SOURCE_DIR}/test/cmake/hibf_require_ccache.cmake") +hibf_require_ccache () + separate_arguments (HIBF_CXX_FLAGS UNIX_COMMAND "${HIBF_CXX_FLAGS}") diff --git a/test/cmake/hibf_require_ccache.cmake b/test/cmake/hibf_require_ccache.cmake index 7eff2574..7fbeb3c9 100644 --- a/test/cmake/hibf_require_ccache.cmake +++ b/test/cmake/hibf_require_ccache.cmake @@ -21,12 +21,11 @@ macro (hibf_require_ccache) set (HIBF_FPROFILE_ABS_PATH "-fprofile-abs-path") if (HIBF_USE_CCACHE) find_program (CCACHE_PROGRAM ccache) - find_package_message (CCACHE_PROGRAM_PRE "Finding program ccache" "[${CCACHE_PROGRAM}]") if (NOT CCACHE_PROGRAM) - find_package_message (CCACHE_PROGRAM "Finding program ccache - Failed" "[${CCACHE_PROGRAM}]") + find_package_message (CCACHE_PROGRAM " Finding program ccache - Failed" "[${CCACHE_PROGRAM}]") else () - find_package_message (CCACHE_PROGRAM "Finding program ccache - Success" "[${CCACHE_PROGRAM}]") + find_package_message (CCACHE_PROGRAM " Finding program ccache - Success" "[${CCACHE_PROGRAM}]") set (HIBF_FPROFILE_ABS_PATH "--ccache-skip -fprofile-abs-path") # New option since cmake >= 3.4: # https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_LAUNCHER.html diff --git a/test/coverage/CMakeLists.txt b/test/coverage/CMakeLists.txt index 7be1f7f2..5d7c275b 100644 --- a/test/coverage/CMakeLists.txt +++ b/test/coverage/CMakeLists.txt @@ -8,9 +8,6 @@ cmake_minimum_required (VERSION 3.10...3.22) project (hibf_test_coverage CXX) -include (../cmake/hibf_require_ccache.cmake) -hibf_require_ccache () - # Add a custom build type: Coverage set (CMAKE_CXX_FLAGS_COVERAGE diff --git a/test/header/CMakeLists.txt b/test/header/CMakeLists.txt index 3dc8db5c..ebf543d3 100644 --- a/test/header/CMakeLists.txt +++ b/test/header/CMakeLists.txt @@ -124,7 +124,6 @@ macro (hibf_header_test component header_base_path exclude_regex) unset (header_target) endmacro () -hibf_require_ccache () hibf_require_benchmark () hibf_require_test () diff --git a/test/hibf-test.cmake b/test/hibf-test.cmake index acdd8182..26327618 100644 --- a/test/hibf-test.cmake +++ b/test/hibf-test.cmake @@ -88,7 +88,6 @@ endif () include (hibf_test_component) include (hibf_test_files) -include (hibf_require_ccache) include (hibf_require_benchmark) include (hibf_require_test) include (hibf_add_subdirectories) diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index 3a327945..4666114d 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -28,7 +28,6 @@ macro (hibf_benchmark benchmark_cpp) unset (test_name) endmacro () -hibf_require_ccache () hibf_require_benchmark () add_subdirectories () diff --git a/test/snippet/CMakeLists.txt b/test/snippet/CMakeLists.txt index b3dc0139..6f888d4a 100644 --- a/test/snippet/CMakeLists.txt +++ b/test/snippet/CMakeLists.txt @@ -52,7 +52,6 @@ macro (hibf_snippets test_name_prefix snippet_base_path) endforeach () endmacro () -hibf_require_ccache () hibf_require_test () hibf_snippets ("snippet" "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index b490e540..1a74851b 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -46,7 +46,6 @@ macro (hibf_test unit_test_cpp) unset (test_name) endmacro () -hibf_require_ccache () hibf_require_test () add_subdirectories () diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt index 906d9703..dc44172b 100644 --- a/util/CMakeLists.txt +++ b/util/CMakeLists.txt @@ -22,9 +22,5 @@ FetchContent_Populate (sharg) list (APPEND CMAKE_PREFIX_PATH "${sharg_SOURCE_DIR}/build_system") find_package (sharg 1.0 REQUIRED) -## ccache -include ("${HIBF_ROOT_DIR}/test/cmake/hibf_require_ccache.cmake") -hibf_require_ccache () - add_executable (fpr_quality fpr_quality.cpp) target_link_libraries (fpr_quality seqan::hibf sharg::sharg)