Patch #19667: cmake/windows build info now has time & date,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 19 Oct 2009 17:18:31 +0000 (17:18 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 19 Oct 2009 17:18:31 +0000 (17:18 +0000)
patch by Guillaume, thanks!

CMakeLists.txt

index 55d5956783c5279e1e6612fb88e2db593f747b81..ea62bbceb0e9d44f9c2390eec358c0bc16a7128e 100644 (file)
@@ -535,15 +535,21 @@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
 
 
 # buildinfo
-IF(UNIX)
-       IF(WITH_BUILDINFO)
+IF(WITH_BUILDINFO)
+       # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
+       IF(UNIX)
                EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
                EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)  
                EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
-               # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
-       ENDIF(WITH_BUILDINFO)
-ENDIF(UNIX)
-
+       ENDIF(UNIX)
+       
+       IF(WIN32)
+               EXEC_PROGRAM("cmd /c date /t" OUTPUT_VARIABLE BUILD_DATE)
+               EXEC_PROGRAM("cmd /c time /t" OUTPUT_VARIABLE BUILD_TIME)  
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
+       ENDIF(WIN32)
+ENDIF(WITH_BUILDINFO)
+       
 #-----------------------------------------------------------------------------
 # Common.