From 30ec7fa9010f63d50f1e45df51ae2512625ec8ee Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Mon, 7 Sep 2020 12:35:11 +0100 Subject: [PATCH] CMake: mbed_add_cmake_directory_if_labels checks presence of CMakeLists.txt before adding subdirectory --- cmake/util.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/util.cmake b/cmake/util.cmake index ff954b7a4e..1414421aa0 100644 --- a/cmake/util.cmake +++ b/cmake/util.cmake @@ -11,7 +11,9 @@ function(mbed_add_cmake_directory_if_labels PREFIX) # assumption: relative path, no need to check for absolute here set(path ${CMAKE_CURRENT_SOURCE_DIR}/${key}) if (EXISTS ${path}) - add_subdirectory(${path}) + if (EXISTS "${path}/CMakeLists.txt") + add_subdirectory(${path}) + endif() endif() endforeach() endfunction()