diff --git a/cmake/scripts/CreateGRF.cmake b/cmake/scripts/CreateGRF.cmake --- a/cmake/scripts/CreateGRF.cmake +++ b/cmake/scripts/CreateGRF.cmake @@ -5,18 +5,18 @@ cmake_minimum_required(VERSION 3.5) # files. # -if (NOT NFORENUM_EXECUTABLE) +if(NOT NFORENUM_EXECUTABLE) message(FATAL_ERROR "Script needs NFORENUM_EXECUTABLE defined") -endif (NOT NFORENUM_EXECUTABLE) -if (NOT GRFCODEC_EXECUTABLE) +endif() +if(NOT GRFCODEC_EXECUTABLE) message(FATAL_ERROR "Script needs GRFCODEC_EXECUTABLE defined") -endif (NOT GRFCODEC_EXECUTABLE) -if (NOT GRF_SOURCE_FOLDER) +endif() +if(NOT GRF_SOURCE_FOLDER) message(FATAL_ERROR "Script needs GRF_SOURCE_FOLDER defined") -endif (NOT GRF_SOURCE_FOLDER) -if (NOT GRF_BINARY_FILE) +endif() +if(NOT GRF_BINARY_FILE) message(FATAL_ERROR "Script needs GRF_BINARY_FILE defined") -endif (NOT GRF_BINARY_FILE) +endif() get_filename_component(GRF_SOURCE_FOLDER_NAME "${GRF_SOURCE_FOLDER}" NAME) @@ -30,14 +30,14 @@ foreach(NFO_LINE IN LISTS NFO_LINES) # Recover the ; that was really in the text (and not a newline) string(REPLACE "\\;" ";" NFO_LINE "${NFO_LINE}") - if (NFO_LINE MATCHES "^#include") + if(NFO_LINE MATCHES "^#include") string(REGEX REPLACE "^#include \"(.*)\"$" "\\1" INCLUDE_FILE ${NFO_LINE}) file(READ ${GRF_SOURCE_FOLDER}/${INCLUDE_FILE} INCLUDE_LINES) file(APPEND sprites/${GRF_SOURCE_FOLDER_NAME}.nfo "${INCLUDE_LINES}") - else (NFO_LINE MATCHES "^#include") + else() file(APPEND sprites/${GRF_SOURCE_FOLDER_NAME}.nfo "${NFO_LINE}\n") - endif (NFO_LINE MATCHES "^#include") -endforeach(NFO_LINE) + 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)