modules.cmake 761 B

123456789101112131415161718192021
  1. # SPDX-License-Identifier: Apache-2.0
  2. file(GLOB cmake_modules "${CMAKE_CURRENT_LIST_DIR}/*/CMakeLists.txt")
  3. foreach(module ${cmake_modules})
  4. get_filename_component(module_dir ${module} DIRECTORY)
  5. get_filename_component(module_name ${module_dir} NAME)
  6. zephyr_string(SANITIZE TOUPPER MODULE_NAME_UPPER ${module_name})
  7. set(ZEPHYR_${MODULE_NAME_UPPER}_CMAKE_DIR ${module_dir})
  8. endforeach()
  9. file(GLOB kconfig_modules "${CMAKE_CURRENT_LIST_DIR}/*/Kconfig")
  10. foreach(module ${kconfig_modules})
  11. get_filename_component(module_dir ${module} DIRECTORY)
  12. get_filename_component(module_name ${module_dir} NAME)
  13. zephyr_string(SANITIZE TOUPPER MODULE_NAME_UPPER ${module_name})
  14. set(ZEPHYR_${MODULE_NAME_UPPER}_KCONFIG ${module_dir}/Kconfig)
  15. endforeach()