macro(run_conan)
    if (EMSCRIPTEN)
        include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
        conan_basic_setup(TARGETS)
    else ()
        if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
            message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
            file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
                    "${CMAKE_BINARY_DIR}/conan.cmake")
        endif ()

        include(${CMAKE_BINARY_DIR}/conan.cmake)

        conan_add_remote(NAME bincrafters URL
                https://api.bintray.com/conan/bincrafters/public-conan)

        conan_cmake_run(
                CONANFILE conanfile.txt
                BASIC_SETUP CMAKE_TARGETS
                BUILD missing)
    endif ()
endmacro()