diff options
author | Brad King <brad.king@kitware.com> | 2014-03-26 17:24:31 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-03-26 17:24:31 (GMT) |
commit | bcd4d0ced8a8161822233f66b54b41d388e5fc1c (patch) | |
tree | 6631f7f7486a178d05ea4c130139068d154e29c7 /Modules | |
parent | 5ae8f33617227a70fe3ce34014a15f60b3f1904f (diff) | |
parent | 2abd8efecbc6be237190f8fa2f10d6e0b53e08b9 (diff) | |
download | CMake-bcd4d0ced8a8161822233f66b54b41d388e5fc1c.zip CMake-bcd4d0ced8a8161822233f66b54b41d388e5fc1c.tar.gz CMake-bcd4d0ced8a8161822233f66b54b41d388e5fc1c.tar.bz2 |
Merge topic 'UseJava-fix-resource-copy'
2abd8efe UseJava: Copy resource files before compiling the jar (#13360)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/UseJava.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 654b4d0..127012f 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -426,6 +426,7 @@ function(add_jar _TARGET_NAME) set(_JAVA_DEPENDS) set(_JAVA_COMPILE_DEPENDS) set(_JAVA_RESOURCE_FILES) + set(_JAVA_RESOURCE_FILES_RELATIVE) foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES}) get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT) get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE) @@ -462,7 +463,8 @@ function(add_jar _TARGET_NAME) __java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE} "Copying ${_JAVA_SOURCE_FILE} to the build directory") - list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE}) + list(APPEND _JAVA_RESOURCE_FILES ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}) + list(APPEND _JAVA_RESOURCE_FILES_RELATIVE ${_JAVA_SOURCE_FILE}) endif () endforeach() @@ -529,7 +531,7 @@ function(add_jar _TARGET_NAME) OUTPUT ${_JAVA_JAR_OUTPUT_PATH} COMMAND ${Java_JAR_EXECUTABLE} -cf${_ENTRY_POINT_OPTION}${_MANIFEST_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_MANIFEST_VALUE} - ${_JAVA_RESOURCE_FILES} @java_class_filelist + ${_JAVA_RESOURCE_FILES_RELATIVE} @java_class_filelist COMMAND ${CMAKE_COMMAND} -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} @@ -549,7 +551,7 @@ function(add_jar _TARGET_NAME) OUTPUT ${_JAVA_JAR_OUTPUT_PATH} COMMAND ${Java_JAR_EXECUTABLE} -cf${_ENTRY_POINT_OPTION}${_MANIFEST_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE} ${_MANIFEST_VALUE} - ${_JAVA_RESOURCE_FILES} @java_class_filelist + ${_JAVA_RESOURCE_FILES_RELATIVE} @java_class_filelist COMMAND ${CMAKE_COMMAND} -D_JAVA_TARGET_DIR=${_add_jar_OUTPUT_DIR} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} |