summaryrefslogtreecommitdiffstats
path: root/tools/lib
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/lib
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/lib')
-rw-r--r--tools/lib/CMakeLists.txt38
1 files changed, 21 insertions, 17 deletions
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index 1596ea7..e9dfcaa 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -32,25 +32,27 @@ set (H5_TOOLS_LIB_HDRS
${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h
)
-add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
-target_include_directories(${HDF5_TOOLS_LIB_TARGET}
- PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
- INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
-#target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG>)
-TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC)
-target_link_libraries (${HDF5_TOOLS_LIB_TARGET}
- PUBLIC ${HDF5_LIB_TARGET}
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
-)
-set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
-H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0)
-set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools)
-set (install_targets ${HDF5_TOOLS_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
+ target_include_directories (${HDF5_TOOLS_LIB_TARGET}
+ PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ #target_compile_definitions(${HDF5_TOOLS_LIB_TARGET} PRIVATE H5DIFF_DEBUG>)
+ TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_TOOLS_LIB_TARGET}
+ PUBLIC ${HDF5_LIB_TARGET}
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>"
+ )
+ set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}")
+ H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools)
+ set (install_targets ${HDF5_TOOLS_LIB_TARGET})
+endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS})
- target_include_directories(${HDF5_TOOLS_LIBSH_TARGET}
+ target_include_directories (${HDF5_TOOLS_LIBSH_TARGET}
PRIVATE "${HDF5_TOOLS_LIB_SOURCE_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
@@ -82,7 +84,9 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
endif ()
- INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
+ if (NOT ONLY_SHARED_LIBS)
+ INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
+ endif ()
install (
TARGETS