From: Angus Gratton Date: Fri, 10 Aug 2018 02:18:25 +0000 (+1000) Subject: cmake: Expand components relative to PROJECT_PATH correctly X-Git-Tag: v3.1-rc2~9^2~13^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70288f864e4e6ebc8dc65eac91279b10a09fcd91;p=esp-idf cmake: Expand components relative to PROJECT_PATH correctly --- diff --git a/tools/cmake/project.cmake b/tools/cmake/project.cmake index 86174feb86..e346bcbf27 100644 --- a/tools/cmake/project.cmake +++ b/tools/cmake/project.cmake @@ -59,8 +59,10 @@ macro(project name) -D "DEPENDENCIES_FILE=${CMAKE_BINARY_DIR}/component_depends.cmake" -D "COMPONENT_DIRS=${COMPONENT_DIRS}" -D "BOOTLOADER_BUILD=${BOOTLOADER_BUILD}" + -D "IDF_PATH=${IDF_PATH}" + -D "DEBUG=${DEBUG}" -P "${IDF_PATH}/tools/cmake/scripts/expand_requirements.cmake" - WORKING_DIRECTORY "${IDF_PATH}/tools/cmake") + WORKING_DIRECTORY "${PROJECT_PATH}") include("${CMAKE_BINARY_DIR}/component_depends.cmake") # We now have the following component-related variables: diff --git a/tools/cmake/scripts/expand_requirements.cmake b/tools/cmake/scripts/expand_requirements.cmake index 9b56cf0909..d602801bba 100644 --- a/tools/cmake/scripts/expand_requirements.cmake +++ b/tools/cmake/scripts/expand_requirements.cmake @@ -15,7 +15,7 @@ # # TODO: Error out if a component requirement is missing cmake_minimum_required(VERSION 3.5) -include("utilities.cmake") +include("${IDF_PATH}/tools/cmake/utilities.cmake") if(NOT DEPENDENCIES_FILE) message(FATAL_ERROR "DEPENDENCIES_FILE must be set.") @@ -91,8 +91,10 @@ function(components_find_all component_dirs component_paths component_names) # Look for a component in each component_dirs entry foreach(dir ${component_dirs}) + debug("Looking for CMakeLists.txt in ${dir}") file(GLOB component "${dir}/CMakeLists.txt") if(component) + debug("CMakeLists.txt file ${component}") get_filename_component(component "${component}" DIRECTORY) get_filename_component(name "${component}" NAME) if(NOT name IN_LIST names)