From 46f931b6ae18013ae83b604b2593498f9b307305 Mon Sep 17 00:00:00 2001 From: raburton Date: Fri, 29 Aug 2008 14:06:19 +0000 Subject: [PATCH] allow build version to be set, while preserving program version useful for creating a config.h via an extraction script that creates a source tar bundle --- CMakeLists.txt | 8 ++++++++ CMakeModules/CreateSVNVersionHeader.cmake | 2 ++ include/build_version.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87334f0eaa..666e4fd725 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,6 +117,14 @@ if(UNIX) create_svn_version_header() endif(UNIX) +if(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h) + # This file may exist (created by an alternate process to the svn test above), + # e.g. could be created by a checkout script that produces a source tar file. + # This directive means the about box will have the svn date & revision in it, + # but the hard coded release date (program version) will be preserved. + add_definitions(-DHAVE_SVN_REVISION) +endif(EXISTS ${CMAKE_SOURCE_DIR}/include/config.h) + # Include paths. include_directories(${CMAKE_SOURCE_DIR}/include diff --git a/CMakeModules/CreateSVNVersionHeader.cmake b/CMakeModules/CreateSVNVersionHeader.cmake index 62ef2d861b..afe756543b 100644 --- a/CMakeModules/CreateSVNVersionHeader.cmake +++ b/CMakeModules/CreateSVNVersionHeader.cmake @@ -14,6 +14,8 @@ macro(create_svn_version_header) # Subversion info command instead of hand coded date and revision in # "include/build_version.h". If subversion is not found then the date # and version information must be manually edited. + # Directive means SVN build, program version and build version will + # reflect this. add_definitions(-DHAVE_SVN_VERSION) # Generate config.h. diff --git a/include/build_version.h b/include/build_version.h index 9f8f984c43..b3c07ec931 100644 --- a/include/build_version.h +++ b/include/build_version.h @@ -16,7 +16,7 @@ COMMON_GLOBL wxString g_BuildVersion COMMON_GLOBL wxString g_BuildAboutVersion #ifdef EDA_BASE -# ifdef HAVE_SVN_VERSION +# if defined(HAVE_SVN_VERSION) || defined(HAVE_SVN_REVISION) # include "config.h" (wxT(KICAD_ABOUT_VERSION)) # else