[CMake] Adding non-compiled files to project?

Timenkov Yuri ytimenkov at parallels.com
Mon Jun 23 12:30:21 EDT 2008


On Monday 23 June 2008 20:17:06 Mike Arthur wrote:
> On Monday 23 June 2008 16:36:53 Timenkov Yuri wrote:
> > Just add them to corresponding target. CMake won't try to compile them if
> > they don't have source file extension. If file has a source file extension,
> > you should set source files property HEADER_FILE_ONLY to true: ex:
> That seems to work great. 
> 
> The only problem I'm having now is how I apply source_group to files that are 
> generated by other commands e.g. moc_* files from qt4_wrap_cpp
Hmm, I don't think this should be a big deal:

qt4_wrap_cpp(MyApp_MOC_SRCS ${MyApp_HDRS})
source_group("Autogenerated MOC files" FILES ${MyApp_MOC_SRCS})

I didn't try it, but this should work :)
My be it worth filing feature request to bug tracker: automatically add Moc and UI files to such group in FindQt4.cmake like qmake does.

> 
> Thanks!
> 
> --
> Cheers,
> Mike Arthur
> 




More information about the CMake mailing list