11#=============================================================================#
22# Finds source files matching the given pattern under the given path.
33# Search could also be recursive (With sub-directories) if the optional 'RECURSE' option is passed.
4- # _base_path - Top-Directory path to search source files in.
5- # _return_var - Name of variable in parent-scope holding the return value.
6- # Returns - List of sources in the given path
4+ # _base_path - Top-Directory path to search source files in.
5+ # [RECURSE] - Whether search should be done recursively or not.
6+ # _return_var - Name of variable in parent-scope holding the return value.
7+ # Returns - List of sources in the given path
78#=============================================================================#
89function (_find_sources _base_path _pattern _return_var)
910
@@ -29,9 +30,10 @@ endfunction()
2930# Finds header files matching the pre-defined header-file pattern under the given path.
3031# This functions searchs explicitly for header-files such as '*.h'.
3132# Search could also be recursive (With sub-directories) if the optional 'RECURSE' option is passed.
32- # _base_path - Top-Directory path to search source files in.
33- # _return_var - Name of variable in parent-scope holding the return value.
34- # Returns - List of header files in the given path
33+ # _base_path - Top-Directory path to search source files in.
34+ # [RECURSE] - Whether search should be done recursively or not.
35+ # _return_var - Name of variable in parent-scope holding the return value.
36+ # Returns - List of header files in the given path
3537#=============================================================================#
3638function (find_header_files _base_path _return_var)
3739
@@ -44,9 +46,10 @@ endfunction()
4446# Finds source files matching the pre-defined source-file pattern under the given path.
4547# This functions searchs explicitly for source-files such as '*.c'.
4648# Search could also be recursive (With sub-directories) if the optional 'RECURSE' option is passed.
47- # _base_path - Top-Directory path to search source files in.
48- # _return_var - Name of variable in parent-scope holding the return value.
49- # Returns - List of source files in the given path
49+ # _base_path - Top-Directory path to search source files in.
50+ # [RECURSE] - Whether search should be done recursively or not.
51+ # _return_var - Name of variable in parent-scope holding the return value.
52+ # Returns - List of source files in the given path
5053#=============================================================================#
5154function (find_source_files _base_path _return_var)
5255
@@ -55,43 +58,14 @@ function(find_source_files _base_path _return_var)
5558
5659endfunction ()
5760
58- #=============================================================================#
59- # Recursively finds header files under the given path, excluding those that don't belong to a library,
60- # such as files under the 'exmaples' directory (In case sources reside under lib's root directory).
61- # _base_path - Top-Directory path to search source files in.
62- # _return_var - Name of variable in parent-scope holding the return value.
63- # Returns - List of source files in the given path
64- #=============================================================================#
65- function (find_library_header_files _base_path _return_var)
66-
67- find_header_files(${_base_path} headers RECURSE) # Library headers are always searched recursively
68- list (FILTER headers EXCLUDE REGEX "${ARDUINO_CMAKE_EXCLUDED_LIBRARY_SOURCES_PATTERN} " )
69- set (${_return_var} "${headers} " PARENT_SCOPE)
70-
71- endfunction ()
72-
73- #=============================================================================#
74- # Recursively finds source files under the given path, excluding those that don't belong to a library,
75- # such as files under the 'exmaples' directory (In case sources reside under lib's root directory).
76- # _base_path - Top-Directory path to search source files in.
77- # _return_var - Name of variable in parent-scope holding the return value.
78- # Returns - List of source files in the given path
79- #=============================================================================#
80- function (find_library_source_files _base_path _return_var)
81-
82- find_source_files(${_base_path} sources RECURSE) # Library sources are always searched recursively
83- list (FILTER sources EXCLUDE REGEX "${ARDUINO_CMAKE_EXCLUDED_LIBRARY_SOURCES_PATTERN} " )
84- set (${_return_var} "${sources} " PARENT_SCOPE)
85-
86- endfunction ()
87-
8861#=============================================================================#
8962# Finds sketch files matching the pre-defined sketch-file pattern under the given path.
9063# This functions searchs explicitly for sketch-files such as '*.ino'.
9164# Search could also be recursive (With sub-directories) if the optional 'RECURSE' option is passed.
92- # _base_path - Top-Directory path to search source files in.
93- # _return_var - Name of variable in parent-scope holding the return value.
94- # Returns - List of header files in the given path
65+ # _base_path - Top-Directory path to search source files in.
66+ # [RECURSE] - Whether search should be done recursively or not.
67+ # _return_var - Name of variable in parent-scope holding the return value.
68+ # Returns - List of header files in the given path
9569#=============================================================================#
9670function (find_sketch_files _base_path _return_var)
9771
0 commit comments