diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-02-01 20:52:44 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-02-01 20:52:44 (GMT) |
commit | be955c5e792ff642c259c25999a86c6007682019 (patch) | |
tree | 23b6dda252e605008b4c83ce4452453f1b9842da | |
parent | c4142e07ddd04a97f1039900192bc18dca969dfc (diff) | |
parent | 3c169f947382da170c8589f6c00896a9c4ea8e6c (diff) | |
download | hdf5-be955c5e792ff642c259c25999a86c6007682019.zip hdf5-be955c5e792ff642c259c25999a86c6007682019.tar.gz hdf5-be955c5e792ff642c259c25999a86c6007682019.tar.bz2 |
Merge pull request #277 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '3c169f947382da170c8589f6c00896a9c4ea8e6c':
HDFFV-10123 Use generator expression
HDFFV-10123 fix shared name
HDFFV-10123 Add SHARED tools
HDFFV-10046 add shared versions of tools for plugin filters
HDFFV-10046 build a shared version of h5repack tool for plugins
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 7 | ||||
-rw-r--r-- | tools/src/h5copy/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tools/src/h5diff/CMakeLists.txt | 20 | ||||
-rw-r--r-- | tools/src/h5dump/CMakeLists.txt | 21 | ||||
-rw-r--r-- | tools/src/h5ls/CMakeLists.txt | 21 | ||||
-rw-r--r-- | tools/src/h5repack/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tools/src/h5stat/CMakeLists.txt | 17 |
8 files changed, 106 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f578e..5d34adf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,6 +427,12 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) ) if (WIN32) set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) + set (CMAKE_PDB_OUTPUT_DIRECTORY_ + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb files." + ) + set (CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_ + ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all pdb filess." + ) else () set (CMAKE_TEST_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 67a92d1..23fd6b2 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -43,10 +43,9 @@ endmacro () #------------------------------------------------------------------------------- macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_name ${libtarget} OUTPUT_NAME_RELWITHDEBINFO) install ( FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + $<TARGET_PDB_FILE:${libtarget}> DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo @@ -58,11 +57,9 @@ endmacro () #------------------------------------------------------------------------------- macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) if (WIN32 AND MSVC) - get_target_property (target_name ${progtarget} OUTPUT_NAME_RELWITHDEBINFO) - get_target_property (target_prefix ${progtarget} PREFIX) install ( FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb + $<TARGET_PDB_FILE:${progtarget}> DESTINATION ${targetdestination} CONFIGURATIONS RelWithDebInfo diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 698f5f8..fc8e4a2 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -18,6 +18,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy") set (H5_DEP_EXECUTABLES h5copy) +if (BUILD_SHARED_LIBS) + add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) + TARGET_NAMING (h5copy-shared SHARED) + TARGET_C_PROPERTIES (h5copy-shared SHARED " " " ") + target_link_libraries (h5copy-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5copy-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5copy-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5copy-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -28,11 +39,13 @@ set (H5_DEP_EXECUTABLES h5copy) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -#INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5copy-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) +endif () install ( TARGETS - h5copy + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 0f301a1..e75890c 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -21,6 +21,20 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff") set (H5_DEP_EXECUTABLES h5diff) +if (BUILD_SHARED_LIBS) + add_executable (h5diff-shared + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c + ) + TARGET_NAMING (h5diff-shared SHARED) + TARGET_C_PROPERTIES (h5diff-shared SHARED " " " ") + target_link_libraries (h5diff-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5diff-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5diff-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5diff-shared) +endif () + if (H5_HAVE_PARALLEL) add_executable (ph5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c @@ -43,11 +57,13 @@ endif () # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -#INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5diff-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) +endif () install ( TARGETS - h5diff + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index f680443..ee34aab 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -22,6 +22,21 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump") set (H5_DEP_EXECUTABLES h5dump) +if (BUILD_SHARED_LIBS) + add_executable (h5dump-shared + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ) + TARGET_NAMING (h5dump-shared SHARED) + TARGET_C_PROPERTIES (h5dump-shared SHARED " " " ") + target_link_libraries (h5dump-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5dump-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5dump-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5dump-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -32,11 +47,13 @@ set (H5_DEP_EXECUTABLES h5dump) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -#INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5dump-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) +endif () install ( TARGETS - h5dump + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index 1bc241a..b4e3633 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -16,9 +16,18 @@ target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls") -set (H5_DEP_EXECUTABLES - h5ls -) +set (H5_DEP_EXECUTABLES h5ls) + +if (BUILD_SHARED_LIBS) + add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) + TARGET_NAMING (h5ls-shared SHARED) + TARGET_C_PROPERTIES (h5ls-shared SHARED " " " ") + target_link_libraries (h5ls-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5ls-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5ls-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5ls-shared) +endif () ############################################################################## ############################################################################## @@ -30,11 +39,13 @@ set (H5_DEP_EXECUTABLES # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -#INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5ls-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) +endif () install ( TARGETS - h5ls + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 2d3459d..2d5c0d8 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -29,6 +29,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack") set (H5_DEP_EXECUTABLES h5repack) +if (BUILD_SHARED_LIBS) + add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) + TARGET_NAMING (h5repack-shared SHARED) + TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ") + target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5repack-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repack-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repack-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -39,11 +50,13 @@ set (H5_DEP_EXECUTABLES h5repack) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -#INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5repack-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) +endif () install ( TARGETS - h5repack + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 433736a..23b586e 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -18,6 +18,17 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat") set (H5_DEP_EXECUTABLES h5stat) +if (BUILD_SHARED_LIBS) + add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) + TARGET_NAMING (h5stat-shared SHARED) + TARGET_C_PROPERTIES (h5stat-shared SHARED " " " ") + target_link_libraries (h5stat-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (h5stat-shared PROPERTIES FOLDER tools) + set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5stat-shared") + + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5stat-shared) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### @@ -28,11 +39,13 @@ set (H5_DEP_EXECUTABLES h5stat) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -#INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) +if (BUILD_SHARED_LIBS) + INSTALL_PROGRAM_PDB (h5stat-shared ${HDF5_INSTALL_BIN_DIR} toolsapplications) +endif () install ( TARGETS - h5stat + ${H5_DEP_EXECUTABLES} EXPORT ${HDF5_EXPORTED_TARGETS} RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications |