[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35131] trunk/blender: fix for cmake not having the correct svn revision in buildinfo, now generate a header every build with the time, date, svn revision.

Nicholas Bishop nicholasbishop at gmail.com
Fri Feb 25 04:20:54 CET 2011


I had a bit of trouble with this commit: I'm using git-svn and the
cmake subversion module doesn't handle that case; the build fails with
an svn error about 'not a working directory'.

Googling a bit gave me a partial solution, small patch below. (Checks
for a .svn directory before trying to use the cmake module.) This
fixes the build with git-svn, although it doesn't actually feed it a
correct revision number.

-Nicholas

diff --git a/build_files/cmake/buildinfo.cmake
b/build_files/cmake/buildinfo.cmake
index 6d19592..ec09d1a 100644
--- a/build_files/cmake/buildinfo.cmake
+++ b/build_files/cmake/buildinfo.cmake
@@ -4,10 +4,14 @@
 # the FindSubversion.cmake module is part of the standard distribution
 include(FindSubversion)
 # extract working copy information for SOURCE_DIR into MY_XXX variables
-if(Subversion_FOUND)
-	Subversion_WC_INFO(${SOURCE_DIR} MY)
-else()
-	set(MY_WC_REVISION "unknown")
+
+set(MY_WC_REVISION "unknown")
+
+# check that this is a working copy
+if(EXISTS ${CMAKE_SOURCE_DIR}/.svn/)
+	if(Subversion_FOUND)
+		Subversion_WC_INFO(${SOURCE_DIR} MY)
+	endif()
 endif()

 # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake


More information about the Bf-committers mailing list