Skip to content

Commit 83fd65a

Browse files
committed
only update qgsexpression_texts.cpp if there are actual changes
1 parent 928504a commit 83fd65a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

resources/process_function_template.py renamed to scripts/process_function_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import glob
55

6-
cpp = open("src/core/qgsexpression_texts.cpp", "w")
6+
cpp = open(sys.argv[1], "w")
77
cpp.write(
88
"#include \"qgsexpression.h\"\n"
99
"\n"

src/core/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ STRING(REPLACE "$" "$$" JSON_HELP_FILES "${JSON_HELP_FILES}")
332332
STRING(REPLACE "\(" "\\(" JSON_HELP_FILES "${JSON_HELP_FILES}")
333333
STRING(REPLACE "\)" "\\)" JSON_HELP_FILES "${JSON_HELP_FILES}")
334334
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp
335-
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/resources/process_function_template.py
335+
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/process_function_template.py ${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp
336+
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
336337
DEPENDS ${JSON_HELP_FILES}
337338
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
338339
)

0 commit comments

Comments
 (0)