Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the examples for testing java with binaries #4660

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ${HDF5_PACKAGE_NAME}_BUILD_MODE to match the variable defined in hdf5-config.cmake?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the variable defined in hdf5-config.cmake, which is why the update to hdf5-config.cmake.in

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@)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the motivation for introducing this new variable in addition to the pre-existing HDF_CFG_NAME?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This records the setting to supply the use of the binary.


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