Merge from trunk -r 23968:24181.
[blender.git] / CMakeLists.txt
index 5cb14f373050eb36da2395d4fd988991000940b2..a649a5e0a8df8d2df1f97d5ecc94d11f2c21d859 100644 (file)
@@ -549,15 +549,27 @@ 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)
-
+               EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV RETURN_VALUE BUILD_REV_RETURN)
+               IF(BUILD_REV_RETURN)
+                       SET(BUILD_REV "unknown")
+               ENDIF(BUILD_REV_RETURN)
+       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 RETURN_VALUE BUILD_REV_RETURN)
+               IF(BUILD_REV_RETURN)
+                       SET(BUILD_REV "unknown")
+               ENDIF(BUILD_REV_RETURN)
+       ENDIF(WIN32)
+ENDIF(WITH_BUILDINFO)
+       
 #-----------------------------------------------------------------------------
 # Common.