[CMake] regular expression help: set a variable for all source
file
Grant Tang
grant.tang at gmail.com
Thu Mar 2 11:03:16 EST 2006
On 3/2/06, William A. Hoffman <billlist at nycap.rr.com> wrote:
>
> At 10:20 AM 3/2/2006, Grant Tang wrote:
> >Hi,
> >
> >I have a mkdoc target, which is for extracting document information from
> all C/C++
> >and Python source files. I tried this setting:
> >
> >SET(MKDOCSRCS
> > "@SOURCE_DIR@/subdir1/\\.(C|c|cpp|py)$"
> > "@SOURCE_DIR@/subdir2/\\.(C|c|cpp|py)$"
> > "@SOURCE_DIR@/subdir3/\\.(C|c|cpp|py)$"
> > )
> >ADD_CUSTOM_TARGET( mkdoc
> > DEPENDS ${MKDOCSRCS}
> >)
> >
> >But my cmake complain:
> >
> >CMake Error: can not find file
> /home/gtang/EMAN/src/eman/boxer/\.(C|c|cpp|py)$
> >
> >Tried .c .C .c++ .cc .cpp .cxx .m .M .mm .h .h++ .hm .hpp .hxx .in .txx
> >
> >Could somebody help me out?
>
> You can not depend on a regular expression. You may want to try the
> FILE(GLOB variable [globbing expressions]...)
>
> -Bill
>
>
> Yeah! I use FILE(GLOB_RECURSE mkdoc [globbing expressions]...) just work
exactly as I need.
Thank you very much!
--
Grant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20060302/4c92e17a/attachment.html
More information about the CMake
mailing list