From 18c63fd2d3b976cc26c56dd80940c8ffd060c4ea Mon Sep 17 00:00:00 2001 From: peters <peters@irmb.tu-bs.de> Date: Wed, 21 Oct 2020 10:38:18 +0200 Subject: [PATCH] CMake: Throw an error when clang-tidy is enabled but not found. --- CMake/VirtualFluidsMacros.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMake/VirtualFluidsMacros.cmake b/CMake/VirtualFluidsMacros.cmake index edb407e7c..033a4aad9 100644 --- a/CMake/VirtualFluidsMacros.cmake +++ b/CMake/VirtualFluidsMacros.cmake @@ -105,6 +105,11 @@ function(vf_add_library) # enable clang tidy for this target if(BUILD_VF_CLANG_TIDY) find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) + + if(NOT CLANG_TIDY_COMMAND) + message(FATAL_ERROR "Clang-tidy command not found.") + endif() + set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") endif() -- GitLab