Version: Always define CMake_VERSION_IS_DIRTY to 0 or 1

In cmVersionConfig.h we must define this macro with a value because
clients expect it to have one.  Also ensure that all CMakeLists.txt
code paths have an initialized value.

Reported-by: Stephen Kelly <steveire@gmail.com>
This commit is contained in:
Brad King 2016-08-23 09:09:03 -04:00
parent ef13efab56
commit aec06dd492
2 changed files with 1 additions and 2 deletions

View File

@ -7,6 +7,7 @@ if("${CMake_VERSION_PATCH}" VERSION_LESS 20000000)
set(CMake_VERSION_IS_RELEASE 1) set(CMake_VERSION_IS_RELEASE 1)
set(CMake_VERSION_SOURCE "") set(CMake_VERSION_SOURCE "")
else() else()
set(CMake_VERSION_IS_DIRTY 0) # may be set to 1 by CMakeVersionSource
set(CMake_VERSION_IS_RELEASE 0) set(CMake_VERSION_IS_RELEASE 0)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
endif() endif()

View File

@ -24,8 +24,6 @@ if(EXISTS ${CMake_SOURCE_DIR}/.git/HEAD)
) )
if(dirty) if(dirty)
set(CMake_VERSION_IS_DIRTY 1) set(CMake_VERSION_IS_DIRTY 1)
else()
set(CMake_VERSION_IS_DIRTY 0)
endif() endif()
endif() endif()
endif() endif()