|
1 | 1 | cmake_minimum_required(VERSION 3.16) |
| 2 | + |
| 3 | +set(_project_root ${CMAKE_CURRENT_LIST_DIR}/../..) |
| 4 | +set(_dependency_root ${_project_root}/dependencies) |
| 5 | +set(_third_party_deps |
| 6 | + mooncake |
| 7 | + mooncake_log |
| 8 | + smooth_ui_toolkit |
| 9 | + lvgl |
| 10 | +) |
| 11 | + |
| 12 | +set(_missing_deps) |
| 13 | +foreach(_dep ${_third_party_deps}) |
| 14 | + if(NOT EXISTS ${_dependency_root}/${_dep}) |
| 15 | + list(APPEND _missing_deps ${_dep}) |
| 16 | + endif() |
| 17 | +endforeach() |
| 18 | + |
| 19 | +if(_missing_deps) |
| 20 | + message(STATUS "Fetching managed dependencies: ${_missing_deps}") |
| 21 | + find_package(Python3 REQUIRED COMPONENTS Interpreter) |
| 22 | + execute_process( |
| 23 | + COMMAND ${Python3_EXECUTABLE} ${_project_root}/fetch_repos.py |
| 24 | + WORKING_DIRECTORY ${_project_root} |
| 25 | + RESULT_VARIABLE _fetch_result |
| 26 | + ) |
| 27 | + if(NOT _fetch_result EQUAL 0) |
| 28 | + message(FATAL_ERROR "fetch_repos.py failed with exit code ${_fetch_result}") |
| 29 | + endif() |
| 30 | + |
| 31 | + set(_still_missing) |
| 32 | + foreach(_dep ${_third_party_deps}) |
| 33 | + if(NOT EXISTS ${_dependency_root}/${_dep}) |
| 34 | + list(APPEND _still_missing ${_dep}) |
| 35 | + endif() |
| 36 | + endforeach() |
| 37 | + |
| 38 | + if(_still_missing) |
| 39 | + message(FATAL_ERROR "Missing dependencies after fetch: ${_still_missing}") |
| 40 | + endif() |
| 41 | +endif() |
| 42 | + |
2 | 43 | set(EXTRA_COMPONENT_DIRS |
3 | 44 | ${CMAKE_CURRENT_LIST_DIR}/../../components |
4 | | - ${CMAKE_CURRENT_LIST_DIR}/../../dependencies/mooncake |
5 | | - ${CMAKE_CURRENT_LIST_DIR}/../../dependencies/mooncake_log |
6 | | - ${CMAKE_CURRENT_LIST_DIR}/../../dependencies/smooth_ui_toolkit |
7 | | - ${CMAKE_CURRENT_LIST_DIR}/../../dependencies/lvgl |
| 45 | + ${_dependency_root}/mooncake |
| 46 | + ${_dependency_root}/mooncake_log |
| 47 | + ${_dependency_root}/smooth_ui_toolkit |
| 48 | + ${_dependency_root}/lvgl |
8 | 49 | ) |
9 | 50 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) |
10 | 51 | project(m5tab5_userdemo) |
0 commit comments