kicad-source/CMakeModules/CreateSVNVersionHeader.cmake
f3nix 422ffdabc1 CMake:
* Require CMake version 2.6.1 on Windows and version 2.6.0 for other systems.
* Update FindSubversion to version from CMake 2.6.1 (localization issue solved).
* Remove FindwxWidgetsCVS and use the default one (some issues solved upstream).
* Formatting style changes.
2008-09-07 19:32:07 +00:00

26 lines
1.2 KiB
CMake

macro(create_svn_version_header)
# 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})")
set(KICAD_ABOUT_VERSION
"SVN-R${Kicad_WC_LAST_CHANGED_REV} (${_kicad_svn_date})")
# Definition to conditionally use date and revision returned from the
# 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.
configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake
${CMAKE_BINARY_DIR}/config.h)
endif(Subversion_FOUND)
endmacro(create_svn_version_header)