Skip to content

Commit

Permalink
Fix the examples for testing java with binaries (HDFGroup#4660)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF authored and lrknox committed Jul 19, 2024
1 parent d0ccb6f commit 7d7c8b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion HDF5Examples/config/cmake/HDFExampleMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,20 @@ macro (HDF5_SUPPORT)
if (HDF_BUILD_JAVA AND HDF5_Java_FOUND)
if (${HDF5_BUILD_JAVA})
set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF5_JAVA_INCLUDE_DIRS}")
set (H5EX_JAVA_LIBRARY ${HDF5_JAVA_LIBRARY})
if (HDF5_BUILD_MODE)
string(TOUPPER "${HDF5_BUILD_MODE}" UPPER_BUILD_TYPE)
get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE})
elseif (HDF_CFG_NAME)
string(TOUPPER "${HDF_CFG_NAME}" UPPER_BUILD_TYPE)
get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME_${UPPER_BUILD_TYPE})
else()
get_target_property(libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME)
endif()
get_filename_component (libname ${libsoname} NAME_WE)
string (REGEX REPLACE "^lib" "" libname ${libname})
message (STATUS "HDF5 lib:${HDF5_JAVA_LIBRARY} OR ${libsoname} OR ${libname}")
set (H5EX_JAVA_LIBRARY ${libname})
# set (H5EX_JAVA_LIBRARY $<TARGET_FILE_BASE_NAME:${HDF5_JAVA_LIBRARY}>)
set (H5EX_JAVA_LIBRARIES ${HDF5_JAVA_LIBRARY})
message (STATUS "HDF5 lib:${H5EX_JAVA_LIBRARY} jars:${HDF5_JAVA_INCLUDE_DIRS}}")
else ()
Expand Down
2 changes: 2 additions & 0 deletions config/cmake/hdf5-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set (${HDF5_PACKAGE_NAME}_VALID_COMPONENTS
Tools
)

set (${HDF5_PACKAGE_NAME}_BUILD_MODE @HDF_CFG_NAME@)

#-----------------------------------------------------------------------------
# User Options
#-----------------------------------------------------------------------------
Expand Down

0 comments on commit 7d7c8b2

Please sign in to comment.