CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. cmake_minimum_required(VERSION 3.5)
  2. set(COMPONENT_ADD_INCLUDEDIRS main components/tools)
  3. if((DEFINED "$ENV{PROJECT_BUILD_NAME}") AND (DEFINED "$ENV{PROJECT_CONFIG_TARGET}"))
  4. set(PROJECT_VER "$ENV{PROJECT_BUILD_NAME}-$ENV{PROJECT_CONFIG_TARGET}" )
  5. endif()
  6. if(DEFINED "$ENV{PROJECT_NAME}")
  7. set(PROJECT_NAME "$ENV{PROJECT_NAME}")
  8. message("Project name is $PROJECT_NAME")
  9. else()
  10. message("Project name is not set! Defaulting")
  11. set(PROJECT_NAME "squeezelite-esp32")
  12. endif()
  13. include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  14. if(NOT ${PROJECT_NAME} STREQUAL "squeezelite-esp32" )
  15. add_definitions( -DRECOVERY_APPLICATION=1 )
  16. message(WARNING "Building Recovery")
  17. project(recovery)
  18. else()
  19. message(WARNING "Building Squeezelite")
  20. add_definitions( -DRECOVERY_APPLICATION=0 )
  21. project(squeezelite)
  22. endif()
  23. # Include ESP-IDF components in the build, may be thought as an equivalent of
  24. # add_subdirectory() but with some additional procesing and magic for ESP-IDF build
  25. # specific build processes.
  26. #idf_build_process(esp32)
  27. # Create the project executable and plainly link the newlib component to it using
  28. # its alias, idf::newlib.
  29. #add_executable(${CMAKE_PROJECT_NAME}.elf main.c)
  30. #target_link_libraries(${CMAKE_PROJECT_NAME}.elf idf::newlib)
  31. # Let the build system know what the project executable is to attach more targets, dependencies, etc.
  32. #idf_build_executable(${CMAKE_PROJECT_NAME}.elf)