1# 2# Copyright © 2017 Arm Ltd. All rights reserved. 3# SPDX-License-Identifier: MIT 4# 5 6# single place to use wildcards, so we can include 7# yet unknown backend modules and corresponding common libraries 8file(GLOB commonIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/common.cmake) 9file(GLOB backendIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/backend.cmake) 10 11# prefer to include common code first 12foreach(includeFile ${commonIncludes}) 13 message(STATUS "Including backend common library into the build: ${includeFile}") 14 include(${includeFile}) 15endforeach() 16 17# now backends can depend on common code included first 18foreach(includeFile ${backendIncludes}) 19 message(STATUS "Including backend into the build: ${includeFile}") 20 include(${includeFile}) 21endforeach() 22 23# parse dynamic backend sub-directories 24file(GLOB dynamicBackendDirs ${PROJECT_SOURCE_DIR}/src/backends/dynamic/*) 25foreach(dynamicBackendDir ${dynamicBackendDirs}) 26 if (EXISTS ${dynamicBackendDir} AND IS_DIRECTORY ${dynamicBackendDir}) 27 add_subdirectory(${dynamicBackendDir}) 28 endif() 29endforeach() 30