summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@sap.com>2015-07-30 09:17:04 (GMT)
committerBrad King <brad.king@kitware.com>2015-08-04 15:19:43 (GMT)
commit3d287de4ea99718ffe2ac6b855c2786d67946be2 (patch)
treeda8f2e5214ad8710a04d6170653ce03ee712bc95 /Tests
parente72806fb30dd9162aa1b05cb478ae51d1ecd27fa (diff)
downloadCMake-3d287de4ea99718ffe2ac6b855c2786d67946be2.zip
CMake-3d287de4ea99718ffe2ac6b855c2786d67946be2.tar.gz
CMake-3d287de4ea99718ffe2ac6b855c2786d67946be2.tar.bz2
UseJava: Teach add_jar to support file syntax for sources
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt21
-rw-r--r--Tests/Java/CMakeLists.txt4
2 files changed, 21 insertions, 4 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index d95a5f4..5781a9e 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3008,17 +3008,30 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink
file(READ "${JNI_H}" JNI_FILE)
if("${JNI_FILE}" MATCHES "JDK1_2")
- add_test(Java ${CMAKE_CTEST_COMMAND}
+ add_test(Java.Jar ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Java"
- "${CMake_BINARY_DIR}/Tests/Java"
+ "${CMake_BINARY_DIR}/Tests/JavaJar"
${build_generator_args}
--build-project hello
+ --build-target hello
--build-two-config
- --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/"
+ --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJar/"
--build-options ${build_options}
--test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java")
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJar")
+ add_test(Java.JarSourceList ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Java"
+ "${CMake_BINARY_DIR}/Tests/JavaJarSourceList"
+ ${build_generator_args}
+ --build-project hello
+ --build-target hello2
+ --build-two-config
+ --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceList/"
+ --build-options ${build_options}
+ --test-command ${JAVA_RUNTIME} -classpath hello2.jar HelloWorld)
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceList")
endif()
endif()
endif()
diff --git a/Tests/Java/CMakeLists.txt b/Tests/Java/CMakeLists.txt
index 6a69a24..e1bcf3c 100644
--- a/Tests/Java/CMakeLists.txt
+++ b/Tests/Java/CMakeLists.txt
@@ -7,3 +7,7 @@ find_package(Java COMPONENTS Development)
include (UseJava)
add_jar(hello A.java HelloWorld.java)
+
+# use listing file to specify sources
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/java_fileslist "A.java\nHelloWorld.java\n")
+add_jar(hello2 @${CMAKE_CURRENT_BINARY_DIR}/java_fileslist)