function(find_source_group LINES NAME) set(foundSourceGroupLink 0) foreach(line IN LISTS LINES) if(line MATCHES "${NAME}") set(foundSourceGroupLink 1) endif() endforeach() if(NOT foundSourceGroupLink) set(RunCMake_TEST_FAILED "Source group link for ${NAME} not found." PARENT_SCOPE) set(SOURCE_GROUP_FOUND 0 PARENT_SCOPE) return() endif() set(SOURCE_GROUP_FOUND 1 PARENT_SCOPE) endfunction()