reduce compile time after each time cmake configure is executed (Version.h)

This commit is contained in:
wmayer
2018-08-21 14:06:33 +02:00
parent 4211defb4a
commit 3927a2ed8b
3 changed files with 23 additions and 16 deletions

View File

@@ -27,22 +27,24 @@ MACRO (fc_copy_sources target_name outpath)
ENDMACRO(fc_copy_sources)
MACRO (fc_copy_file_if_different inputfile outputfile)
if (EXISTS ${outputfile})
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files ${inputfile}
${outputfile}
RESULT_VARIABLE DIFFERENT_FILES
OUTPUT_QUIET
ERROR_QUIET
)
if (EXISTS ${inputfile})
if (EXISTS ${outputfile})
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files ${inputfile}
${outputfile}
RESULT_VARIABLE DIFFERENT_FILES
OUTPUT_QUIET
ERROR_QUIET
)
if (DIFFERENT_FILES)
if (DIFFERENT_FILES)
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${inputfile}"
"${outputfile}")
endif()
else()
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${inputfile}"
"${outputfile}")
endif()
else()
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${inputfile}"
"${outputfile}")
endif()
ENDMACRO(fc_copy_file_if_different)