From ebe2a9ad2d6265a9a554ab70682bf70b2878e802 Mon Sep 17 00:00:00 2001 From: Guilherme Janczak Date: Fri, 10 May 2024 20:40:51 +0000 Subject: [PATCH] CMake: use find_program() to look for bash This is to fail early, during the configuration step, and not later, during the compilation step if bash is not installed. Compile tested with and without bash installed on OpenBSD 7.5 amd64. --- src/cbmc/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cbmc/CMakeLists.txt b/src/cbmc/CMakeLists.txt index 14ab91958a0..4266fedae42 100644 --- a/src/cbmc/CMakeLists.txt +++ b/src/cbmc/CMakeLists.txt @@ -57,8 +57,9 @@ endif() # bash completion if(NOT WIN32) + find_program(BASH_PROGRAM bash REQUIRED) add_custom_command(OUTPUT "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh" - COMMAND "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}" + COMMAND "${BASH_PROGRAM}" "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}" DEPENDS $ ) add_custom_target(cbmc.sh ALL