Commit 994e4e5d authored by stambaughw's avatar stambaughw
Browse files

Use Subversion to automatically generate date and version information when building with CMake.

parent 9021d9d0
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -25,6 +25,23 @@ if(CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g3 -ggdb3 -DDEBUG")
endif(CMAKE_COMPILER_IS_GNUCXX)

# Include Subversion support to automagically create version header file.
find_package( Subversion )
if( Subversion_FOUND )
    Subversion_WC_INFO( ${PROJECT_SOURCE_DIR} Kicad )
    string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+).*" "\\1\\2\\3"
            _kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE} )
    set( KICAD_SVN_VERSION
         "(${_kicad_svn_date} SVN-R${Kicad_WC_LAST_CHANGED_REV})" )

    # Definition to conditionally use date and revision returned from the
    # Subversion info command instead of hand coded date and revision in
    # "include/build_verison.h".  If subversion is not found or the hand
    # coded make files are used then the date and version information must
    # be manually edited.
    add_definitions( -DHAVE_SVN_VERSION )
endif( Subversion_FOUND )

# Locations for install targets.
set(KICAD_BIN bin CACHE PATH "Location of KiCad binaries.")

@@ -78,10 +95,15 @@ include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler.
include(MinGWResourceCompiler)

# Generate config.h.
configure_file( ${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake
                ${CMAKE_BINARY_DIR}/config.h )

# Include paths.
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${CMAKE_CURRENT_SOURCE_DIR}/share)
    ${CMAKE_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/share
    ${CMAKE_BINARY_DIR})

# CMake will look in these dirs for nested 'CMakeLists.txt' files.
# Binaries.
+8 −0
Original line number Diff line number Diff line
/* Do not modify this file, it was automatically generated by CMake */

#ifndef __KICAD_SVN_VERSION_H__
#define __KICAD_SVN_VERSION_H__

#cmakedefine KICAD_SVN_VERSION "@KICAD_SVN_VERSION@"

#endif  /* __KICAD_SVN_VERSION_H__ */
+7 −0
Original line number Diff line number Diff line
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.

2008-May-2 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
+cmake
  * Use Subversion to automatically generate build date and revision level
    when building with CMake.  Header file build_version.h will still need
    manual updates when using the hand written make files.


2008-May-2 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+6 −1
Original line number Diff line number Diff line
@@ -5,8 +5,13 @@

COMMON_GLOBL wxString g_BuildVersion
#ifdef EDA_BASE
#  ifdef HAVE_SVN_VERSION
#    include "config.h"
     (wxT(KICAD_SVN_VERSION))
#  else
     (wxT("(20080429-r1010)"))
#  endif
#endif
;

#endif	// KICAD_BUILD_VERSION