
include(DownloadProject)

macro(getRE2C)
    if (CMAKE_VERSION VERSION_LESS 3.2)
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
    else()
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
    endif()

    download_project(
            PROJ                re2c
            GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
            GIT_TAG             1.2
            GIT_PROGRESS        1
    )

    set(RE2C_BIN "${re2c_BINARY_DIR}/re2c")

    if(NOT EXISTS "${re2c_SOURCE_DIR}/configure")
        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${re2c_SOURCE_DIR})
    endif()

    execute_process(COMMAND ${re2c_SOURCE_DIR}/configure WORKING_DIRECTORY ${re2c_BINARY_DIR})
    execute_process(COMMAND make WORKING_DIRECTORY ${re2c_BINARY_DIR})
endmacro()


include(DownloadProject)

macro(getRE2C)
    if (CMAKE_VERSION VERSION_LESS 3.2)
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
    else()
        set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
    endif()

    download_project(
            PROJ                re2c
            GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
            GIT_TAG             1.1.1
            GIT_PROGRESS        1
    )

    set(RE2C_BIN "${re2c_BINARY_DIR}/re2c")

    if(NOT EXISTS "${re2c_SOURCE_DIR}/re2c/configure")
        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${re2c_SOURCE_DIR}/re2c)
    endif()

    execute_process(COMMAND ${re2c_SOURCE_DIR}/re2c/configure WORKING_DIRECTORY ${re2c_BINARY_DIR})
    execute_process(COMMAND make WORKING_DIRECTORY ${re2c_BINARY_DIR})
endmacro()

Revert "update re2c to 1.2" due to build error in some environment like Mac or openSUSE tumbleweed
Revert "update re2c to 1.2" due to build error in some environment like
Mac or openSUSE tumbleweed

This reverts commit f8e43c07682f2e8a13294d89aa1d28186dbd8620.
