set(IOJS_URL_BASE "https://iojs.org/dist")
set(IOJS_VARIANT_BASE "iojs")
set(IOJS_WIN32_BINARY_NAME  "${IOJS_VARIANT_BASE}.exe")
list(APPEND NodeJS_WIN32_DELAYLOAD ${IOJS_WIN32_BINARY_NAME})

if(NodeJS_FIND_REQUIRED_IOJS OR NodeJS_VARIANT STREQUAL ${IOJS_VARIANT_BASE})
    if(NodeJS_VERSION STREQUAL "latest")
        set(IOJS_LATEST_RELEASE_URL 
            "${IOJS_URL_BASE}/latest/SHASUMS256.txt")
        nodejs_get_version(${IOJS_LATEST_RELEASE_URL} NodeJS_VERSION)
    endif()

    set(NodeJS_VARIANT_NAME "io.js")
    set(NodeJS_VARIANT_BASE ${IOJS_VARIANT_BASE})
    set(NodeJS_URL "${IOJS_URL_BASE}/v${NodeJS_VERSION}")
    set(NodeJS_HEADER_VERSION 2.3.1)
    set(NodeJS_WIN32_BINARY_NAME "${IOJS_WIN32_BINARY_NAME}")
endif()

mark_as_advanced(
    IOJS_URL_BASE
    IOJS_VARIANT_BASE
    IOJS_WIN32_BINARY_NAME
    IOJS_LATEST_RELEASE_URL
)