You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Didier Trosset <di...@acqiris.com> on 2004/10/18 09:32:07 UTC

Ignoring Qt generated .h and .cpp files.

Hello,

I'm using Qt for the GUIs, and this causes me annoyance along with 
subversion regarding ignoring files. Indeed, Qt uses a preprocessor that 
generates source and header files, that are not versionned, and I would 
like svn to ignore them.

For the unaware of Qt, briefly it has 2 ways to use it:
  - MOC mode: foo.h and foo.cpp are versionned, moc_foo.cpp is generated.
  - UIC mode: bar.ui and bar.ui.h are versionned, bar.h, bar.cpp and 
moc_bar.cpp are generated.

For the MOC mode, it's OK, adding moc_*.cpp to svn:ignore does the job.

But for the UIC mode, there is nothing such possible, as adding *.h and 
*.cpp would deprive me of valuable information for non Qt files. I was 
wondering if there was a way to ignore these generated *.h and *.cpp 
files depending on the presence of a *.ui file.

The solution of generating the files in another directory (where 
svn:ignore *.cpp and *.h would suffice) is not acceptable because of the 
complexity it adds in managing the relative paths for #includes.

Thanks
Didier

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Ignoring Qt generated .h and .cpp files.

Posted by Toby Johnson <to...@etjohnson.us>.
Didier Trosset wrote:

>
> Hello,
>
> I'm using Qt for the GUIs, and this causes me annoyance along with 
> subversion regarding ignoring files. Indeed, Qt uses a preprocessor 
> that generates source and header files, that are not versionned, and I 
> would like svn to ignore them.
>
> For the unaware of Qt, briefly it has 2 ways to use it:
>  - MOC mode: foo.h and foo.cpp are versionned, moc_foo.cpp is generated.
>  - UIC mode: bar.ui and bar.ui.h are versionned, bar.h, bar.cpp and 
> moc_bar.cpp are generated.
>
> For the MOC mode, it's OK, adding moc_*.cpp to svn:ignore does the job.
>
> But for the UIC mode, there is nothing such possible, as adding *.h 
> and *.cpp would deprive me of valuable information for non Qt files. I 
> was wondering if there was a way to ignore these generated *.h and 
> *.cpp files depending on the presence of a *.ui file.

Unless the developers add some sort of "svn:ignore-regex" option, the 
only solution I see to this would be to create a script to look for all 
instances of *.ui and explicitly add the corresponding three files to 
that directory's svn:ignore list. Your script could recursively check 
all directories in your project and update the svn:ignore lists accordingly.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org