]> granicus.if.org Git - esp-idf/commitdiff
cmake: Expand components relative to PROJECT_PATH correctly
authorAngus Gratton <angus@espressif.com>
Fri, 10 Aug 2018 02:18:25 +0000 (12:18 +1000)
committerAngus Gratton <gus@projectgus.com>
Mon, 13 Aug 2018 05:37:03 +0000 (15:37 +1000)
tools/cmake/project.cmake
tools/cmake/scripts/expand_requirements.cmake

index 86174feb8627bc2501fe3d8ad2c788d0a6029e97..e346bcbf273550fd45b1f1cd32dacd079919b536 100644 (file)
@@ -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:
index 9b56cf0909ce50995ea9b6ec4d1fdfb0f416c063..d602801bbab1b87d4ba47acb293aa8eef48ae4ac 100644 (file)
@@ -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)