[trunk] User can now control source/target java version
Fixes issue 303
This commit is contained in:
parent
6d9e8a5a63
commit
51ab074d50
|
@ -59,6 +59,14 @@ endforeach()
|
|||
# Build the two java clients:
|
||||
find_package(Java 1.5 COMPONENTS Development) # javac, jar
|
||||
|
||||
# User can override this:
|
||||
if(NOT DEFINED JAVA_SOURCE_VERSION)
|
||||
set(JAVA_SOURCE_VERSION 1.5)
|
||||
endif()
|
||||
if(NOT DEFINED JAVA_TARGET_VERSION)
|
||||
set(JAVA_TARGET_VERSION 1.5)
|
||||
endif()
|
||||
|
||||
# Only build the java viewer if dev is found:
|
||||
if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
||||
set(jflags $ENV{JFLAGS})
|
||||
|
@ -97,6 +105,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
|||
add_custom_command(
|
||||
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
|
||||
-source ${JAVA_SOURCE_VERSION} -target ${JAVA_TARGET_VERSION}
|
||||
-classpath ${APACHE_XERCES_JAR}
|
||||
${java2_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes2
|
||||
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||
|
@ -127,6 +136,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
|
|||
add_custom_command(
|
||||
OUTPUT ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||
COMMAND ${Java_JAVAC_EXECUTABLE} ${jflags}
|
||||
-source ${JAVA_SOURCE_VERSION} -target ${JAVA_TARGET_VERSION}
|
||||
${java1_srcs} -d ${CMAKE_CURRENT_BINARY_DIR}/classes1
|
||||
COMMAND ${Java_JAR_EXECUTABLE} cfm ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_viewer/dist/manifest.txt -C
|
||||
|
|
Loading…
Reference in New Issue