]> source.dussan.org Git - tigervnc.git/commitdiff
Only sign JAR when it is built
authorDRC <dcommander@users.sourceforge.net>
Wed, 5 Oct 2011 09:18:55 +0000 (09:18 +0000)
committerDRC <dcommander@users.sourceforge.net>
Wed, 5 Oct 2011 09:18:55 +0000 (09:18 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4703 3789f03b-4d11-0410-bbf8-ca57d06f2519

cmake/SignJar.cmake
java/src/CMakeLists.txt

index 3b0d0c8620874b6b04f2827f28ffa8c60301eaac..abc35ba60ac12e09330372cd358fb118c6f41ea9 100644 (file)
@@ -6,6 +6,8 @@ if(NOT JAR_FILE)
   message(FATAL_ERROR "JAR_FILE must be defined")
 endif()
 
+message(STATUS "Signing ${JAR_FILE}")
+
 set(KEYTOOL "${Java_PATH}/keytool")
 set(JARSIGNER "${Java_PATH}/jarsigner")
 
index 7ab9fc67a06c2d12b01cd9353c2129c485f19f6f..7048dd91e609bdf1999bba0bb36ab423a13571fe 100644 (file)
@@ -72,6 +72,8 @@ add_custom_command(OUTPUT ${JAVA_BINDIR}/tigervnc.ico
     ${JAVA_SRCDIR}/tigervnc.ico ${JAVA_BINDIR}/tigervnc.ico
   DEPENDS ${JAVA_SRCDIR}/tigervnc.ico)
 
+string(REGEX REPLACE "jar" "" Java_PATH ${Java_JAR_EXECUTABLE})
+
 add_custom_command(OUTPUT VncViewer.jar
   DEPENDS ${JAVA_CLASSES_FULL}
     ${JAVA_SRCDIR}/MANIFEST.MF
@@ -88,17 +90,14 @@ add_custom_command(OUTPUT VncViewer.jar
     com/jcraft/jzlib/*.class
     com/tigervnc/vncviewer/tigervnc.png
     com/tigervnc/vncviewer/tigervnc.ico
+  COMMAND ${CMAKE_COMMAND}
+  ARGS -DJava_PATH=${Java_PATH}
+    -DJAR_FILE=${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar
+    -P ${CMAKE_SOURCE_DIR}/cmake/SignJar.cmake
   WORKING_DIRECTORY ${OBJDIR})
 
 add_custom_target(java ALL DEPENDS VncViewer.jar)
 
-string(REGEX REPLACE "jar" "" Java_PATH ${Java_JAR_EXECUTABLE})
-
-add_custom_command(TARGET java POST_BUILD COMMAND
-  ${CMAKE_COMMAND} -DJava_PATH=${Java_PATH}
-    -DJAR_FILE=${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar
-    -P ${CMAKE_SOURCE_DIR}/cmake/SignJar.cmake)
-
 install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/VncViewer.jar
   ${JAVA_SRCDIR}/README