Skip to content

Commit afddca4

Browse files
committed
CMake: mbed_add_cmake_directory_if_labels checks presence of CMakeLists.txt before adding subdirectory
1 parent 8e236e1 commit afddca4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/util.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ function(mbed_add_cmake_directory_if_labels PREFIX)
1111
# assumption: relative path, no need to check for absolute here
1212
set(path ${CMAKE_CURRENT_SOURCE_DIR}/${key})
1313
if (EXISTS ${path})
14-
add_subdirectory(${path})
14+
if (EXISTS "${path}/CMakeLists.txt")
15+
add_subdirectory(${path})
16+
endif()
1517
endif()
1618
endforeach()
1719
endfunction()

0 commit comments

Comments
 (0)