forked from mirror/OpenTTD
Codechange: Make codestyle for CMake files consistent for 'control' statements
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
if (NOT INCLUDES_SOURCE_FILE)
|
||||
if(NOT INCLUDES_SOURCE_FILE)
|
||||
message(FATAL_ERROR "Script needs INCLUDES_SOURCE_FILE defined")
|
||||
endif (NOT INCLUDES_SOURCE_FILE)
|
||||
if (NOT INCLUDES_BINARY_FILE)
|
||||
endif()
|
||||
if(NOT INCLUDES_BINARY_FILE)
|
||||
message(FATAL_ERROR "Script needs INCLUDES_BINARY_FILE defined")
|
||||
endif (NOT INCLUDES_BINARY_FILE)
|
||||
if (NOT APILC)
|
||||
endif()
|
||||
if(NOT APILC)
|
||||
message(FATAL_ERROR "Script needs APILC defined")
|
||||
endif (NOT APILC)
|
||||
if (NOT APIUC)
|
||||
endif()
|
||||
if(NOT APIUC)
|
||||
message(FATAL_ERROR "Script needs APIUC defined")
|
||||
endif (NOT APIUC)
|
||||
endif()
|
||||
|
||||
set(ARGC 1)
|
||||
set(ARG_READ NO)
|
||||
@@ -21,32 +21,32 @@ set(ARG_READ NO)
|
||||
while(ARGC LESS CMAKE_ARGC)
|
||||
set(ARG ${CMAKE_ARGV${ARGC}})
|
||||
|
||||
if (ARG_READ)
|
||||
if(ARG_READ)
|
||||
list(APPEND SCRIPT_API_BINARY_FILES "${ARG}")
|
||||
endif (ARG_READ)
|
||||
endif()
|
||||
|
||||
if (ARG STREQUAL "--")
|
||||
if(ARG STREQUAL "--")
|
||||
set(ARG_READ YES)
|
||||
endif (ARG STREQUAL "--")
|
||||
endif()
|
||||
|
||||
math(EXPR ARGC "${ARGC} + 1")
|
||||
endwhile()
|
||||
|
||||
foreach(FILE IN LISTS SCRIPT_API_BINARY_FILES)
|
||||
file(STRINGS "${FILE}" LINES REGEX "^void SQ${APIUC}.*_Register\\(Squirrel \\*engine\\)$")
|
||||
if (LINES)
|
||||
if(LINES)
|
||||
string(REGEX REPLACE ".*api/${APILC}/(.*)" "#include \"\\1\"" FILE "${FILE}")
|
||||
list(APPEND SQUIRREL_INCLUDES "${FILE}")
|
||||
foreach(LINE IN LISTS LINES)
|
||||
if ("${LINE}" MATCHES "SQ${APIUC}(List|Controller)_Register")
|
||||
if("${LINE}" MATCHES "SQ${APIUC}(List|Controller)_Register")
|
||||
continue()
|
||||
endif ("${LINE}" MATCHES "SQ${APIUC}(List|Controller)_Register")
|
||||
endif()
|
||||
string(REGEX REPLACE "^.*void " " " LINE "${LINE}")
|
||||
string(REGEX REPLACE "Squirrel \\*" "" LINE "${LINE}")
|
||||
list(APPEND SQUIRREL_REGISTER "${LINE}")
|
||||
endforeach(LINE)
|
||||
endif (LINES)
|
||||
endforeach(FILE)
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
list(SORT SQUIRREL_INCLUDES)
|
||||
string(REPLACE ";" "\n" SQUIRREL_INCLUDES "${SQUIRREL_INCLUDES}")
|
||||
|
Reference in New Issue
Block a user