• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Require EXTRA_SUBDIR_TEST_INCLUDE_FILES be set in the parent scope.
2function(set_subdirectory_properties subdir)
3    get_filename_component(abs_subdir ${subdir} ABSOLUTE)
4    set(GFXSTREAM_THIRD_PARTY_ROOT ${GFXSTREAM_REPO_ROOT})
5    cmake_path(APPEND GFXSTREAM_THIRD_PARTY_ROOT "third-party")
6    cmake_path(IS_PREFIX GFXSTREAM_THIRD_PARTY_ROOT ${abs_subdir} NORMALIZE IS_THIRD_PARTY)
7    if(IS_THIRD_PARTY)
8        return()
9    endif()
10    cmake_path(IS_PREFIX GFXSTREAM_REPO_ROOT ${abs_subdir} NORMALIZE IS_GFXSTREAM_SUBDIR)
11    if(NOT IS_GFXSTREAM_SUBDIR)
12        return()
13    endif()
14    cmake_path(IS_PREFIX abs_subdir ${GFXSTREAM_REPO_ROOT} NORMALIZE IS_GFXSTREAM_ROOT)
15
16    get_directory_property(subdirs DIRECTORY "${abs_subdir}" SUBDIRECTORIES)
17    foreach(subdir IN LISTS subdirs)
18        set_subdirectory_properties("${subdir}")
19    endforeach()
20
21    set_property(DIRECTORY "${subdir}" APPEND PROPERTY TEST_INCLUDE_FILES ${EXTRA_SUBDIR_TEST_INCLUDE_FILES})
22endfunction()
23
24get_directory_property(subdirs SUBDIRECTORIES)
25foreach(subdir IN LISTS subdirs)
26    set_subdirectory_properties(${subdir})
27endforeach()
28