summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-17 12:47:19 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-07-17 12:47:19 (GMT)
commit4c7106b1555dc41ee6b1fce1cee18e1834b91d1d (patch)
treef90719a09a0b4e9d7c568789bad1747102e0aeb2 /Modules
parent1c7dd4da312d93a920de4edd5d50edd95a49e51d (diff)
parent177c0516ce522a7ed279eed663e92acf3a373eb2 (diff)
downloadCMake-4c7106b1555dc41ee6b1fce1cee18e1834b91d1d.zip
CMake-4c7106b1555dc41ee6b1fce1cee18e1834b91d1d.tar.gz
CMake-4c7106b1555dc41ee6b1fce1cee18e1834b91d1d.tar.bz2
Merge topic 'UseJava-response-file'
177c051 UseJava: Pass sources to javac using response file (#13028)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/UseJava.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 0242b24..f518b14 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -190,6 +190,7 @@
#
#=============================================================================
+# Copyright 2013 OpenGamma Ltd. <graham@opengamma.com>
# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
# Copyright 2010 Ben Boeckel <ben.boeckel@kitware.com>
#
@@ -367,6 +368,11 @@ function(add_jar _TARGET_NAME)
endif()
if (_JAVA_COMPILE_FILES)
+ # Create the list of files to compile.
+ set(_JAVA_SOURCES_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_sources)
+ string(REPLACE ";" "\"\n\"" _JAVA_COMPILE_STRING "\"${_JAVA_COMPILE_FILES}\"")
+ file(WRITE ${_JAVA_SOURCES_FILE} ${_JAVA_COMPILE_STRING})
+
# Compile the java files and create a list of class files
add_custom_command(
# NOTE: this command generates an artificial dependency file
@@ -375,7 +381,7 @@ function(add_jar _TARGET_NAME)
${CMAKE_JAVA_COMPILE_FLAGS}
-classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}"
-d ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
- ${_JAVA_COMPILE_FILES}
+ @${_JAVA_SOURCES_FILE}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
DEPENDS ${_JAVA_COMPILE_FILES} ${_JAVA_COMPILE_DEPENDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}