aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-04-18 20:32:43 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-18 20:32:43 +0200
commit56029abd64b55faefef75b49a58905ec391e0c6d (patch)
treeab5e4e985ddfa810ee461e7a99a16573339efd6c
parent509a53d4ab0769be2d486e7e7724eb831c033622 (diff)
Improve REGEX to detects tests files.
Miss a flag to set regex case-insensitiven, or I did not find it. Change-Id: I3b743e040e57d80e4f97490feba379533387cf87 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--CAN-binder/CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/CAN-binder/CMakeLists.txt b/CAN-binder/CMakeLists.txt
index ec91089..b6c51eb 100644
--- a/CAN-binder/CMakeLists.txt
+++ b/CAN-binder/CMakeLists.txt
@@ -54,11 +54,17 @@ endmacro(fill_include_dir)
# Helper function to retrieve source files from a library repo.
function(find_source_files path)
- file(GLOB_RECURSE filelist "${path}/*.[cpx]")
- foreach(filename ${filelist})
- if(NOT ${filename} MATCHES ".*(test|example|sample).*")
+ file(GLOB_RECURSE cfiles "${path}/*.[c]")
+ file(GLOB_RECURSE cppfiles "${path}/*.cpp")
+ foreach(filename ${cfiles})
+ if(NOT ${filename} MATCHES ".*([Tt]est|[Ee]xample|[Ss]ample).*")
string(APPEND sources "${filename};")
- endif(NOT ${filename} MATCHES ".*(test|example|sample).*")
+ endif(NOT ${filename} MATCHES ".*([Tt]est|[Ee]xample|[Ss]ample).*")
+ endforeach()
+ foreach(filename ${cppfiles})
+ if(NOT ${filename} MATCHES ".*([Tt]est|[Ee]xample|[Ss]ample).*")
+ string(APPEND sources "${filename};")
+ endif(NOT ${filename} MATCHES ".*([Tt]est|[Ee]xample|[Ss]ample).*")
endforeach()
set(sources_files ${sources} PARENT_SCOPE)
endfunction(find_source_files)