CMake: mbed_add_cmake_directory_if_labels checks presence of CMakeLists.txt before adding subdirectory

pull/13566/head
Hugues Kamba 2020-09-07 12:35:11 +01:00
parent 9d1ae521e8
commit 30ec7fa901
1 changed files with 3 additions and 1 deletions

View File

@ -11,7 +11,9 @@ function(mbed_add_cmake_directory_if_labels PREFIX)
# assumption: relative path, no need to check for absolute here # assumption: relative path, no need to check for absolute here
set(path ${CMAKE_CURRENT_SOURCE_DIR}/${key}) set(path ${CMAKE_CURRENT_SOURCE_DIR}/${key})
if (EXISTS ${path}) if (EXISTS ${path})
if (EXISTS "${path}/CMakeLists.txt")
add_subdirectory(${path}) add_subdirectory(${path})
endif() endif()
endif()
endforeach() endforeach()
endfunction() endfunction()