summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-08-10 20:48:36 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-08-10 20:48:36 (GMT)
commit8ea498c8569940b14f576eb0ae137c2e8824c304 (patch)
tree578aa007bbc16f9c31c4e3a21c88482f3b27f6ed /tools
parent99d522780c8b64790504e9a59cb3d4c9f08ca182 (diff)
parent6eb23dfcd8edffea4fee087ea2ec0b96d8449f2f (diff)
downloadhdf5-8ea498c8569940b14f576eb0ae137c2e8824c304.zip
hdf5-8ea498c8569940b14f576eb0ae137c2e8824c304.tar.gz
hdf5-8ea498c8569940b14f576eb0ae137c2e8824c304.tar.bz2
Merge pull request #1851 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit '6eb23dfcd8edffea4fee087ea2ec0b96d8449f2f': Fix parallel process Fix CMake MPI install error
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/CMakeLists.txt81
1 files changed, 40 insertions, 41 deletions
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt
index 8952a60..584dd92 100644
--- a/tools/h5diff/CMakeLists.txt
+++ b/tools/h5diff/CMakeLists.txt
@@ -44,6 +44,19 @@ if (H5_HAVE_PARALLEL)
set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff")
set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} ph5diff)
endif ()
+ if (BUILD_SHARED_LIBS)
+ add_executable (ph5diff-shared
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
+ ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
+ )
+ target_include_directories (ph5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (ph5diff-shared SHARED)
+ target_link_libraries (ph5diff-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ set_target_properties (ph5diff-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};ph5diff-shared")
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} ph5diff-shared)
+ endif ()
+endif ()
if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
@@ -55,39 +68,37 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
#add_test (NAME h5diffgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diffgentest>)
endif ()
+#-----------------------------------------------------------------------------
+# If plugin library tests can be tested
+#-----------------------------------------------------------------------------
+if (BUILD_SHARED_LIBS)
+ set (H5DIFF_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
+ set (H5DIFF_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5DIFF_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5DIFF_TOOL_PLUGIN_LIB_TARGET ${H5DIFF_TOOL_PLUGIN_LIB_CORENAME})
+
+ add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
+ target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+
+ # make plugins dir
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
#-----------------------------------------------------------------------------
- # If plugin library tests can be tested
+ # Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
- if (BUILD_SHARED_LIBS)
- set (H5DIFF_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
- set (H5DIFF_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5DIFF_TOOL_PLUGIN_LIB_CORENAME}")
- set (H5DIFF_TOOL_PLUGIN_LIB_TARGET ${H5DIFF_TOOL_PLUGIN_LIB_CORENAME})
-
- add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
- target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
- H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
-
- # make plugins dir
- file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
- #-----------------------------------------------------------------------------
- # Copy plugin library to a plugins folder
- #-----------------------------------------------------------------------------
- add_custom_command (
- TARGET ${H5DIFF_TOOL_PLUGIN_LIB_TARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different
- "$<TARGET_FILE:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
- )
- endif ()
-
- include (CMakeTests.cmake)
-
+ add_custom_command (
+ TARGET ${H5DIFF_TOOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
+ )
endif ()
+include (CMakeTests.cmake)
+
##############################################################################
##############################################################################
### I N S T A L L A T I O N ###
@@ -109,16 +120,4 @@ if (HDF5_EXPORTED_TARGETS)
${HDF5_EXPORTED_TARGETS}
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
)
-
- if (H5_HAVE_PARALLEL)
- #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications)
-
- install (
- TARGETS
- ph5diff
- EXPORT
- ${HDF5_EXPORTED_TARGETS}
- RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
- )
- endif ()
endif ()