summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-10-11 12:18:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-10-11 12:18:50 (GMT)
commit027bcee513788b5ab17c3328a14cb8ac8354ba00 (patch)
tree738d61521bf4bb754614e7f76cdf388c7a1eb050 /Tests
parent5d6ba8f2daab9ebff570f36908d48defdf37d607 (diff)
parentdead049e0b4ff531866ef9bf362f3f5e8fb177aa (diff)
downloadCMake-027bcee513788b5ab17c3328a14cb8ac8354ba00.zip
CMake-027bcee513788b5ab17c3328a14cb8ac8354ba00.tar.gz
CMake-027bcee513788b5ab17c3328a14cb8ac8354ba00.tar.bz2
Merge topic 'UseJava_OUTPUT_DIR'
dead049e UseJava: OUTPUT_DIR must exists in all cases. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1368
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt12
-rw-r--r--Tests/Java/CMakeLists.txt3
2 files changed, 15 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index ce53454..c25fc44 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3261,6 +3261,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
--build-options ${build_options}
--test-command ${JAVA_RUNTIME} -classpath hello2.jar HelloWorld)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceList")
+ add_test(Java.JarSourceListAndOutput ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Java"
+ "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput"
+ ${build_generator_args}
+ --build-project hello
+ --build-target hello3
+ --build-two-config
+ --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput/hello3"
+ --build-options ${build_options}
+ --test-command ${JAVA_RUNTIME} -classpath hello3.jar HelloWorld)
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput")
# For next test, java tool must have same architecture as toolchain
math(EXPR _object_mode "${CMAKE_SIZEOF_VOID_P} * 8")
diff --git a/Tests/Java/CMakeLists.txt b/Tests/Java/CMakeLists.txt
index e1bcf3c..0b8269b 100644
--- a/Tests/Java/CMakeLists.txt
+++ b/Tests/Java/CMakeLists.txt
@@ -11,3 +11,6 @@ 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)
+
+# use listing file to specify sources and specify output directory (issue #17316)
+add_jar(hello3 @${CMAKE_CURRENT_BINARY_DIR}/java_fileslist OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/hello3")