[CMake] PCH & Qt (UIC)

Mike Krus mike at mve.com
Wed Mar 7 07:54:27 EST 2012


Hi

I've been trying to get precompiled headers to work with CMake. I've 
managed to get things to work nicely on MSVC but I'm having problems 
with gcc.

I found this resource:
http://browse-code.mrpt.org/mrpt-0.6.2/cmakemodules/PCHSupport_26.cmake

It works well except in the case where your project contains UI files. 
In that case, uic is not run on those UI files before doing the pch, so 
the resulting ui_*.h are not available to include...
(But VS knows to do it the right way.)

Ideal solution would be to clean up our old code and stop requiring uic 
generated code to be included in our .h files. Would be nice, but we 
have a lot of legacy code to go through...

I've tried to hack the script above to add the ui_*.h files as 
dependencies of the generated gch file, but it does not seem to work...

Anybody got this to work?

Cheers,

Mike

-- 
Mike Krus (PhD) - Principal Software Engineer

Midland Valley Exploration
144 West George Street
Glasgow G2 2HG, UK
Tel: +44 141 332 2681
Fax: +44 141 332 6792


More information about the CMake mailing list