Bring back KICAD_REPO_NAME
This commit is contained in:
parent
7e3c0258aa
commit
b9c62b658e
|
@ -41,13 +41,13 @@ endif()
|
||||||
# If KICAD_BRANCH_NAME is empty, set KICAD_FULL_VERSION to just the build
|
# If KICAD_BRANCH_NAME is empty, set KICAD_FULL_VERSION to just the build
|
||||||
# version rather than the concatenation of the build version and the branch
|
# version rather than the concatenation of the build version and the branch
|
||||||
# name.
|
# name.
|
||||||
if( KICAD_BUILD_VERSION )
|
if( KICAD_BUILD_VERSION AND KICAD_REPO_NAME )
|
||||||
|
set( KICAD_FULL_VERSION "${KICAD_BUILD_VERSION}-${KICAD_REPO_NAME}" )
|
||||||
|
elseif( KICAD_BUILD_VERSION )
|
||||||
set( KICAD_FULL_VERSION "${KICAD_BUILD_VERSION}" )
|
set( KICAD_FULL_VERSION "${KICAD_BUILD_VERSION}" )
|
||||||
elseif( KICAD_BRANCH_NAME AND KICAD_GIT_BUILD_VERSION )
|
elseif( KICAD_BRANCH_NAME AND KICAD_GIT_BUILD_VERSION )
|
||||||
set( KICAD_BUILD_VERSION "${KICAD_GIT_BUILD_VERSION}" )
|
|
||||||
set( KICAD_FULL_VERSION "${KICAD_GIT_BUILD_VERSION}-${KICAD_BRANCH_NAME}" )
|
set( KICAD_FULL_VERSION "${KICAD_GIT_BUILD_VERSION}-${KICAD_BRANCH_NAME}" )
|
||||||
else()
|
else()
|
||||||
set( KICAD_BUILD_VERSION "unknown" )
|
|
||||||
set( KICAD_FULL_VERSION "unknown" )
|
set( KICAD_FULL_VERSION "unknown" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -60,8 +60,6 @@ set( _wvh_new_version_text
|
||||||
#ifndef __KICAD_VERSION_H__
|
#ifndef __KICAD_VERSION_H__
|
||||||
#define __KICAD_VERSION_H__
|
#define __KICAD_VERSION_H__
|
||||||
|
|
||||||
#define KICAD_BUILD_VERSION \"${KICAD_BUILD_VERSION}\"
|
|
||||||
#define KICAD_BRANCH_NAME \"${KICAD_BRANCH_NAME}\"
|
|
||||||
#define KICAD_FULL_VERSION \"${KICAD_FULL_VERSION}\"
|
#define KICAD_FULL_VERSION \"${KICAD_FULL_VERSION}\"
|
||||||
|
|
||||||
#endif /* __KICAD_VERSION_H__ */
|
#endif /* __KICAD_VERSION_H__ */
|
||||||
|
@ -79,7 +77,7 @@ if( EXISTS ${OUTPUT_FILE} )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( _wvh_write_version_file )
|
if( _wvh_write_version_file )
|
||||||
message( STATUS "Writing ${OUTPUT_FILE} file with version: ${_wvh_version_str}" )
|
message( STATUS "Writing ${OUTPUT_FILE} file with version: ${KICAD_FULL_VERSION}" )
|
||||||
|
|
||||||
file( WRITE ${OUTPUT_FILE} ${_wvh_new_version_text} )
|
file( WRITE ${OUTPUT_FILE} ${_wvh_new_version_text} )
|
||||||
|
|
||||||
|
|
|
@ -131,12 +131,14 @@ endif()
|
||||||
# KiCad build version string defaults to undefined which forces the build version header
|
# KiCad build version string defaults to undefined which forces the build version header
|
||||||
# command to look for Bazaar to create the version string header.
|
# command to look for Bazaar to create the version string header.
|
||||||
set( KICAD_BUILD_VERSION "" CACHE STRING "Version string defined at configuration time." )
|
set( KICAD_BUILD_VERSION "" CACHE STRING "Version string defined at configuration time." )
|
||||||
|
set( KICAD_REPO_NAME "" CACHE STRING "KiCad repository name." )
|
||||||
|
|
||||||
# Generate version header file.
|
# Generate version header file.
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
version_header ALL
|
version_header ALL
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DKICAD_BUILD_VERSION=${KICAD_BUILD_VERSION}
|
-DKICAD_BUILD_VERSION=${KICAD_BUILD_VERSION}
|
||||||
|
-DKICAD_REPO_NAME=${KICAD_REPO_NAME}
|
||||||
-DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h
|
-DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h
|
||||||
-DSRC_PATH=${PROJECT_SOURCE_DIR}
|
-DSRC_PATH=${PROJECT_SOURCE_DIR}
|
||||||
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
|
||||||
|
|
Loading…
Reference in New Issue