Add date of generation and generator to build_config.h

In preparation for MSVC compilation support
master
Rogier 2016-05-23 12:04:11 +02:00
parent db11689b36
commit 38c0ee9962
2 changed files with 8 additions and 0 deletions

View File

@ -521,6 +521,12 @@ include(CPack)
# DO this near the end - to make sure all variables have been computed
# and are final.
set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(BUILD_CONFIG_GENTOOL CMake)
# CMake does not have a date format specifier for timezone...
execute_process(COMMAND date -R RESULT_VARIABLE DATE_EXITVAL OUTPUT_VARIABLE BUILD_CONFIG_GENDATE ERROR_FILE /dev/null OUTPUT_STRIP_TRAILING_WHITESPACE)
if(DATE_EXITVAL)
message(FATAL_ERROR "Failed to run command 'date -R'")
endif(DATE_EXITVAL)
configure_file(
"${PROJECT_SOURCE_DIR}/build_config.h.in"
"${PROJECT_BINARY_DIR}/build_config.h"

View File

@ -2,6 +2,8 @@
// will be overwritten.
//
// Modify the file build_config.h.in instead.
//
// This file was generated on @BUILD_CONFIG_GENDATE@ by @BUILD_CONFIG_GENTOOL@
#ifndef BUILD_CONFIG_H
#define BUILD_CONFIG_H