diff --git a/tools/cmakev2/idf.cmake b/tools/cmakev2/idf.cmake index 2c1b10588b7..1d13cabd79a 100644 --- a/tools/cmakev2/idf.cmake +++ b/tools/cmakev2/idf.cmake @@ -9,6 +9,10 @@ cmake_minimum_required(VERSION 3.22) # included. set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}" ${CMAKE_MODULE_PATH}) +# The version.cmake file, which contains the IDF_VERSION variables, is the only +# file included from the cmakev1 build system. +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake) + include(component) include(build) @@ -152,7 +156,6 @@ __init_components() Many of the following things are already implemented in PoC !38337, but they need to be reviewed. -* Set IDF version. * Set and check python interpreter. * Set build target. * Set the toolchain before invoking project(). diff --git a/tools/cmakev2/test/CMakeLists.txt b/tools/cmakev2/test/CMakeLists.txt index fc3cf158156..77835c5ffc1 100644 --- a/tools/cmakev2/test/CMakeLists.txt +++ b/tools/cmakev2/test/CMakeLists.txt @@ -65,6 +65,19 @@ function(test_component_priority) __dump_component_properties("${component_name}") endfunction() +# Test that IDF_VERSION is set +function(test_idf_version) + if(NOT DEFINED IDF_VERSION_MAJOR OR + NOT DEFINED IDF_VERSION_MINOR OR + NOT DEFINED IDF_VERSION_PATCH OR + NOT DEFINED ENV{IDF_VERSION}) + idf_die("IDF_VERSION not set") + endif() +endfunction() + # Run tests test_dump_properties() test_component_priority() +test_idf_version() + +message("ALL TESTS PASSED")