CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930
  1. # AirPlay 2 Receiver for ESP32
  2. cmake_minimum_required(VERSION 3.16)
  3. # Read firmware version from version.txt
  4. file(READ "${CMAKE_SOURCE_DIR}/version.txt" PROJECT_VER)
  5. string(STRIP "${PROJECT_VER}" PROJECT_VER)
  6. # Add components directory
  7. set(EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/components")
  8. include($ENV{IDF_PATH}/tools/cmake/version.cmake)
  9. if(IDF_VERSION_MAJOR LESS 5 OR (IDF_VERSION_MAJOR EQUAL 5 AND IDF_VERSION_MINOR LESS 5))
  10. message(WARNING
  11. "ESP-IDF ${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} detected. "
  12. "This project is developed and tested against ESP-IDF >= 5.5. "
  13. "Older versions may require workarounds (e.g. for hosted-WiFi Kconfig symbols on ESP32-P4). "
  14. "Please upgrade with: cd $ENV{IDF_PATH} && git fetch && git checkout v5.5.2 && ./install.sh")
  15. endif()
  16. include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  17. project(airplay2-receiver VERSION ${PROJECT_VER})
  18. include(cmake/fix_usb_device_uac_platformio.cmake)
  19. # Build a SPIFFS image from data/ and flash it alongside the firmware.
  20. # Partition label "storage" matches partitions.csv. Used by:
  21. # - components/dac_tas57xx/ (HybridFlow DAC firmware)
  22. # - components/display/ (ST7789 background image)
  23. # Flash firmware + SPIFFS together with: idf.py build flash
  24. spiffs_create_partition_image(storage "${CMAKE_SOURCE_DIR}/data" FLASH_IN_PROJECT)