From b9c62b658e710717aee05ae6bf0df8586a972e50 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Sat, 12 Nov 2016 16:08:20 -0500 Subject: [PATCH] Bring back KICAD_REPO_NAME --- CMakeModules/WriteVersionHeader.cmake | 10 ++++------ common/CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeModules/WriteVersionHeader.cmake b/CMakeModules/WriteVersionHeader.cmake index 45f3232224..7b4dd393f6 100644 --- a/CMakeModules/WriteVersionHeader.cmake +++ b/CMakeModules/WriteVersionHeader.cmake @@ -41,13 +41,13 @@ endif() # 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 # 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}" ) 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}" ) else() - set( KICAD_BUILD_VERSION "unknown" ) set( KICAD_FULL_VERSION "unknown" ) endif() @@ -60,8 +60,6 @@ set( _wvh_new_version_text #ifndef __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}\" #endif /* __KICAD_VERSION_H__ */ @@ -79,7 +77,7 @@ if( EXISTS ${OUTPUT_FILE} ) endif() 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} ) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f6a759d73b..da08d2b5ac 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -131,12 +131,14 @@ endif() # KiCad build version string defaults to undefined which forces the build version 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_REPO_NAME "" CACHE STRING "KiCad repository name." ) # Generate version header file. add_custom_target( version_header ALL COMMAND ${CMAKE_COMMAND} -DKICAD_BUILD_VERSION=${KICAD_BUILD_VERSION} + -DKICAD_REPO_NAME=${KICAD_REPO_NAME} -DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h -DSRC_PATH=${PROJECT_SOURCE_DIR} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}