# HG changeset patch # User Loïc Guilloux # Date 2023-12-04 16:41:02 # Node ID 06e097282a4422ae02721d8342ab50d176448409 # Parent 6efdae80c7578536d388b5259d9a302a2e2b49dd Change: [CMake] Use explicit list for grf source files (#11539) diff --git a/cmake/CreateGrfCommand.cmake b/cmake/CreateGrfCommand.cmake --- a/cmake/CreateGrfCommand.cmake +++ b/cmake/CreateGrfCommand.cmake @@ -1,16 +1,13 @@ # Macro which contains all bits and pieces to create a single grf file based # on NFO and PNG files. # -# create_grf_command() +# create_grf_command(NFO_SOURCE_FILES nfo_file1 ... PNG_SOURCE_FILES png_file1 ...) # function(create_grf_command) - set(EXTRA_PNG_SOURCE_FILES ${ARGV}) + cmake_parse_arguments(GRF "" "" "NFO_SOURCE_FILES;PNG_SOURCE_FILES" ${ARGN}) get_filename_component(GRF_SOURCE_FOLDER_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME) get_filename_component(GRF_BINARY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${GRF_SOURCE_FOLDER_NAME}.grf ABSOLUTE) - file(GLOB_RECURSE GRF_PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.png) - file(GLOB_RECURSE GRF_NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nfo) - set(GRF_PNG_SOURCE_FILES ${GRF_PNG_SOURCE_FILES} ${EXTRA_PNG_SOURCE_FILES}) # Copy over all the PNG files to the correct folder foreach(GRF_PNG_SOURCE_FILE IN LISTS GRF_PNG_SOURCE_FILES) diff --git a/media/baseset/openttd/CMakeLists.txt b/media/baseset/openttd/CMakeLists.txt --- a/media/baseset/openttd/CMakeLists.txt +++ b/media/baseset/openttd/CMakeLists.txt @@ -5,5 +5,47 @@ # working on it / have the tools installed. if(GRFCODEC_FOUND) include(CreateGrfCommand) - create_grf_command() + create_grf_command( + NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/aqueduct.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/autorail.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/canals.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/chars.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/elrails.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/foundations.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/mono.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/oneway.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/openttd.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/palette.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/roadstops.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/signals.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/tunnel_portals.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/2ccmap.nfo + PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.png + ${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.png + ${CMAKE_CURRENT_SOURCE_DIR}/aqueduct.png + ${CMAKE_CURRENT_SOURCE_DIR}/autorail.png + ${CMAKE_CURRENT_SOURCE_DIR}/canals.png + ${CMAKE_CURRENT_SOURCE_DIR}/canal_locks.png + ${CMAKE_CURRENT_SOURCE_DIR}/chars.png + ${CMAKE_CURRENT_SOURCE_DIR}/elrails.png + ${CMAKE_CURRENT_SOURCE_DIR}/foundations.png + ${CMAKE_CURRENT_SOURCE_DIR}/mono.png + ${CMAKE_CURRENT_SOURCE_DIR}/oneway.png + ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui.png + ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_build_tram.png + ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_road.png + ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_convert_tram.png + ${CMAKE_CURRENT_SOURCE_DIR}/openttdgui_group_livery.png + ${CMAKE_CURRENT_SOURCE_DIR}/roadstops.png + ${CMAKE_CURRENT_SOURCE_DIR}/signals.png + ${CMAKE_CURRENT_SOURCE_DIR}/sloped_tracks.png + ${CMAKE_CURRENT_SOURCE_DIR}/tramtracks.png + ${CMAKE_CURRENT_SOURCE_DIR}/tramtracks_bare_depot.png + ${CMAKE_CURRENT_SOURCE_DIR}/tunnel_portals.png + ) endif() diff --git a/media/baseset/orig_extra/CMakeLists.txt b/media/baseset/orig_extra/CMakeLists.txt --- a/media/baseset/orig_extra/CMakeLists.txt +++ b/media/baseset/orig_extra/CMakeLists.txt @@ -6,9 +6,32 @@ if(GRFCODEC_FOUND) include(CreateGrfCommand) create_grf_command( - # We share some files with 'openttd' grf - ${CMAKE_CURRENT_SOURCE_DIR}/../openttd/airports.png - ${CMAKE_CURRENT_SOURCE_DIR}/../openttd/canals.png - ${CMAKE_CURRENT_SOURCE_DIR}/../openttd/chars.png + NFO_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/temperate.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/airports_orig_extra.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/canals_extra.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/chars_orig_extra.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/fix_graphics.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/fix_gui_icons.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/orig_extra.nfo + ${CMAKE_CURRENT_SOURCE_DIR}/shore.nfo + PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic_brown.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/arctic_snowy.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/rapids_shading.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/temperate.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/toyland.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic_desert.png + ${CMAKE_CURRENT_SOURCE_DIR}/rivers/tropic_forest.png + ${CMAKE_CURRENT_SOURCE_DIR}/fix_graphics.png + ${CMAKE_CURRENT_SOURCE_DIR}/fix_gui_icons.png + ${CMAKE_CURRENT_SOURCE_DIR}/shore.png + # We share some files with 'openttd' grf + ${CMAKE_CURRENT_SOURCE_DIR}/../openttd/airports.png + ${CMAKE_CURRENT_SOURCE_DIR}/../openttd/canals.png + ${CMAKE_CURRENT_SOURCE_DIR}/../openttd/chars.png ) endif()