Avoid recompiling everything if we modify the code generator

This commit is contained in:
David Capello 2015-08-04 18:24:09 -03:00
parent 3103f54131
commit d7ad5bb2c0

View File

@ -9,7 +9,8 @@ foreach(widget_file ${widget_files})
add_custom_command(
OUTPUT ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${widget_file} --widgetid ${widget_name} > ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${widget_file} --widgetid ${widget_name} > ${output_fn}.tmp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${output_fn}.tmp ${output_fn}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${widget_file}
DEPENDS gen)
@ -23,7 +24,8 @@ set(pref_xml ${CMAKE_SOURCE_DIR}/data/pref.xml)
set(output_fn ${CMAKE_CURRENT_BINARY_DIR}/generated_pref_types.h)
add_custom_command(
OUTPUT ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${pref_xml} --pref-h > ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${pref_xml} --pref-h > ${output_fn}.tmp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${output_fn}.tmp ${output_fn}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${pref_xml}
DEPENDS gen)
@ -32,7 +34,8 @@ list(APPEND generated_files ${output_fn})
set(output_fn ${CMAKE_CURRENT_BINARY_DIR}/generated_pref_types.cpp)
add_custom_command(
OUTPUT ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${pref_xml} --pref-cpp > ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${pref_xml} --pref-cpp > ${output_fn}.tmp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${output_fn}.tmp ${output_fn}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${pref_xml}
DEPENDS gen)
@ -43,7 +46,8 @@ set(skin_xml ${CMAKE_SOURCE_DIR}/data/skins/default/skin.xml)
set(output_fn ${CMAKE_CURRENT_BINARY_DIR}/generated_skin.h)
add_custom_command(
OUTPUT ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${skin_xml} --skin > ${output_fn}
COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${skin_xml} --skin > ${output_fn}.tmp
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${output_fn}.tmp ${output_fn}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
MAIN_DEPENDENCY ${skin_xml}
DEPENDS gen)