[CMake] Putting moc and uic files in separate folders/filters(Visual Studio)

Patrick Noffke Patrick.Noffke at adpro.com.au
Mon Jun 19 20:41:47 EDT 2006


> Patrick Noffke wrote:
> > Is it possible to put the generated files (moc_*.cxx and 
> ui_*.h) in their own filters in VS 2005 Express Edition?  
> When I add headers or cpp/cxx files using ADD_EXECUTABLE or 
> ADD_LIBRARY, they are all lumped in the "Header Files" or 
> "Source Files" filters, respectively.  Since I have to add 
> moc- and uic-generated files to my target, this makes for a 
> cluttered view of the project.
> 
> Try the SOURCE_GROUP command.
> 
> -Brad

Thanks, got it to work.  Couldn't make use of the REGULAR_EXPRESSION option with:

SOURCE_GROUP("Moc Files" REGULAR_EXPRESSION moc_*.cxx)

but then I'm not sure how regexp's work with cmake.

But I was able to get it to work using the FILES option:

QT4_WRAP_CPP(foo_MOC_SRCS ${foo_MOC_HDRS})
SOURCE_GROUP("Moc Files" FILES ${foo_MOC_SRCS})

Regards,
Pat

P.S.  Brad, sorry didn't mean to reply to you directly.  I'm resending this to the list.


More information about the CMake mailing list