From 56029abd64b55faefef75b49a58905ec391e0c6d Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 18 Apr 2017 20:32:43 +0200 Subject: 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 --- CAN-binder/CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'CAN-binder/CMakeLists.txt') 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) -- cgit 1.2.3-korg