From 83fd65ab610b0fc8018035eb0e38db98c858b212 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Wed, 30 Sep 2015 13:39:52 +0200 Subject: [PATCH] only update qgsexpression_texts.cpp if there are actual changes --- {resources => scripts}/process_function_template.py | 2 +- src/core/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename {resources => scripts}/process_function_template.py (98%) diff --git a/resources/process_function_template.py b/scripts/process_function_template.py similarity index 98% rename from resources/process_function_template.py rename to scripts/process_function_template.py index 62ef43cbb9e..3e9ecc85867 100644 --- a/resources/process_function_template.py +++ b/scripts/process_function_template.py @@ -3,7 +3,7 @@ import os import json import glob -cpp = open("src/core/qgsexpression_texts.cpp", "w") +cpp = open(sys.argv[1], "w") cpp.write( "#include \"qgsexpression.h\"\n" "\n" diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3f5690cd83e..1cc4a3b4162 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -332,7 +332,8 @@ STRING(REPLACE "$" "$$" JSON_HELP_FILES "${JSON_HELP_FILES}") STRING(REPLACE "\(" "\\(" JSON_HELP_FILES "${JSON_HELP_FILES}") STRING(REPLACE "\)" "\\)" JSON_HELP_FILES "${JSON_HELP_FILES}") ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/resources/process_function_template.py + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/process_function_template.py ${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp + COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp -DDST=${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake DEPENDS ${JSON_HELP_FILES} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )