FILE(GLOB MODULES_PATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*")
FOREACH(_module_path ${MODULES_PATHS})
  IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_module_path})
    ADD_SUBDIRECTORY(${_module_path})
  ENDIF()
ENDFOREACH()
FILE(GLOB MODULES_PATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*")
FOREACH(_module_path ${MODULES_PATHS})
  IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_module_path})
    FIND_FILE(CMAKELISTS_FOUND "CMakeLists.txt" PATHS "${CMAKE_CURRENT_SOURCE_DIR}/${_module_path}" NO_DEFAULT_PATH)
    IF (CMAKELISTS_FOUND)
      ADD_SUBDIRECTORY(${_module_path})
    ENDIF()
  ENDIF()
  UNSET(CMAKELISTS_FOUND CACHE)
ENDFOREACH()
Improve the CMake script used to automatically include new module.
Improve the CMake script used to automatically include new module.
