From 0d3fdf458f87f24d8a614d03821ab5a0606772bb Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Fri, 12 Feb 2010 10:46:50 -0500
Subject: [PATCH] Fix KWSYS_PLATFORM_INFO_TEST when user removes tree

In commit 'Create KWSYS_PLATFORM_INFO_TEST macro' (2009-11-20) we
implemented the macro to use a cache entry to avoid re-running the
try_compile().  However, the output copied from the try_compile is
needed on every configure.  If the user wipes out the build tree but not
the cache file then the try_compile() will not re-run to recreate the
needed file.  We address the problem by teaching the macro to run the
try_compile() whenever its output file does not exist.
---
 kwsysDateStamp.cmake     | 4 ++--
 kwsysPlatformTests.cmake | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kwsysDateStamp.cmake b/kwsysDateStamp.cmake
index b961c1e..5fb0376 100644
--- a/kwsysDateStamp.cmake
+++ b/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2010)
 
 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 01)
+SET(KWSYS_DATE_STAMP_MONTH 02)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   27)
+SET(KWSYS_DATE_STAMP_DAY   12)
diff --git a/kwsysPlatformTests.cmake b/kwsysPlatformTests.cmake
index 994b7e7..d042450 100644
--- a/kwsysPlatformTests.cmake
+++ b/kwsysPlatformTests.cmake
@@ -177,7 +177,7 @@ MACRO(KWSYS_PLATFORM_INFO_TEST lang var description)
       ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${var}.bin)
 
     # Compile the test binary.
-    IF(NOT DEFINED ${var}_COMPILED)
+    IF(NOT EXISTS ${KWSYS_PLATFORM_INFO_FILE})
       MESSAGE(STATUS "${description}")
       TRY_COMPILE(${var}_COMPILED
         ${CMAKE_CURRENT_BINARY_DIR}
-- 
GitLab