Silencing dependencies finding tests

Friedrich W. H. Kossebau kossebau at kde.org
Thu May 8 12:20:47 CEST 2008


Am Donnerstag, 8. Mai 2008, um 11:53 Uhr, schrieb Patrick Spendrin:
> Friedrich W. H. Kossebau schrieb:
> > Now I saw in the cmake docs one can silence this error by adding the
> > parameter ERROR_QUIET to the EXECUTE_PROCESS() call, e.g.
> > 	EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE}
> > 		${_cmake_module_path}/FindPyQt.py
> > 		OUTPUT_VARIABLE pyqt_config ERROR_QUIET)
> >
> > Is this the way to go? Or should there be also some support for verbose
> > checks, to see why PyQt4 was not found? Is this done elsewhere, or am I
> > correct with not finding such a support?
>
> No, I changed some stuff recently:
> a better way is to use:
> -import PyQt4.pyqtconfig
> +try:
> +	import PyQt4.pyqtconfig
> +catch:
> +	exit(1)
>
> That way the error message is suppressed in the script (as it is not
> useful anyway)
> I made some similar changes one week ago. (but I forgot PyQt as I do
> have it.)

I had already also added ERROR_QUIET, as I had seen it elsewhere. But your 
solution looks more clean, as it catches just the error the check uses. So I 
better remove ERROR_QUIET again, I guess, so other possible errors are not 
suppressed.

Friedrich


More information about the Kde-buildsystem mailing list