Is there a canonical way of matching a filename against a number of
filetypes?

 

I have a list of files MY_FILES, and I'd like to efficiently extract
those which match a given list of filename extensions, in otherwords
something like this:

 

                SET(ALL_FILES_VAR this.c that.cpp something.h test.dat
readme.txt)

                SET(EXTENSIONS c cpp)

                MATCH_FILES(MATCHED_FILES_VAR ALL_FILES_VAR EXTENSIONS)

                MESSAGE("Should just contain this.c that.cpp :
${MATCHED_FILES_VAR}")

 

The problem I'm trying to solve is, given a list of files, run a
specific custom target generator for all those of a given type.
Something like this:

 

MAKE_TARGETS(HANDLER LIST_OF_FILES EXTENSION_FILTER)  

 

Or explicitly

 

                MAKE_TARGETS(DOXIGEN LIST_OF_FILES "c cpp")

 

or

 

                MAKE_TARGETS(LATEX LIST_OF_FILES "tex tek")

 

Any thought would be very welcomely received.  It maybe I'm trying to
reinvent the wheel here.

 

Joe

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to