Files @ r25388:32b23efdcf4e
Branch filter:

Location: cpp/openttd-patchpack/source/cmake/FindEditbin.cmake

Patric Stout
Codechange: use connection_string in favour of NetworkAddress (#9197)

We now resolve the connection_string to a NetworkAddress in a much
later state. This means there are fewer places constructing a NetworkAddress.

The main benefit of this is in later PRs that introduce different types
of NetworkAddresses. Storing this in things like NetworkGameList is
rather complex, especially as NetworkAddress has to be mutable at all
times.

Additionally, the NetworkAddress is a complex object to store simple
information: how to connect to this server.
# Autodetect editbin. Only useful for MSVC.

if(NOT EDITBIN_DIRECTORY)
    if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
        get_filename_component(MSVC_COMPILE_DIRECTORY ${CMAKE_CXX_COMPILER} DIRECTORY)
        set(EDITBIN_DIRECTORY ${MSVC_COMPILE_DIRECTORY})
    else()
        # For clang-cl build
        # find editbin.exe from environmental variable VCToolsInstallDir
        set(EDITBIN_DIRECTORY "$ENV{VCToolsInstallDir}/bin/Hostx64/x64")
    endif()
endif()

message(CHECK_START "Finding editbin.exe")
find_program(
    EDITBIN_EXECUTABLE editbin.exe
    HINTS ${EDITBIN_DIRECTORY}
)

if(EDITBIN_EXECUTABLE)
    message(CHECK_PASS "found")
else()
    message(CHECK_FAIL "not found , please manually specify EDITBIN_DIRECTORY")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Editbin
    FOUND_VAR EDITBIN_FOUND
    REQUIRED_VARS EDITBIN_EXECUTABLE
)