summaryrefslogtreecommitdiffstats
path: root/tools/src/h5import
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-06-18 12:46:25 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-06-18 12:46:25 (GMT)
commite7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360 (patch)
tree18f277bcdb333d7091c598c39b70e4a2e3b50cd0 /tools/src/h5import
parentf73a190d2c2e2bfe80508599e0d76d62c358ae68 (diff)
downloadhdf5-e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360.zip
hdf5-e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360.tar.gz
hdf5-e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360.tar.bz2
HDFFV-10805 Add option to only build shared targets
HDFFV-10805 Add ONLY_SHARED_LIBS option and prefer shared over static HDFFV-10803 Update FindSZIP.cmake find module Remove unneeded modules and update java modules
Diffstat (limited to 'tools/src/h5import')
-rw-r--r--tools/src/h5import/CMakeLists.txt30
1 files changed, 22 insertions, 8 deletions
diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt
index 7b38420..dd7921d 100644
--- a/tools/src/h5import/CMakeLists.txt
+++ b/tools/src/h5import/CMakeLists.txt
@@ -4,15 +4,29 @@ project (HDF5_TOOLS_SRC_H5IMPORT C)
# --------------------------------------------------------------------
# Add the h5import executables
# --------------------------------------------------------------------
-add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c)
-target_include_directories(h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5import STATIC)
-target_link_libraries (h5import PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
-set_target_properties (h5import PROPERTIES FOLDER tools)
-set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import")
+if (NOT ONLY_SHARED_LIBS)
+ add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c)
+ target_include_directories (h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5import STATIC)
+ target_link_libraries (h5import PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
+ set_target_properties (h5import PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import")
-set (H5_DEP_EXECUTABLES h5import)
+ set (H5_DEP_EXECUTABLES h5import)
+endif ()
+
+if (BUILD_SHARED_LIBS)
+ add_executable (h5import-shared ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c)
+ target_include_directories (h5import-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5import-shared SHARED)
+ target_link_libraries (h5import-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ #set_target_properties (h5import-shared PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT)
+ set_target_properties (h5import-shared PROPERTIES FOLDER tools)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import-shared")
+
+ set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5import-shared)
+endif ()
##############################################################################
##############################################################################