summaryrefslogtreecommitdiffstats
path: root/HDF5Examples/JAVA
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-12-14 18:50:30 (GMT)
committerGitHub <noreply@github.com>2023-12-14 18:50:30 (GMT)
commit6f2d22d86e6a265535efe22a8bb3872b3b32a52b (patch)
treef79e0d9778b13466282c159dfec67d31faba5b8d /HDF5Examples/JAVA
parent184445f4a45c602887ca0624c5295a7b6fea2d21 (diff)
downloadhdf5-6f2d22d86e6a265535efe22a8bb3872b3b32a52b.zip
hdf5-6f2d22d86e6a265535efe22a8bb3872b3b32a52b.tar.gz
hdf5-6f2d22d86e6a265535efe22a8bb3872b3b32a52b.tar.bz2
Add variable option syncing for examples (#3885)
Diffstat (limited to 'HDF5Examples/JAVA')
-rw-r--r--HDF5Examples/JAVA/H5D/CMakeLists.txt23
-rw-r--r--HDF5Examples/JAVA/H5G/CMakeLists.txt23
-rw-r--r--HDF5Examples/JAVA/H5J/CMakeLists.txt23
-rw-r--r--HDF5Examples/JAVA/H5T/CMakeLists.txt23
4 files changed, 60 insertions, 32 deletions
diff --git a/HDF5Examples/JAVA/H5D/CMakeLists.txt b/HDF5Examples/JAVA/H5D/CMakeLists.txt
index 60c35dc..bc06506 100644
--- a/HDF5Examples/JAVA/H5D/CMakeLists.txt
+++ b/HDF5Examples/JAVA/H5D/CMakeLists.txt
@@ -3,10 +3,9 @@ project (HDF5Examples_JAVA_H5D Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
-INCLUDE_DIRECTORIES (
- ${HDFJAVA_LIB_DIR}
- ${JAVA_INCLUDE_PATH}
- ${JAVA_INCLUDE_PATH2}
+set_directory_properties(PROPERTIES
+ INCLUDE_DIRECTORIES
+ "${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)
#-----------------------------------------------------------------------------
@@ -20,6 +19,9 @@ else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif ()
+set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_INCLUDE_DIRS}")
+set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${H5EX_JAVA_LIBRARY}$<$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>:${CMAKE_DEBUG_POSTFIX}>;")
+
set (CMAKE_JAVA_CLASSPATH ".")
foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
@@ -32,13 +34,18 @@ endforeach ()
foreach (example ${HDF_JAVA_EXAMPLES})
get_filename_component (example_name ${example} NAME_WE)
- file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
+ file (WRITE ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
"Main-Class: ${example_name}
Class-Path: ${HDFJAVA_CLASSJARS}
"
)
- add_jar (${EXAMPLE_VARNAME}_${example_name} SOURCES ${example} MANIFEST ${PROJECT_BINARY_DIR}/Manifest.txt)
+ add_jar (${EXAMPLE_VARNAME}_${example_name}
+ SOURCES ${example}
+ MANIFEST ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
+ )
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
+ get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
+ add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARIES})
endforeach ()
if (H5EX_BUILD_TESTING)
@@ -46,9 +53,9 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_jnative-h5-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
-D "TEST_PROGRAM=${resultfile}"
- -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_ARGS:STRING=${ARGN};${CMD_ARGS}"
-D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${EXAMPLE_VARNAME}_${resultfile}_JAR_FILE}"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
diff --git a/HDF5Examples/JAVA/H5G/CMakeLists.txt b/HDF5Examples/JAVA/H5G/CMakeLists.txt
index 5f47d59..957934b 100644
--- a/HDF5Examples/JAVA/H5G/CMakeLists.txt
+++ b/HDF5Examples/JAVA/H5G/CMakeLists.txt
@@ -3,10 +3,9 @@ project (HDF5Examples_JAVA_GROUPS Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
-INCLUDE_DIRECTORIES (
- ${HDFJAVA_LIB_DIR}
- ${JAVA_INCLUDE_PATH}
- ${JAVA_INCLUDE_PATH2}
+set_directory_properties(PROPERTIES
+ INCLUDE_DIRECTORIES
+ "${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)
#-----------------------------------------------------------------------------
@@ -20,6 +19,9 @@ else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif ()
+set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_INCLUDE_DIRS}")
+set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${H5EX_JAVA_LIBRARY}$<$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>:${CMAKE_DEBUG_POSTFIX}>;")
+
set (CMAKE_JAVA_CLASSPATH ".")
foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
@@ -32,13 +34,18 @@ endforeach ()
foreach (example ${HDF_JAVA_EXAMPLES})
get_filename_component (example_name ${example} NAME_WE)
- file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
+ file (WRITE ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
"Main-Class: ${example_name}
Class-Path: ${HDFJAVA_CLASSJARS}
"
)
- add_jar (${EXAMPLE_VARNAME}_${example_name} SOURCES ${example} MANIFEST ${PROJECT_BINARY_DIR}/Manifest.txt)
+ add_jar (${EXAMPLE_VARNAME}_${example_name}
+ SOURCES ${example}
+ MANIFEST ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
+ )
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
+ get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
+ add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARIES})
endforeach ()
if (H5EX_BUILD_TESTING)
@@ -46,9 +53,9 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_jnative-h5-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
-D "TEST_PROGRAM=${resultfile}"
- -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_ARGS:STRING=${ARGN};${CMD_ARGS}"
-D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${EXAMPLE_VARNAME}_${resultfile}_JAR_FILE}"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
diff --git a/HDF5Examples/JAVA/H5J/CMakeLists.txt b/HDF5Examples/JAVA/H5J/CMakeLists.txt
index 8f1c195..eaefa7d 100644
--- a/HDF5Examples/JAVA/H5J/CMakeLists.txt
+++ b/HDF5Examples/JAVA/H5J/CMakeLists.txt
@@ -3,10 +3,9 @@ project (HDF5Examples_JAVA_INTRO Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
-INCLUDE_DIRECTORIES (
- ${HDFJAVA_LIB_DIR}
- ${JAVA_INCLUDE_PATH}
- ${JAVA_INCLUDE_PATH2}
+set_directory_properties(PROPERTIES
+ INCLUDE_DIRECTORIES
+ "${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)
#-----------------------------------------------------------------------------
@@ -20,6 +19,9 @@ else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif ()
+set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_INCLUDE_DIRS}")
+set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${H5EX_JAVA_LIBRARY}$<$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>:${CMAKE_DEBUG_POSTFIX}>;")
+
set (CMAKE_JAVA_CLASSPATH ".")
foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
@@ -32,13 +34,18 @@ endforeach ()
foreach (example ${HDF_JAVA_EXAMPLES})
get_filename_component (example_name ${example} NAME_WE)
- file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
+ file (WRITE ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
"Main-Class: ${example_name}
Class-Path: ${HDFJAVA_CLASSJARS}
"
)
- add_jar (${EXAMPLE_VARNAME}_${example_name} SOURCES ${example} MANIFEST ${PROJECT_BINARY_DIR}/Manifest.txt)
+ add_jar (${EXAMPLE_VARNAME}_${example_name}
+ SOURCES ${example}
+ MANIFEST ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
+ )
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
+ get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
+ add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARIES})
endforeach ()
if (H5EX_BUILD_TESTING)
@@ -46,9 +53,9 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_jnative-h5-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
-D "TEST_PROGRAM=${resultfile}"
- -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_ARGS:STRING=${ARGN};${CMD_ARGS}"
-D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${EXAMPLE_VARNAME}_${resultfile}_JAR_FILE}"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
diff --git a/HDF5Examples/JAVA/H5T/CMakeLists.txt b/HDF5Examples/JAVA/H5T/CMakeLists.txt
index a779a53..0d2cb41 100644
--- a/HDF5Examples/JAVA/H5T/CMakeLists.txt
+++ b/HDF5Examples/JAVA/H5T/CMakeLists.txt
@@ -3,10 +3,9 @@ project (HDF5Examples_JAVA_H5T Java)
set (CMAKE_VERBOSE_MAKEFILE 1)
-INCLUDE_DIRECTORIES (
- ${HDFJAVA_LIB_DIR}
- ${JAVA_INCLUDE_PATH}
- ${JAVA_INCLUDE_PATH2}
+set_directory_properties(PROPERTIES
+ INCLUDE_DIRECTORIES
+ "${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)
#-----------------------------------------------------------------------------
@@ -20,6 +19,9 @@ else ()
set (CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif ()
+set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_INCLUDE_DIRS}")
+set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=${H5EX_JAVA_LIBRARY}$<$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>:${CMAKE_DEBUG_POSTFIX}>;")
+
set (CMAKE_JAVA_CLASSPATH ".")
foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH})
set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}")
@@ -32,13 +34,18 @@ endforeach ()
foreach (example ${HDF_JAVA_EXAMPLES})
get_filename_component (example_name ${example} NAME_WE)
- file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
+ file (WRITE ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
"Main-Class: ${example_name}
Class-Path: ${HDFJAVA_CLASSJARS}
"
)
- add_jar (${EXAMPLE_VARNAME}_${example_name} SOURCES ${example} MANIFEST ${PROJECT_BINARY_DIR}/Manifest.txt)
+ add_jar (${EXAMPLE_VARNAME}_${example_name}
+ SOURCES ${example}
+ MANIFEST ${PROJECT_BINARY_DIR}/${example_name}_Manifest.txt
+ )
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
+ get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
+ add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARIES})
endforeach ()
if (H5EX_BUILD_TESTING)
@@ -46,9 +53,9 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_jnative-h5-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
-D "TEST_PROGRAM=${resultfile}"
- -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_ARGS:STRING=${ARGN};${CMD_ARGS}"
-D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${EXAMPLE_VARNAME}_${resultfile}_JAR_FILE}"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"