2008-05-05 18:23:24 +00:00
|
|
|
macro(create_svn_version_header)
|
|
|
|
# Include Subversion support to automagically create version header file.
|
2008-09-07 19:32:07 +00:00
|
|
|
find_package(Subversion)
|
2008-05-05 18:23:24 +00:00
|
|
|
if(Subversion_FOUND)
|
|
|
|
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Kicad)
|
|
|
|
string(REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+).*" "\\1\\2\\3"
|
2008-09-07 19:32:07 +00:00
|
|
|
_kicad_svn_date ${Kicad_WC_LAST_CHANGED_DATE})
|
2008-05-05 18:23:24 +00:00
|
|
|
set(KICAD_SVN_VERSION
|
|
|
|
"(${_kicad_svn_date} SVN-R${Kicad_WC_LAST_CHANGED_REV})")
|
2008-08-15 16:38:05 +00:00
|
|
|
set(KICAD_ABOUT_VERSION
|
|
|
|
"SVN-R${Kicad_WC_LAST_CHANGED_REV} (${_kicad_svn_date})")
|
2008-05-05 18:23:24 +00:00
|
|
|
|
|
|
|
# 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.
|
2008-08-29 14:06:19 +00:00
|
|
|
# Directive means SVN build, program version and build version will
|
|
|
|
# reflect this.
|
2008-05-05 18:23:24 +00:00
|
|
|
add_definitions(-DHAVE_SVN_VERSION)
|
|
|
|
|
|
|
|
# Generate config.h.
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/config.h.cmake
|
2008-09-07 19:32:07 +00:00
|
|
|
${CMAKE_BINARY_DIR}/config.h)
|
2008-05-05 18:23:24 +00:00
|
|
|
endif(Subversion_FOUND)
|
|
|
|
endmacro(create_svn_version_header)
|