]> granicus.if.org Git - esp-idf/commitdiff
cmake: exclude dot-dirs from added components
authorRenz Christian Bagaporo <renz@espressif.com>
Mon, 20 May 2019 06:36:55 +0000 (14:36 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Mon, 20 May 2019 10:24:34 +0000 (18:24 +0800)
tools/cmake/build.cmake
tools/cmake/project.cmake

index bd2184977b32862b649244ab856db051bdb41b4d..ad46d3d8dae38317b0d20d9dbb283560be4b2c4a 100644 (file)
@@ -147,7 +147,11 @@ function(__build_init idf_path)
     file(GLOB component_dirs ${idf_path}/components/*)
     foreach(component_dir ${component_dirs})
         get_filename_component(component_dir ${component_dir} ABSOLUTE)
-        __component_add(${component_dir} ${prefix})
+        get_filename_component(base_dir ${component_dir} NAME)
+        string(SUBSTRING "${base_dir}" 0 1 first_char)
+        if(NOT first_char STREQUAL ".")
+            __component_add(${component_dir} ${prefix})
+        endif()
     endforeach()
 
     # Set components required by all other components in the build
index 4522d0a2cff316054da209beeb7e3766c9e10535..0cb2d6db92f5396334d57b29046285243f489282 100644 (file)
@@ -148,7 +148,11 @@ function(__project_init components_var test_components_var)
             file(GLOB component_dirs ${component_dir}/*)
             foreach(component_dir ${component_dirs})
                 if(EXISTS ${component_dir}/CMakeLists.txt)
-                    idf_build_component(${component_dir})
+                    get_filename_component(base_dir ${component_dir} NAME)
+                    string(SUBSTRING "${base_dir}" 0 1 first_char)
+                    if(NOT first_char STREQUAL ".")
+                        idf_build_component(${component_dir})
+                    endif()
                 endif()
             endforeach()
         endif()