From 4c798853723c6bb289d24b1d0266ffa1148d1cfe Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Wed, 2 Oct 2024 15:39:12 +0200 Subject: [PATCH] build: remove bad double negative when discovering 'git' This automatically works because CMake's `if` statement considers variables which' content ends with "-NOTFOUND" to be FALSE. The previous version however was first tried as a variable which didn't exist. As a result after that it's interpreted as a string (not a variable anymore). So it skips the "-NOTFOUND" check and only does a "string not empty" check. Which, as this is a string constant, is always true. --- cmake/Version.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake index ee99f6abce..668e556ae6 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -126,7 +126,7 @@ else(FORCE_GIT_REVISION) find_program(GIT_EXECUTABLE git) message(STATUS "Found git: ${GIT_EXECUTABLE}") - if(NOT GIT_EXECUTABLE-NOTFOUND) + if(GIT_EXECUTABLE) execute_process(COMMAND ${GIT_EXECUTABLE} describe WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE GIT_INFO_RESULT