summaryrefslogtreecommitdiffstats
path: root/Modules/UseJava.cmake
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2012-02-07 15:00:49 (GMT)
committerAndreas Schneider <asn@cryptomilk.org>2012-02-13 12:27:48 (GMT)
commit17a8e16cd243f06597ad1246775f80fc5a4337b4 (patch)
treea0c356c8c65a3fd267094ff8f6eebc69f6e31147 /Modules/UseJava.cmake
parentf17d3f58d66a8aac3d149e8819eb6a9666d0526e (diff)
downloadCMake-17a8e16cd243f06597ad1246775f80fc5a4337b4.zip
CMake-17a8e16cd243f06597ad1246775f80fc5a4337b4.tar.gz
CMake-17a8e16cd243f06597ad1246775f80fc5a4337b4.tar.bz2
java: Factor jar output path.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'Modules/UseJava.cmake')
-rw-r--r--Modules/UseJava.cmake20
1 files changed, 11 insertions, 9 deletions
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index b78278c..f1af5a9 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -312,11 +312,13 @@ function(add_jar _TARGET_NAME)
endif (_JAVA_COMPILE_FILES)
# create the jar file
+ set(_JAVA_JAR_OUTPUT_PATH
+ ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
if (CMAKE_JNI_TARGET)
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
COMMAND ${Java_JAR_EXECUTABLE}
- -cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ -cf ${_JAVA_JAR_OUTPUT_PATH}
${_JAVA_RESOURCE_FILES} @java_class_filelist
COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}
@@ -325,7 +327,7 @@ function(add_jar _TARGET_NAME)
-P ${_JAVA_SYMLINK_SCRIPT}
COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}
- -D_JAVA_TARGET_OUTPUT_NAME=${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT}
DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
@@ -334,9 +336,9 @@ function(add_jar _TARGET_NAME)
)
else ()
add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
COMMAND ${Java_JAR_EXECUTABLE}
- -cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ -cf ${_JAVA_JAR_OUTPUT_PATH}
${_JAVA_RESOURCE_FILES} @java_class_filelist
COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}
@@ -350,14 +352,14 @@ function(add_jar _TARGET_NAME)
endif (CMAKE_JNI_TARGET)
# Add the target and make sure we have the latest resource files.
- add_custom_target(${_TARGET_NAME} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
+ add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
set_property(
TARGET
${_TARGET_NAME}
PROPERTY
INSTALL_FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ ${_JAVA_JAR_OUTPUT_PATH}
)
if (_JAVA_TARGET_OUTPUT_LINK)
@@ -366,7 +368,7 @@ function(add_jar _TARGET_NAME)
${_TARGET_NAME}
PROPERTY
INSTALL_FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ ${_JAVA_JAR_OUTPUT_PATH}
${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
)
@@ -386,7 +388,7 @@ function(add_jar _TARGET_NAME)
${_TARGET_NAME}
PROPERTY
JAR_FILE
- ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}
+ ${_JAVA_JAR_OUTPUT_PATH}
)
set_property(