diff options
author | Patric Stout <truebrain@openttd.org> | 2021-05-29 10:58:07 +0200 |
---|---|---|
committer | Patric Stout <github@truebrain.nl> | 2021-05-29 11:27:00 +0200 |
commit | e58046c9477d52470ebb50e2dbd1ccc1af9dae25 (patch) | |
tree | 25a9200143b08e0e083679785f85868ac1318f0f /src/table/settings/CMakeLists.txt | |
parent | ca9a7df7522a614b839a83e1ba9b6a7b08642b8a (diff) | |
download | openttd-e58046c9477d52470ebb50e2dbd1ccc1af9dae25.tar.xz |
Codechange: move all settings.ini files to table/settings
Diffstat (limited to 'src/table/settings/CMakeLists.txt')
-rw-r--r-- | src/table/settings/CMakeLists.txt | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/table/settings/CMakeLists.txt b/src/table/settings/CMakeLists.txt new file mode 100644 index 000000000..b1503145f --- /dev/null +++ b/src/table/settings/CMakeLists.txt @@ -0,0 +1,47 @@ +set(GENERATED_BINARY_DIR ${CMAKE_BINARY_DIR}/generated) +set(TABLE_BINARY_DIR ${GENERATED_BINARY_DIR}/table) + +set(TABLE_INI_SOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/company_settings.ini + ${CMAKE_CURRENT_SOURCE_DIR}/currency_settings.ini + ${CMAKE_CURRENT_SOURCE_DIR}/gameopt_settings.ini + ${CMAKE_CURRENT_SOURCE_DIR}/misc_settings.ini + ${CMAKE_CURRENT_SOURCE_DIR}/settings.ini + ${CMAKE_CURRENT_SOURCE_DIR}/win32_settings.ini + ${CMAKE_CURRENT_SOURCE_DIR}/window_settings.ini +) + +if (HOST_BINARY_DIR) + include(${HOST_BINARY_DIR}/settingsgen.cmake) +endif() + +# Generate a command and target to create the settings table +add_custom_command_timestamp(OUTPUT ${TABLE_BINARY_DIR}/settings.h + COMMAND ${CMAKE_COMMAND} -E make_directory ${TABLE_BINARY_DIR} + COMMAND settingsgen + -o ${TABLE_BINARY_DIR}/settings.h + -b ${CMAKE_SOURCE_DIR}/src/table/settings.h.preamble + -a ${CMAKE_SOURCE_DIR}/src/table/settings.h.postamble + ${TABLE_INI_SOURCE_FILES} + DEPENDS settingsgen ${TABLE_INI_SOURCE_FILES} + ${CMAKE_SOURCE_DIR}/src/table/settings.h.preamble + ${CMAKE_SOURCE_DIR}/src/table/settings.h.postamble + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating table/settings.h" +) +add_custom_target_timestamp(table_settings + DEPENDS + ${TABLE_BINARY_DIR}/settings.h +) + +add_library(settings + INTERFACE +) +target_include_directories(settings + INTERFACE + ${GENERATED_BINARY_DIR} +) +add_dependencies(settings + table_settings +) +add_library(openttd::settings ALIAS settings) |