1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

Codechange: [CMake] Auto-fill list of #include in script_window.hpp (#10103)

This commit is contained in:
Loïc Guilloux
2022-10-24 12:35:58 +02:00
committed by GitHub
parent 4052feef1f
commit 0afa6f2424
2 changed files with 6 additions and 58 deletions

View File

@@ -13,6 +13,7 @@ cmake_minimum_required(VERSION 3.5)
# The parameter "enumname" specifies the enumeration to extract. This can also be a regular expression.
# The parameter "filename" specifies the relative path to the file, where the enumeration is extracted from. This can also be a glob expression.
#
# All files where enumerations are extracted from are automatically added via #include
#
if(NOT GENERATE_SOURCE_FILE)
@@ -41,6 +42,7 @@ foreach(ENUM IN LISTS ENUM_LINES)
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" FILE ${FILE})
string(APPEND ${PLACE_HOLDER} "\n${ADD_INDENT}/* automatically generated from ${FILE} */")
list(APPEND INCLUDES "#include \"${FILE}\"")
foreach(LINE IN LISTS SOURCE_LINES)
string(REPLACE "${RM_INDENT}" "" LINE "${LINE}")
@@ -116,4 +118,7 @@ foreach(ENUM IN LISTS ENUM_LINES)
endforeach()
endforeach()
list(REMOVE_DUPLICATES INCLUDES)
string(REPLACE ";" "\n" INCLUDES "${INCLUDES}")
configure_file(${GENERATE_SOURCE_FILE} ${GENERATE_BINARY_FILE})