summaryrefslogtreecommitdiff
path: root/cmake/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/scripts')
-rw-r--r--cmake/scripts/CreateGRF.cmake18
1 files changed, 16 insertions, 2 deletions
diff --git a/cmake/scripts/CreateGRF.cmake b/cmake/scripts/CreateGRF.cmake
index 8631284f3..d47e39aa0 100644
--- a/cmake/scripts/CreateGRF.cmake
+++ b/cmake/scripts/CreateGRF.cmake
@@ -39,6 +39,20 @@ foreach(NFO_LINE IN LISTS NFO_LINES)
endif()
endforeach()
-execute_process(COMMAND ${NFORENUM_EXECUTABLE} -s sprites/${GRF_SOURCE_FOLDER_NAME}.nfo)
-execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -p1 ${GRF_SOURCE_FOLDER_NAME}.grf)
+execute_process(COMMAND ${NFORENUM_EXECUTABLE} -s sprites/${GRF_SOURCE_FOLDER_NAME}.nfo RESULT_VARIABLE RESULT)
+if(RESULT)
+ if(NOT RESULT MATCHES "^[0-9]*$")
+ message(FATAL_ERROR "Failed to run NFORenum (${RESULT}), please check NFORENUM_EXECUTABLE variable")
+ endif()
+ message(FATAL_ERROR "NFORenum failed")
+endif()
+
+execute_process(COMMAND ${GRFCODEC_EXECUTABLE} -n -s -e -p1 ${GRF_SOURCE_FOLDER_NAME}.grf RESULT_VARIABLE RESULT)
+if(RESULT)
+ if(NOT RESULT MATCHES "^[0-9]*$")
+ message(FATAL_ERROR "Failed to run GRFCodec (${RESULT}), please check GRFCODEC_EXECUTABLE variable")
+ endif()
+ message(FATAL_ERROR "GRFCodec failed")
+endif()
+
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${GRF_SOURCE_FOLDER_NAME}.grf ${GRF_BINARY_FILE})