Skip to content

Commit

Permalink
Bundling of HDF5 : Include symlinks in addition to binary file
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed May 29, 2020
1 parent dc188dc commit 52e9f54
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -474,25 +474,16 @@ endif (RESINSIGHT_PRIVATE_INSTALL)

if (RESINSIGHT_HDF5_BUNDLE_LIBRARIES)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
foreach (FILE_TO_COPY ${HDF5_LIBRARIES})

# find all files containing the string "hdf"
STRING( FIND ${FILE_TO_COPY} "hdf5" POS_IN_STRING )
if(${POS_IN_STRING} GREATER -1)
get_filename_component(ABS_DIR ${FILE_TO_COPY} REALPATH)
message (STATUS "HDF5 bundle file - ${ABS_DIR}")

# as part of install, rename file with the extension ResInsight reports when running "ldd"
get_filename_component(FILE_NAME_WE ${FILE_TO_COPY} NAME_WE)
set(FILE_NAME_FOR_INSTALL "${FILE_NAME_WE}.so.6")
message (STATUS "HDF5 file FILE_NAME_FOR_INSTALL - ${FILE_NAME_FOR_INSTALL}")

install(FILES ${ABS_DIR} DESTINATION ${RESINSIGHT_INSTALL_FOLDER} RENAME ${FILE_NAME_FOR_INSTALL} )
endif()
endforeach()

# find all file names with text hdf5
# use file globbing to also copy the symlinks to make sure the dependencies from ResInsight runtime is correct
foreach (FILE_TO_COPY ${HDF5_LIBRARIES})
STRING( FIND ${FILE_TO_COPY} "hdf5" POS_IN_STRING )
if(${POS_IN_STRING} GREATER -1)
file(GLOB FILE_AND_SYMLINKS ${FILE_TO_COPY}*)
install(FILES ${FILE_AND_SYMLINKS} DESTINATION ${RESINSIGHT_INSTALL_FOLDER} )
endif()
endforeach()
endif()

endif (RESINSIGHT_HDF5_BUNDLE_LIBRARIES)


Expand Down

0 comments on commit 52e9f54

Please sign in to comment.