Make sure that keytool and jarsigner don't die silently


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4700 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/cmake/SignJar.cmake b/cmake/SignJar.cmake
index 00c9939..5fce245 100644
--- a/cmake/SignJar.cmake
+++ b/cmake/SignJar.cmake
@@ -13,8 +13,16 @@
 execute_process(COMMAND
   ${KEYTOOL} -genkey -alias TigerVNC -keystore tigervnc.keystore -keyalg RSA
     -storepass tigervnc -keypass tigervnc -validity 7300
-    -dname "CN=TigerVNC, OU=Software Development, O=The TigerVNC Project, L=Austin, S=Texas, C=US")
+    -dname "CN=TigerVNC, OU=Software Development, O=The TigerVNC Project, L=Austin, S=Texas, C=US"
+  RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
+if(NOT RESULT EQUAL 0)
+  message(FATAL_ERROR "${KEYTOOL} failed:\n${ERROR}")
+endif()
 execute_process(COMMAND
   ${JARSIGNER} -keystore tigervnc.keystore
-    -storepass tigervnc -keypass tigervnc ${JAR_FILE} TigerVNC)
+    -storepass tigervnc -keypass tigervnc ${JAR_FILE} TigerVNC
+  RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
+if(NOT RESULT_VARIABLE EQUAL 0)
+  message(FATAL_ERROR "${JARSIGNER} failed:\n${ERROR}")
+endif()
 file(REMOVE tigervnc.keystore)