Update CMakeLists.txt (#1364)

It is a good practice to check if the file CMakeLists.txt is in fact in the directory.
This commit is contained in:
Ruturaj Vaidya
2024-06-27 14:34:25 -05:00
committed by GitHub
parent fafa567b3c
commit 2525864fda

View File

@@ -181,7 +181,7 @@ endfunction(add_example_executable_no_testing EXAMPLE_NAME)
# add all example subdir
file(GLOB dir_list LIST_DIRECTORIES true *)
FOREACH(subdir ${dir_list})
IF(IS_DIRECTORY "${subdir}")
if(IS_DIRECTORY "${subdir}" AND EXISTS "${subdir}/CMakeLists.txt")
add_subdirectory(${subdir})
ENDIF()
ENDFOREACH()