In my cmake C++ project, I am adding source files to target by
file(GLOB HEADERS *.h)
file(GLOB SOURCES *.cpp)
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
In macOS this is including files like ._Source.cpp
and ._Header.h
I tried the REGEX
list(FILTER HEADERS REGEX "^[^\.].+" output_variable HEADERS)
list(FILTER SOURCES REGEX "^[^\.].+" output_variable SOURCES)
but this is not working.