From 7d97d0da9311650331869db594574452524c91d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20P=C3=A9rez?= Date: Thu, 19 May 2016 15:23:37 +0200 Subject: [PATCH] Use "find_program" to search for git executable CMake's "find_file" can return non-executable files or folders, thus "find_program" must be used to ensure that only executable files are detected. Fixes issue #3290 --- AboutThisBuild.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AboutThisBuild.cmake b/AboutThisBuild.cmake index 68dea478d..2163ed0cb 100644 --- a/AboutThisBuild.cmake +++ b/AboutThisBuild.cmake @@ -5,13 +5,13 @@ find_file(REL_INFO_FILE ReleaseInfo.cmake PATHS "${PROJECT_SOURCE_DIR}" NO_DEFAU if (REL_INFO_FILE STREQUAL REL_INFO_FILE-NOTFOUND) # we look for the git command in this paths by order of preference if (WIN32) - find_file(GIT_CMD git.exe HINTS ENV Path PATH_SUFFIXES ../) + find_program(GIT_CMD git.exe HINTS ENV Path PATH_SUFFIXES ../) elseif (APPLE) - find_file(GIT_CMD git PATHS "/opt/local/bin" "/usr/local/bin" "/usr/bin") - find_file(GIT_CMD git) + find_program(GIT_CMD git PATHS "/opt/local/bin" "/usr/local/bin" "/usr/bin") + find_program(GIT_CMD git) set (SHELL "/bin/bash") else (WIN32) # Linux - find_file(GIT_CMD git) + find_program(GIT_CMD git) set (SHELL "/bin/bash") endif (WIN32)