1 function(file_scaner var)
2 cmake_parse_arguments(FILE "RECURSE" "RELATIVE" "OPTIONS;DIR;EXT" ${ARGN})
5 list(APPEND FILE_OPTIONS RELATIVE ${FILE_RELATIVE})
8 string(REPLACE ";." ";" FILE_EXT ";${FILE_EXT};")
9 foreach(dir ${FILE_DIR} ${FILE_UNPARSED_ARGUMENTS})
10 foreach(ext ${FILE_EXT})
11 list(APPEND FILE_OPTIONS "${dir}/*.${ext}")
16 file(GLOB_RECURSE FILES ${FILE_OPTIONS})
18 file(GLOB FILES ${FILE_OPTIONS})
21 set(${var} ${FILES} PARENT_SCOPE)
24 function(file_filter var)
25 cmake_parse_arguments(FILE "" "VAR" "EXT" ${ARGN})
28 string(REPLACE ";." ";" FILE_EXT ";${FILE_EXT};")
29 foreach(arg ${${FILE_VAR}} ${FILE_UNPARSED_ARGUMENTS})
30 get_filename_component(ext ${arg} EXT)
31 string(REGEX REPLACE "^\\." "" ext "${ext}")
32 list(FIND FILE_EXT "${ext}" index)
33 if(${index} GREATER -1)
34 list(APPEND FILES ${arg})
38 set(${var} ${FILES} PARENT_SCOPE)