diff --git a/tools/cmakev2/idf.cmake b/tools/cmakev2/idf.cmake index 520c6476def..fa67a6931bd 100644 --- a/tools/cmakev2/idf.cmake +++ b/tools/cmakev2/idf.cmake @@ -49,6 +49,24 @@ function(__init_idf_path) set(ENV{IDF_PATH} ${idf_path}) endfunction() +#[[ + __init_git() + + Determine the executable. + + Set the GIT build property. +#]] +function(__init_git) + find_package(Git) + if(NOT GIT_FOUND) + idf_build_set_property(GIT NOTFOUND) + idf_warn("Git executable not found.") + return() + endif() + + idf_build_set_property(GIT "${GIT_EXECUTABLE}") +endfunction() + #[[ __init_python() @@ -332,6 +350,9 @@ idf_build_set_property(BUILD_DIR "${CMAKE_BINARY_DIR}") # well as a build property. __init_idf_path() +# Determine git executable and set GIT build property. +__init_git() + # Determine the Python interpreter and check package dependencies if necessary. __init_python()