cmake_minimum_required (VERSION 3.0)
if (NOT CMAKE_VERSION VERSION_LESS "3.1")
    cmake_policy (SET CMP0054 OLD)
endif ()
if (WIN32 AND DEFINED EPOXY_SHARED_LIB)
    get_filename_component (EPOXY_SHARED_LIB_DIR "${EPOXY_SHARED_LIB}" DIRECTORY)
    file (TO_NATIVE_PATH "${EPOXY_SHARED_LIB_DIR}" EPOXY_SHARED_LIB_DIR)
    if (NOT DEFINED ENV{PATH} OR ENV{PATH} STREQUAL "")
        set (ENV{PATH} "${EPOXY_SHARED_LIB_DIR}")
    else ()
        set (ENV{PATH} "${EPOXY_SHARED_LIB_DIR};$ENV{PATH}")
    endif ()
endif ()
execute_process (COMMAND "${EPOXY_TEST_CMD}" RESULT_VARIABLE TEST_RETURN_VAL)
if (NOT TEST_RETURN_VAL EQUAL 0 AND NOT TEST_RETURN_VAL EQUAL 77)
    message (FATAL_ERROR "Test has failed!")
endif ()
