1 ############################################################################## 3 # @brief Find BASH interpreter. 5 # Sets the CMake variables @c BASH_FOUND, @c BASH_EXECUTABLE, 6 # @c BASH_VERSION_STRING, @c BASH_VERSION_MAJOR, @c BASH_VERSION_MINOR, and 7 # @c BASH_VERSION_PATCH. 9 # @ingroup CMakeFindModules 10 ############################################################################## 12 #============================================================================= 13 # Copyright 2011-2012 University of Pennsylvania 14 # Copyright 2013-2016 Andreas Schuh <andreas.schuh.84@gmail.com> 16 # Distributed under the OSI-approved BSD License (the "License"); 17 # see accompanying file Copyright.txt for details. 19 # This software is distributed WITHOUT ANY WARRANTY; without even the 20 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 # See the License for more information. 22 #============================================================================= 23 # (To distribute this file outside of CMake, substitute the full 24 # License text for the above reference.) 26 # ---------------------------------------------------------------------------- 27 # find BASH executable 28 find_program (BASH_EXECUTABLE bash)
29 mark_as_advanced (BASH_EXECUTABLE)
31 # ---------------------------------------------------------------------------- 32 # get version of found BASH executable 34 execute_process (
COMMAND "${BASH_EXECUTABLE}" --version OUTPUT_VARIABLE _BASH_STDOUT ERROR_VARIABLE _BASH_STDERR)
35 if (_BASH_STDOUT MATCHES
"version ([0-9]+)\\.([0-9]+)\\.([0-9]+)")
41 message (WARNING
"Failed to determine version of Bash interpreter (${BASH_EXECUTABLE})! Error:\n${_BASH_STDERR}")
47 # ---------------------------------------------------------------------------- 48 # handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE 49 # if all listed variables are found or TRUE 50 include (FindPackageHandleStandardArgs)
52 find_package_handle_standard_args (
cmake BASH_VERSION_STRING