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()