--- Source/CMakeVersionCompute.cmake.orig
+++ Source/CMakeVersionCompute.cmake
@@ -10,6 +10,9 @@
   set(CMake_VERSION_IS_DIRTY 0) # may be set to 1 by CMakeVersionSource
   set(CMake_VERSION_IS_RELEASE 0)
   include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
+  if(NOT CMake_VERSION_IS_DIRTY)
+    set(CMake_VERSION_IS_DIRTY 0)
+  endif()
 endif()
 
 # Compute the full version string.
