~azonenberg/kicad/advanced-feature-bugfixes

« back to all changes in this revision

Viewing changes to CMakeModules/WriteVersionHeader.cmake

  • Committer: Andrew Zonenberg
  • Date: 2015-07-13 14:53:19 UTC
  • mfrom: (5925.1.8 kicad)
  • Revision ID: azonenberg@skipjack.lab.troy.drawersteak.com-20150713145319-t46thznnhqghkndy
Merged changes from mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#
24
24
 
25
25
# Automagically create version header file if the version string was not defined during
26
 
# the build configuration.  If CreateBzrVersionHeader cannot determine the current repo,
27
 
# version, a version.h file is still created with KICAD_BUILD_VERSION set to "no-bzr".
 
26
# the build configuration.  If CreateBzrVersionHeader or CreateGitVersionHeader cannot
 
27
# determine the current repo version, a version.h file is still created with
 
28
# KICAD_BUILD_VERSION set to "no-vcs-found".
28
29
if( NOT KICAD_BUILD_VERSION )
29
30
    set( _wvh_version_str "no-vcs-found" )
30
31
 
31
 
    # If the code is managed by Bazaar, used bzr to determine the version string.
 
32
    # Detect the appropiate VCS and set the version string.
32
33
    if( EXISTS "${SRC_PATH}/.bzr" )
33
34
        message( STATUS "Using Bazaar to determine build version string." )
34
35
        include( ${CMAKE_MODULE_PATH}/CreateBzrVersionHeader.cmake )
35
36
        create_bzr_version_header( ${SRC_PATH} )
36
37
        set( _wvh_version_str ${KICAD_BUILD_VERSION} )
 
38
    elseif( EXISTS "${SRC_PATH}/.git" )
 
39
        message( STATUS "Using Git to determine build version string." )
 
40
        include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
 
41
        create_git_version_header( ${SRC_PATH} )
 
42
        set( _wvh_version_str ${KICAD_BUILD_VERSION} )
37
43
    endif()
38
44
else()
39
45
    set( _wvh_version_str ${KICAD_BUILD_VERSION} )