Silencing dependencies finding tests

Patrick Spendrin ps_ml at gmx.de
Thu May 8 11:53:22 CEST 2008


Friedrich W. H. Kossebau schrieb:
> Hi,
> 
> the kdeutils/printer-applet/cmake-modules/FindPyQt4.cmake check produces some 
> noise if PyQt4 is not found:
> 
> --- 8< ---
> Traceback (most recent call last):
> 
> File
> "/home/koder/Kode/kdesvn/trunk/KDE/kdeutils/printer-applet/cmake-modules/
> FindPyQt.py", line 9, in <module>
>     import PyQt4.pyqtconfig
> ImportError: No module named PyQt4.pyqtconfig
> --- 8< ---
> 
> 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.)
> 
> Friedrich
regards,
Patrick
> _______________________________________________
> Kde-buildsystem mailing list
> Kde-buildsystem at kde.org
> https://mail.kde.org/mailman/listinfo/kde-buildsystem
> 


-- 
web:                 http://windows.kde.org
mailing list:        kde-windows at kde.org
irc:                 #kde-windows (irc.freenode.net)


More information about the Kde-buildsystem mailing list