Skip to content

Commit a30f865

Browse files
muggenhorhatstand
authored andcommitted
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.
1 parent 5c61371 commit a30f865

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/Version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ else(FORCE_GIT_REVISION)
126126
find_program(GIT_EXECUTABLE git)
127127
message(STATUS "Found git: ${GIT_EXECUTABLE}")
128128

129-
if(NOT GIT_EXECUTABLE-NOTFOUND)
129+
if(GIT_EXECUTABLE)
130130
execute_process(COMMAND ${GIT_EXECUTABLE} describe
131131
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
132132
RESULT_VARIABLE GIT_INFO_RESULT

0 commit comments

Comments
 (0)