find_package(Geekbit 0.0.1 REQUIRED)
set(cdroot ${CMAKE_BINARY_DIR})

if(NOT DEFINED ENV{IDF_PATH})
    message(FATAL_ERROR "Please define environment variable IDF_PATH")
endif()

include($ENV{IDF_PATH}/tools/cmake/idf.cmake)
idf_build_process(esp32
    BUILD_DIR ${CMAKE_BINARY_DIR})

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        idf::freertos
        idf::spi_flash
        idf::newlib
)

idf_build_executable(${PROJECT_NAME})

include("${CMAKE_CURRENT_LIST_DIR}/fetch-libfixmath.cmake")
add_subdirectory(libfixmath)
