r19226 by craig - Add CMake option WANT_SVNVERSION to include SVN version in about.cpp to avoid issues on non svn systems, see CMake bug #10200

scribus-commit scribus-commit at lists.scribus.net
Sat Jun 14 21:55:11 UTC 2014


Author: craig
Date: Sat Jun 14 21:55:10 2014
New Revision: 19226

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19226
Log:
Add CMake option WANT_SVNVERSION to include SVN version in about.cpp to avoid issues on non svn systems, see CMake bug #10200

Modified:
    trunk/Scribus/cmake/modules/getsvn.cmake
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/ui/about.cpp

Modified: trunk/Scribus/cmake/modules/getsvn.cmake
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19226&path=/trunk/Scribus/cmake/modules/getsvn.cmake
==============================================================================
--- trunk/Scribus/cmake/modules/getsvn.cmake (original)
+++ trunk/Scribus/cmake/modules/getsvn.cmake Sat Jun 14 21:55:10 2014
@@ -1,9 +1,11 @@
 # the FindSubversion.cmake module is part of the standard distribution
 include(FindSubversion)
-# extract working copy information for SOURCE_DIR into MY_XXX variables
-Subversion_WC_INFO(${SOURCE_DIR} MY)
-# write a file with the SVNVERSION define
-file(WRITE svnversion.h.txt "#define SVNVERSION ${MY_WC_REVISION}\n")
-# copy the file to the final header only if the version changes
-# reduces needless rebuilds
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different svnversion.h.txt svnversion.h)
+if(SUBVERSION_FOUND)
+	# extract working copy information for SOURCE_DIR into MY_XXX variables
+	Subversion_WC_INFO(${SOURCE_DIR} MY)
+	# write a file with the SVNVERSION define
+	file(WRITE svnversion.h.txt "#define SVNVERSION ${MY_WC_REVISION}\n")
+	# copy the file to the final header only if the version changes
+	# reduces needless rebuilds
+	execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different svnversion.h.txt svnversion.h)
+endif(SUBVERSION_FOUND)

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19226&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Sat Jun 14 21:55:10 2014
@@ -1,24 +1,19 @@
-#add_custom_target(svnheader ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/svnheader.h)
-#add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/svnheader.h
-#	COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-#						 -P ${CMAKE_MODULE_PATH}/getsvn.cmake)
-#set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
-#	PROPERTIES GENERATED TRUE
-#	HEADER_FILE_ONLY TRUE)
-
-
-# a custom target that is always built
-add_custom_target(svnheader ALL
-	DEPENDS svn_header ) # svn_header is nothing more than a unique string
-
-# creates svnheader.h using cmake script
-add_custom_command(OUTPUT svn_header ${CMAKE_CURRENT_BINARY_DIR}/svnheader.h
-	COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-						 -P ${CMAKE_MODULE_PATH}/getsvn.cmake)
-
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
-	PROPERTIES GENERATED TRUE
-	HEADER_FILE_ONLY TRUE)
+
+IF (WANT_SVNVERSION)
+	MESSAGE(STATUS "SVN Version requested in About dialog")
+	# a custom target that is always built
+	add_custom_target(svnheader ALL
+		DEPENDS svn_header ) # svn_header is nothing more than a unique string
+
+	# creates svnheader.h using cmake script
+	add_custom_command(OUTPUT svn_header ${CMAKE_CURRENT_BINARY_DIR}/svnheader.h
+		COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
+							 -P ${CMAKE_MODULE_PATH}/getsvn.cmake)
+
+	set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
+		PROPERTIES GENERATED TRUE
+		HEADER_FILE_ONLY TRUE)
+ENDIF (WANT_SVNVERSION)
 
 IF(WIN32)
 	ADD_DEFINITIONS(-DQT_DLL)

Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19226&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Sat Jun 14 21:55:10 2014
@@ -33,8 +33,8 @@
 #include "scconfig.h"
 #include "scpaths.h"
 #include "sctextbrowser.h"
-#ifndef Q_OS_WIN
-#include "svnversion.h"
+#ifdef WANT_SVNVERSION
+	#include "svnversion.h"
 #endif
 #include "util_ghostscript.h"
 #include "util_icon.h"
@@ -133,13 +133,14 @@
 	if (BUILD_NAME == "BleedingEdge")
 		built = tr("%3-%2-%1 %4 %5").arg(BUILD_DAY).arg(BUILD_MONTH).arg(BUILD_YEAR).arg(BUILD_TIME).arg(BUILD_TZ);
 
-#ifndef Q_OS_WIN
-	QString revText;
-	revText=QString("SVN Revision: %1").arg(SVNVERSION);
-	built+=" - ";
-	built+=revText;
+#ifdef WANT_SVNVERSION
+	#ifdef SVNVERSION
+		QString revText;
+		revText=QString("SVN Revision: %1").arg(SVNVERSION);
+		built+=" - ";
+		built+=revText;
+	#endif
 #endif
-
 	QString bu;
 	bu += "C";
 	bu += "-";




More information about the scribus-commit mailing list