From d000252926e7de93c62937df7cf5cd06cde5e8d7 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 5 Oct 2011 09:18:55 +0000 Subject: [PATCH] Only sign JAR when it is built git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4703 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- cmake/SignJar.cmake | 2 ++ java/src/CMakeLists.txt | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmake/SignJar.cmake b/cmake/SignJar.cmake index 3b0d0c86..abc35ba6 100644 --- a/cmake/SignJar.cmake +++ b/cmake/SignJar.cmake @@ -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") diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 7ab9fc67..7048dd91 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -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 -- 2.39.5