summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/CMakeLists.txt24
-rw-r--r--java/examples/groups/CMakeLists.txt10
-rw-r--r--java/test/CMakeLists.txt22
3 files changed, 20 insertions, 36 deletions
diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt
index 0440d41..706b196 100644
--- a/java/CMakeLists.txt
+++ b/java/CMakeLists.txt
@@ -13,6 +13,12 @@ find_package (JNI)
INCLUDE_DIRECTORIES ( ${JNI_INCLUDE_DIRS} )
+if (WIN32)
+ set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre8")
+else (WIN32)
+ set (HDF_JRE_DIRECTORY "/usr/lib/jvm/jre")
+endif (WIN32)
+
#-----------------------------------------------------------------------------
# Include the main src and config directories
#-----------------------------------------------------------------------------
@@ -61,17 +67,9 @@ install (
#-----------------------------------------------------------------------------
option (HDF5_JAVA_PACK_JRE "Package a JRE installer directory" OFF)
if (HDF5_JAVA_PACK_JRE)
- if (WIN32)
- install (
- DIRECTORY "C:/Program Files/Java/jre8"
- DESTINATION ${HDF5_INSTALL_BIN_DIR}
- USE_SOURCE_PERMISSIONS
- )
- else (WIN32)
- install (
- DIRECTORY "/usr/lib/jvm/jre"
- DESTINATION ${HDF5_INSTALL_BIN_DIR}
- USE_SOURCE_PERMISSIONS
- )
- endif (WIN32)
+ install (
+ DIRECTORY ${HDF_JRE_DIRECTORY}
+ DESTINATION ${HDF5_INSTALL_BIN_DIR}
+ USE_SOURCE_PERMISSIONS
+ )
endif (HDF5_JAVA_PACK_JRE)
diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt
index 1d61614..410168a 100644
--- a/java/examples/groups/CMakeLists.txt
+++ b/java/examples/groups/CMakeLists.txt
@@ -56,15 +56,9 @@ set (HDF_JAVA_TEST_FILES
)
foreach (h5_file ${HDF_JAVA_TEST_FILES})
- set (dest "${PROJECT_BINARY_DIR}/${h5_file}")
- #message (STATUS " Copying ${h5_file}")
- add_custom_command (
- TARGET H5Ex_G_Visit
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest}
- )
+ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "H5Ex_G_Visit_files")
endforeach (h5_file ${HDF_JAVA_TEST_FILES})
+add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G_Visit tests" DEPENDS ${H5Ex_G_Visit_files_list})
MACRO (ADD_H5_TEST resultfile resultcode)
if (CMAKE_BUILD_TYPE MATCHES Debug)
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index 9038800..27f1903 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -68,22 +68,11 @@ set (HDF_JAVA_TEST_FILES
)
foreach (h5_file ${HDF_JAVA_TEST_FILES})
- set (dest "${PROJECT_BINARY_DIR}/${h5_file}")
- #message (STATUS " Copying ${h5_file}")
- add_custom_command (
- TARGET ${HDF5_JAVA_TEST_LIB_TARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest}
- )
+ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
endforeach (h5_file ${HDF_JAVA_TEST_FILES})
-add_custom_command (
- TARGET ${HDF5_JAVA_TEST_LIB_TARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig ${PROJECT_BINARY_DIR}/h5ex_g_iterate.hdf
-)
+HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterate.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list})
if (WIN32)
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
@@ -128,4 +117,7 @@ add_test (
-D "TEST_REFERENCE=JUnit-interface.txt"
-P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
)
-set_tests_properties (JUnit-interface PROPERTIES DEPENDS "JUnit-interface-clearall-objects")
+set_tests_properties (JUnit-interface PROPERTIES
+ ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2"
+ DEPENDS "JUnit-interface-clearall-objects"
+)