From 9dc5bc4c668d69342d75983dcba6e9bb43120e95 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 24 Nov 2015 11:05:34 +0100 Subject: [PATCH] Rename the automatically generated version.h to kicad_build_version.h as a workaround to an issue in msys2: for a very obscure reason, version.h was added as dependency to most of .cpp files. --- CMakeModules/WriteVersionHeader.cmake | 4 ++-- common/CMakeLists.txt | 2 +- common/build_version.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeModules/WriteVersionHeader.cmake b/CMakeModules/WriteVersionHeader.cmake index c08c61ed3e..0adf6af3dd 100644 --- a/CMakeModules/WriteVersionHeader.cmake +++ b/CMakeModules/WriteVersionHeader.cmake @@ -49,7 +49,7 @@ set( _wvh_write_version_file ON ) # Compare the version argument against the version in the existing header file for a mismatch. if( EXISTS ${OUTPUT_FILE} ) - file( STRINGS ${CMAKE_BINARY_DIR}/version.h _current_version_str + file( STRINGS ${OUTPUT_FILE} _current_version_str REGEX "^#define[\t ]+KICAD_BUILD_VERSION[\t ]+.*" ) string( REGEX REPLACE "^#define KICAD_BUILD_VERSION \"([()a-zA-Z0-9 -.]+)\".*" "\\1" _wvh_last_version "${_current_version_str}" ) @@ -82,6 +82,6 @@ if( _wvh_write_version_file ) endif() # There should always be a valid version.h file. Otherwise, the build will fail. -if( NOT EXISTS ${CMAKE_BINARY_DIR}/version.h ) +if( NOT EXISTS ${OUTPUT_FILE} ) message( FATAL_ERROR "Configuration failed to write file ${OUTPUT_FILE}." ) endif() diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2d843cff0c..46708f7a84 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -124,7 +124,7 @@ add_custom_target( version_header ALL COMMAND ${CMAKE_COMMAND} -DKICAD_BUILD_VERSION=${KICAD_BUILD_VERSION} - -DOUTPUT_FILE=${CMAKE_BINARY_DIR}/version.h + -DOUTPUT_FILE=${CMAKE_BINARY_DIR}/kicad_build_version.h -DSRC_PATH=${PROJECT_SOURCE_DIR} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -P ${CMAKE_MODULE_PATH}/WriteVersionHeader.cmake diff --git a/common/build_version.cpp b/common/build_version.cpp index 1998c1a202..d8bd538475 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -22,12 +22,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/* Date for KiCad build version */ +// Date for KiCad build version #include // The include file version.h is always created even if the repo version cannot be // determined. In this case KICAD_BUILD_VERSION will default to "no-bzr". -#include +#include /**