Skip to content

Commit 2d13f5b

Browse files
authored
Add cmake workaround for hdf5 version detection when using hdf5 with subversion (#26)
* [cmake] Work around issue of detecting hdf5 version for releases with subversion
1 parent 64c0632 commit 2d13f5b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

c++/h5/CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ find_package(HDF5 REQUIRED C HL)
3030

3131
# Link against interface target and export
3232
target_link_libraries(h5_c PRIVATE hdf5::hdf5 hdf5::hdf5_hl)
33-
if(HDF5_VERSION VERSION_GREATER 1.10)
34-
target_compile_definitions(h5_c PRIVATE H5_USE_110_API)
35-
endif()
36-
if(HDF5_VERSION VERSION_GREATER_EQUAL 1.13)
33+
target_compile_definitions(h5_c PRIVATE H5_USE_110_API)
34+
if(HDF5_VERSION VERSION_GREATER_EQUAL 1.13 OR NOT HDF5_VERSION)
3735
target_compile_definitions(h5_c PRIVATE H5_VER_GE_113)
3836
endif()
3937

0 commit comments

Comments
 (0)