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" )
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} )
39
45
set( _wvh_version_str ${KICAD_BUILD_VERSION} )