file(GLOB items *) foreach(item ${items}) if (NOT IS_DIRECTORY ${item}) continue() endif () add_subdirectory(${item}) endforeach (item)