Files @ r28827:f131debacb19
Branch filter:

Location: cpp/openttd-patchpack/source/regression/CMakeLists.txt

Peter Nelson
Codechange: Use `GetVisibleRangeIterators()` in more places. (#12190)

This replaces more first/last index calculation, along with indexed array/vector access, with iterator access instead.
    # Copy the regression configuration in a special folder, so all autogenerated
    # folders end up in the same place after running regression.
    add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/regression.cfg
            COMMAND ${CMAKE_COMMAND} -E copy
                    ${CMAKE_CURRENT_SOURCE_DIR}/regression.cfg
                    ${CMAKE_CURRENT_BINARY_DIR}/regression.cfg
            MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/regression.cfg
            COMMENT "Copying regression.cfg regression file"
    )

    # Create a new target which copies all regression files
    # Subdirectory targets will add themselves as dependencies
    add_custom_target(regression_files
            ALL  # this is needed because 'make test' doesn't resolve dependencies, and otherwise this is never executed
            DEPENDS
            ${CMAKE_BINARY_DIR}/regression/regression.cfg
    )

    # Create a new target which runs the regression
    # Subdirectory targets will add themselves as dependencies
    add_custom_target(regression)

    add_subdirectory(regression)
    add_subdirectory(stationlist)