From d7f46403bb114455350f2efcdd06c1b1bd88fe8f Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 5 Apr 2017 17:35:23 -0400 Subject: [PATCH] generate changes.h in binary dir closes #4102 --- doc/news/changes/create_changes_h.cmake | 40 +++++++++++++------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/doc/news/changes/create_changes_h.cmake b/doc/news/changes/create_changes_h.cmake index 28148df270..8968bd1a33 100644 --- a/doc/news/changes/create_changes_h.cmake +++ b/doc/news/changes/create_changes_h.cmake @@ -42,24 +42,26 @@ ENDFUNCTION() # Generate 'changes.h'. # First, create a file 'changes.h.in' based on all changelog fragments. -FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "") -CAT (${CMAKE_CURRENT_SOURCE_DIR}/header - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE") -CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_incompatibilities - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE") -PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/incompatibilities - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in) -CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_major - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE") -PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/major - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in) -CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_minor - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE") -PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/minor - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in) -CAT (${CMAKE_CURRENT_SOURCE_DIR}/footer - ${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in "FALSE") +SET(OUTPUT_FILE_TEMP "${OUTPUT_FILE}.in") +FILE(WRITE ${OUTPUT_FILE_TEMP} "") +CAT (${CMAKE_CURRENT_SOURCE_DIR}/header + ${OUTPUT_FILE_TEMP} "FALSE") +CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_incompatibilities + ${OUTPUT_FILE_TEMP} "FALSE") +PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/incompatibilities + ${OUTPUT_FILE_TEMP}) +CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_major + ${OUTPUT_FILE_TEMP} "FALSE") +PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/major + ${OUTPUT_FILE_TEMP}) +CAT (${CMAKE_CURRENT_SOURCE_DIR}/header_minor + ${OUTPUT_FILE_TEMP} "FALSE") +PROCESS(${CMAKE_CURRENT_SOURCE_DIR}/minor + ${OUTPUT_FILE_TEMP}) +CAT (${CMAKE_CURRENT_SOURCE_DIR}/footer + ${OUTPUT_FILE_TEMP} "FALSE") -# Copy it over to 'changes.h' but only touch the time stamp +# Copy it over to 'changes.h' but only touch the time stamp # if the file actually changed (this is what CONFIGURE_FILE does). -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/changes.h.in ${OUTPUT_FILE} COPYONLY) +MESSAGE(STATUS "Generating changelog file: ${OUTPUT_FILE}") +CONFIGURE_FILE(${OUTPUT_FILE_TEMP} ${OUTPUT_FILE} COPYONLY) -- 2.39.5