summaryrefslogtreecommitdiffstats
path: root/tools/lib/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/CMakeLists.txt')
-rw-r--r--tools/lib/CMakeLists.txt16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index 4c145a4..c8bc187 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 3.2.2)
+cmake_minimum_required (VERSION 3.10)
PROJECT (HDF5_TOOLS_LIB)
#-----------------------------------------------------------------------------
@@ -39,9 +39,12 @@ set (H5_TOOLS_LIB_HDRS
add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS})
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ")
-target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
+if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PRIVATE ${MPI_C_LIBRARIES})
+endif ()
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)
+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
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
@@ -52,9 +55,12 @@ set (install_targets ${HDF5_TOOLS_LIB_TARGET})
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS})
TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
+ target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PRIVATE ${MPI_C_LIBRARIES})
+ endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}")
- H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED ${HDF5_TOOLS_PACKAGE_SOVERSION})
+ H5_SET_LIB_OPTIONS (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} SHARED "TOOLS")
set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES
FOLDER libraries/tools
COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"