summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-03-13 21:24:49 (GMT)
committerGitHub <noreply@github.com>2023-03-13 21:24:49 (GMT)
commitcb679af19d170982f522f57beaf72888da324105 (patch)
treefbefdae6dafa450fe799841c1c881b813569fcf0
parent3d8dc012a4353336652479541388b8530accb11c (diff)
downloadhdf5-cb679af19d170982f522f57beaf72888da324105.zip
hdf5-cb679af19d170982f522f57beaf72888da324105.tar.gz
hdf5-cb679af19d170982f522f57beaf72888da324105.tar.bz2
Make sure that ONLY_SHARED_LIBS option is correctly set (#2544)
-rw-r--r--CMakeLists.txt28
-rw-r--r--c++/src/CMakeLists.txt8
-rw-r--r--fortran/examples/CMakeLists.txt4
-rw-r--r--fortran/src/CMakeLists.txt24
-rw-r--r--hl/c++/src/CMakeLists.txt8
-rw-r--r--hl/fortran/src/CMakeLists.txt18
-rw-r--r--hl/src/CMakeLists.txt8
-rw-r--r--hl/test/CMakeLists.txt2
-rw-r--r--hl/tools/gif2h5/CMakeLists.txt10
-rw-r--r--hl/tools/h5watch/CMakeLists.txt8
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--test/CMakeLists.txt4
-rw-r--r--test/CMakeTests.cmake2
-rw-r--r--tools/lib/CMakeLists.txt6
-rw-r--r--tools/libtest/CMakeLists.txt2
-rw-r--r--tools/src/h5copy/CMakeLists.txt4
-rw-r--r--tools/src/h5diff/CMakeLists.txt6
-rw-r--r--tools/src/h5dump/CMakeLists.txt4
-rw-r--r--tools/src/h5format_convert/CMakeLists.txt4
-rw-r--r--tools/src/h5import/CMakeLists.txt4
-rw-r--r--tools/src/h5jam/CMakeLists.txt4
-rw-r--r--tools/src/h5ls/CMakeLists.txt4
-rw-r--r--tools/src/h5perf/CMakeLists.txt4
-rw-r--r--tools/src/h5repack/CMakeLists.txt4
-rw-r--r--tools/src/h5stat/CMakeLists.txt4
-rw-r--r--tools/src/misc/CMakeLists.txt4
-rw-r--r--tools/test/h5copy/CMakeLists.txt2
-rw-r--r--tools/test/h5diff/CMakeLists.txt2
-rw-r--r--tools/test/h5dump/CMakeLists.txt2
-rw-r--r--tools/test/h5format_convert/CMakeLists.txt4
-rw-r--r--tools/test/h5import/CMakeLists.txt2
-rw-r--r--tools/test/h5jam/CMakeLists.txt6
-rw-r--r--tools/test/h5repack/CMakeLists.txt6
-rw-r--r--tools/test/h5stat/CMakeLists.txt2
-rw-r--r--tools/test/misc/CMakeLists.txt24
-rw-r--r--tools/test/misc/vds/CMakeLists.txt2
-rw-r--r--utils/tools/h5dwalk/CMakeLists.txt4
37 files changed, 117 insertions, 125 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 46ef959..ba0e51b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -456,28 +456,30 @@ endif ()
#-----------------------------------------------------------------------------
# Option to Build Shared and Static libs, default is both
#-----------------------------------------------------------------------------
+option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF)
+mark_as_advanced (ONLY_SHARED_LIBS)
option (BUILD_STATIC_LIBS "Build Static Libraries" ON)
set (H5_ENABLE_STATIC_LIB NO)
option (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
set (H5_ENABLE_SHARED_LIB NO)
-option (ONLY_SHARED_LIBS "Only Build Shared Libraries" OFF)
-mark_as_advanced (ONLY_SHARED_LIBS)
-if (BUILD_STATIC_LIBS)
- set (H5_ENABLE_STATIC_LIB YES)
-endif ()
-if (BUILD_SHARED_LIBS)
- set (H5_ENABLE_SHARED_LIB YES)
-endif ()
-
-# Force only shared libraries if all OFF
-if (NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS)
+# only shared libraries is true if user forces static OFF
+if (NOT BUILD_STATIC_LIBS)
set (ONLY_SHARED_LIBS ON CACHE BOOL "Only Build Shared Libraries" FORCE)
endif ()
+# only shared libraries is set ON by user then force settings
if (ONLY_SHARED_LIBS)
set (H5_ENABLE_STATIC_LIB NO)
- set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries")
+ set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
+ set (BUILD_STATIC_LIBS OFF CACHE BOOL "Build Static Libraries" FORCE)
+endif ()
+
+if (BUILD_STATIC_LIBS)
+ set (H5_ENABLE_STATIC_LIB YES)
+endif ()
+if (BUILD_SHARED_LIBS)
+ set (H5_ENABLE_SHARED_LIB YES)
endif ()
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -911,7 +913,7 @@ add_subdirectory (src)
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if ((ZLIB_FOUND AND ZLIB_USE_EXTERNAL) OR (SZIP_FOUND AND SZIP_USE_EXTERNAL))
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
add_dependencies (${HDF5_LIB_TARGET} ${LINK_COMP_LIBS})
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index 23c6f01..ab1baed 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -77,7 +77,7 @@ set (CPP_HDRS
${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS})
target_include_directories (${HDF5_CPP_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -125,7 +125,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIB_TARGET})
else ()
clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIBSH_TARGET})
@@ -151,7 +151,7 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} cpplibraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries)
endif ()
@@ -184,7 +184,7 @@ endif ()
set (_PKG_CONFIG_LIBS_PRIVATE)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${PKG_CONFIG_LIBNAME}")
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index 6f1b825..e7edf40 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -82,7 +82,7 @@ foreach (example ${F2003_examples})
if(MSVC)
set_property(TARGET f03_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
target_include_directories (f03_ex_${example}
PRIVATE
"${CMAKE_Fortran_MODULE_DIRECTORY}/static"
@@ -123,7 +123,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
if(MSVC)
set_property(TARGET f90_ex_ph5example PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
target_include_directories (f90_ex_ph5example
PRIVATE
"${CMAKE_Fortran_MODULE_DIRECTORY}/static"
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 35b47a5..c93e943 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -64,7 +64,7 @@ if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared")
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static")
set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
endif ()
@@ -83,7 +83,7 @@ add_custom_command (TARGET H5match_types POST_BUILD
DEPENDS H5match_types
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_custom_command (TARGET H5match_types POST_BUILD
BYPRODUCTS ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
COMMAND ${CMAKE_COMMAND}
@@ -139,7 +139,7 @@ set (f90CStub_C_HDRS
${HDF5_F90_SRC_SOURCE_DIR}/H5f90proto.h
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (f90CStub_CGEN_HDRS
# generated files
${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
@@ -159,7 +159,7 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS} ${f90CStub_CGEN_HDRS})
target_include_directories (${HDF5_F90_C_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -202,7 +202,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_F90_C_SRC_FORMAT
${HDF5_F90_C_LIB_TARGET}
${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
@@ -236,7 +236,7 @@ add_custom_command (TARGET H5_buildiface POST_BUILD
DEPENDS H5_buildiface ${f90_F_GEN_SOURCES}
COMMENT "Generating the H5_gen.F90 file"
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_custom_command (TARGET H5_buildiface POST_BUILD
BYPRODUCTS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
COMMAND ${CMAKE_COMMAND}
@@ -287,7 +287,7 @@ set (f90_F_BASE_SOURCES
${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.F90
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (f90_F_SOURCES
# generated file
${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
@@ -319,7 +319,7 @@ endif ()
#-----------------------------------------------------------------------------
# Add Main fortran library
#-----------------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_F90_LIB_TARGET} STATIC ${f90_F_SOURCES})
target_include_directories (${HDF5_F90_LIB_TARGET}
PRIVATE "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
@@ -401,7 +401,7 @@ install (
COMPONENT
fortheaders
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
install (
FILES
${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
@@ -423,7 +423,7 @@ else ()
)
endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (mod_files
${MOD_BUILD_DIR}/h5fortran_types.mod
${MOD_BUILD_DIR}/hdf5.mod
@@ -517,7 +517,7 @@ if (HDF5_EXPORTED_TARGETS)
INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries)
#INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries)
#INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries)
endif ()
@@ -552,7 +552,7 @@ endif ()
set (_PKG_CONFIG_LIBS_PRIVATE)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${PKG_CONFIG_LIBNAME}")
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 5e1db57..c6e43c0 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -8,7 +8,7 @@ project (HDF5_HL_CPP_SRC CXX)
set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp)
set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES} ${HDF5_HL_CPP_HDRS})
target_include_directories (${HDF5_HL_CPP_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -43,7 +43,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIB_TARGET})
else ()
clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIBSH_TARGET})
@@ -69,7 +69,7 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlcpplibraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries)
endif ()
@@ -102,7 +102,7 @@ endif ()
set (_PKG_CONFIG_LIBS_PRIVATE)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${PKG_CONFIG_LIBNAME}")
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index e999751..705a37a 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -37,7 +37,7 @@ if (BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/shared")
set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static")
set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
endif ()
@@ -56,7 +56,7 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C)
set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.h)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS})
target_include_directories (${HDF5_HL_F90_C_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -96,7 +96,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIB_TARGET})
else ()
clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIBSH_TARGET})
@@ -113,7 +113,7 @@ set (HDF5_HL_F90_F_BASE_SOURCES
${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.F90
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_custom_command (TARGET H5HL_buildiface POST_BUILD
BYPRODUCTS ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
@@ -148,7 +148,7 @@ if (BUILD_SHARED_LIBS)
)
endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (HDF5_HL_F90_F_SOURCES
${HDF5_HL_F90_F_BASE_SOURCES}
@@ -169,7 +169,7 @@ if (BUILD_SHARED_LIBS)
set_source_files_properties (${HDF5_HL_F90_F_SOURCES_SHARED} PROPERTIES LANGUAGE Fortran)
endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES})
target_include_directories (${HDF5_HL_F90_LIB_TARGET}
PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
@@ -236,7 +236,7 @@ endif ()
#-----------------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (mod_files
${MOD_BUILD_DIR}/h5ds.mod
${MOD_BUILD_DIR}/h5tb.mod
@@ -301,7 +301,7 @@ if (HDF5_EXPORTED_TARGETS)
INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries)
#INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries)
#INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries)
endif ()
@@ -336,7 +336,7 @@ endif ()
set (_PKG_CONFIG_LIBS_PRIVATE)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${PKG_CONFIG_LIBNAME}")
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index 2155f93..71fd6e6 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -40,7 +40,7 @@ set (HL_PRIVATE_HEADERS
${HDF5_HL_SRC_SOURCE_DIR}/H5LDprivate.h
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS} ${HL_PRIVATE_HEADERS})
target_include_directories (${HDF5_HL_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -75,7 +75,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIB_TARGET})
else ()
clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIBSH_TARGET})
@@ -101,7 +101,7 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hllibraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries)
endif ()
@@ -134,7 +134,7 @@ endif ()
set (_PKG_CONFIG_LIBS_PRIVATE)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${PKG_CONFIG_LIBNAME}")
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index 9674457..a5615c0 100644
--- a/hl/test/CMakeLists.txt
+++ b/hl/test/CMakeLists.txt
@@ -87,7 +87,7 @@ endif ()
# This executable is used to generate test files for the test_ds test.
# It should only be run during development when new test files are needed
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (hl_gen_test_ds gen_test_ds.c)
target_compile_options(hl_gen_test_ds PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (hl_gen_test_ds PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt
index 3a9c708..f3b1fef 100644
--- a/hl/tools/gif2h5/CMakeLists.txt
+++ b/hl/tools/gif2h5/CMakeLists.txt
@@ -14,7 +14,7 @@ set (GIF2H5_SOURCES
)
#-- Add gif2hdf5 program
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (gif2h5 ${GIF2H5_SOURCES})
target_compile_options(gif2h5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (gif2h5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
@@ -44,7 +44,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5)
else ()
clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5-shared)
@@ -56,7 +56,7 @@ set (hdf2gif_SOURCES
${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdf2gif.c
${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h52gif ${hdf2gif_SOURCES})
target_compile_options(h52gif PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (h52gif PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
@@ -86,7 +86,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif)
else ()
clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif-shared)
@@ -99,7 +99,7 @@ if (BUILD_TESTING AND HDF5_TEST_SERIAL)
# used in the CMake Build system as we rely on the test files that are
# shipped with HDF5 source archives
# --------------------------------------------------------------------
- if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+ if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c)
target_include_directories (hl_h52gifgentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (hl_h52gifgentest STATIC)
diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt
index fc4c3a0..1eb3618 100644
--- a/hl/tools/h5watch/CMakeLists.txt
+++ b/hl/tools/h5watch/CMakeLists.txt
@@ -9,7 +9,7 @@ set (H5WATCH_SOURCES
)
#-- Add h5watch program
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5watch ${H5WATCH_SOURCES})
target_compile_options(h5watch PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (h5watch PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
@@ -32,7 +32,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch)
else ()
clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch-shared)
@@ -47,7 +47,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
add_executable (extend_dset ${extend_dset_SOURCES})
target_compile_options(extend_dset PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (extend_dset PRIVATE "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (extend_dset STATIC)
target_link_libraries (extend_dset PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
else ()
@@ -66,7 +66,7 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL)
add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c)
target_compile_options(h5watchgentest PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5watchgentest STATIC)
target_link_libraries (h5watchgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5853672..e002e4f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1220,7 +1220,7 @@ endif ()
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_SRC_BINARY_DIR}/H5lib_settings.c)
add_custom_target (gen_${HDF5_LIB_TARGET} ALL
DEPENDS ${lib_prog_deps} ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_SRC_BINARY_DIR}/gen_SRCS.stamp2
@@ -1303,7 +1303,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_SRC_FORMAT ${HDF5_LIB_TARGET})
else ()
clang_format (HDF5_SRC_FORMAT ${HDF5_LIBSH_TARGET})
@@ -1333,7 +1333,7 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} libraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries)
endif ()
@@ -1375,7 +1375,7 @@ foreach (libs ${LINK_COMP_LIBS})
set (_PKG_CONFIG_LIBS_PRIVATE "${_PKG_CONFIG_LIBS_PRIVATE} -l${libs}")
endforeach ()
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
set (_PKG_CONFIG_LIBS "${_PKG_CONFIG_LIBS} -l${PKGCONFIG_LIBNAME}")
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a9412f0..da98f15 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -27,7 +27,7 @@ set (TEST_LIB_HEADERS
${HDF5_TEST_SOURCE_DIR}/swmr_common.h
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
target_include_directories (${HDF5_TEST_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -81,7 +81,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_TEST_SRC_FORMAT ${HDF5_TEST_LIB_TARGET})
else ()
clang_format (HDF5_TEST_SRC_FORMAT ${HDF5_TEST_LIBSH_TARGET})
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 5086194..fa38a76 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -925,7 +925,7 @@ endif ()
##############################################################################
##############################################################################
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
macro (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c)
target_include_directories (${genfile} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index 7d139ee..a831ed5 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -34,7 +34,7 @@ set (H5_TOOLS_LIB_HDRS
${HDF5_TOOLS_LIB_SOURCE_DIR}/io_timer.h
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_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_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -81,7 +81,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_TOOLS_SRC_FORMAT ${HDF5_TOOLS_LIB_TARGET})
else ()
clang_format (HDF5_TOOLS_SRC_FORMAT ${HDF5_TOOLS_LIBSH_TARGET})
@@ -101,7 +101,7 @@ if (HDF5_EXPORTED_TARGETS)
if (BUILD_SHARED_LIBS)
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries)
endif ()
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries)
endif ()
diff --git a/tools/libtest/CMakeLists.txt b/tools/libtest/CMakeLists.txt
index 1b0983b..f6d8912 100644
--- a/tools/libtest/CMakeLists.txt
+++ b/tools/libtest/CMakeLists.txt
@@ -7,7 +7,7 @@ project (HDF5_TOOLS_LIBTEST C)
add_executable (h5tools_test_utils ${HDF5_TOOLS_LIBTEST_SOURCE_DIR}/h5tools_test_utils.c)
target_compile_options(h5tools_test_utils PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories(h5tools_test_utils PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5tools_test_utils STATIC)
target_link_libraries (h5tools_test_utils PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
else ()
diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt
index 64acf7e..efd38cd 100644
--- a/tools/src/h5copy/CMakeLists.txt
+++ b/tools/src/h5copy/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5COPY C)
# --------------------------------------------------------------------
# Add the h5copy and test executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c)
target_include_directories (h5copy PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(h5copy PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -32,7 +32,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5COPY_SRC_FORMAT h5copy)
else ()
clang_format (HDF5_H5COPY_SRC_FORMAT h5copy-shared)
diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt
index 44921cb..f01d1aa 100644
--- a/tools/src/h5diff/CMakeLists.txt
+++ b/tools/src/h5diff/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5DIFF C)
# --------------------------------------------------------------------
# Add the h5diff executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5diff
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c
@@ -41,7 +41,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5DIFF_SRC_FORMAT h5diff)
else ()
clang_format (HDF5_H5DIFF_SRC_FORMAT h5diff-shared)
@@ -49,7 +49,7 @@ if (HDF5_ENABLE_FORMATTERS)
endif ()
if (H5_HAVE_PARALLEL)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
add_executable (ph5diff
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c
${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c
diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt
index df521a9..f382020 100644
--- a/tools/src/h5dump/CMakeLists.txt
+++ b/tools/src/h5dump/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5DUMP C)
# --------------------------------------------------------------------
# Add the h5dump executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5dump
${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c
${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c
@@ -50,7 +50,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5DUMP_SRC_FORMAT h5dump)
else ()
clang_format (HDF5_H5DUMP_SRC_FORMAT h5dump-shared)
diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt
index c4e412b..d1e2158 100644
--- a/tools/src/h5format_convert/CMakeLists.txt
+++ b/tools/src/h5format_convert/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5FC C)
# --------------------------------------------------------------------
# Add the h5format_convert executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c)
target_include_directories (h5format_convert PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(h5format_convert PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -31,7 +31,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5FORMAT_SRC_FORMAT h5format_convert)
else ()
clang_format (HDF5_H5FORMAT_SRC_FORMAT h5format_convert-shared)
diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt
index 472a894..b2337cd 100644
--- a/tools/src/h5import/CMakeLists.txt
+++ b/tools/src/h5import/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5IMPORT C)
# --------------------------------------------------------------------
# Add the h5import executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.h)
target_include_directories (h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5import STATIC)
@@ -32,7 +32,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5IMPORT_SRC_FORMAT h5import)
else ()
clang_format (HDF5_H5IMPORT_SRC_FORMAT h5import-shared)
diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt
index b037f80..8642d6f 100644
--- a/tools/src/h5jam/CMakeLists.txt
+++ b/tools/src/h5jam/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5JAM C)
# --------------------------------------------------------------------
# Add the h5jam executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c)
target_include_directories (h5jam PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5jam STATIC)
@@ -50,7 +50,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5JAM_SRC_FORMAT h5jam)
clang_format (HDF5_H5UNJAM_SRC_FORMAT h5unjam)
else ()
diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt
index 8805448..9499253 100644
--- a/tools/src/h5ls/CMakeLists.txt
+++ b/tools/src/h5ls/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5LS C)
#-----------------------------------------------------------------------------
# Add the h5ls executable
#-----------------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c)
target_include_directories (h5ls PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(h5ls PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -34,7 +34,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5LS_SRC_FORMAT h5ls)
else ()
clang_format (HDF5_H5LS_SRC_FORMAT h5ls-shared)
diff --git a/tools/src/h5perf/CMakeLists.txt b/tools/src/h5perf/CMakeLists.txt
index 6531ccd..6ff5200 100644
--- a/tools/src/h5perf/CMakeLists.txt
+++ b/tools/src/h5perf/CMakeLists.txt
@@ -10,7 +10,7 @@ set (h5perf_serial_SOURCES
)
add_executable (h5perf_serial ${h5perf_serial_SOURCES})
target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5perf_serial STATIC)
target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
@@ -36,7 +36,7 @@ if (H5_HAVE_PARALLEL)
)
add_executable (h5perf ${h5perf_SOURCES})
target_include_directories (h5perf PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5perf STATIC)
target_link_libraries (h5perf PRIVATE ${LINK_LIBS} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>")
else ()
diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt
index 637d24f..360fb0f 100644
--- a/tools/src/h5repack/CMakeLists.txt
+++ b/tools/src/h5repack/CMakeLists.txt
@@ -15,7 +15,7 @@ set (REPACK_COMMON_SOURCES
${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.h
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c)
target_include_directories (h5repack PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(h5repack PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -43,7 +43,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5REPACK_SRC_FORMAT h5repack)
else ()
clang_format (HDF5_H5REPACK_SRC_FORMAT h5repack-shared)
diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt
index 662f935..c0c0b32 100644
--- a/tools/src/h5stat/CMakeLists.txt
+++ b/tools/src/h5stat/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_SRC_H5STAT C)
# --------------------------------------------------------------------
# Add the h5stat executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c)
target_include_directories (h5stat PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(h5stat PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -32,7 +32,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5STAT_SRC_FORMAT h5stat)
else ()
clang_format (HDF5_H5STAT_SRC_FORMAT h5stat-shared)
diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt
index 054c888..d2b1f51 100644
--- a/tools/src/misc/CMakeLists.txt
+++ b/tools/src/misc/CMakeLists.txt
@@ -5,7 +5,7 @@ project (HDF5_TOOLS_SRC_MISC C)
# Add the misc executables
# --------------------------------------------------------------------
#-- Misc Executables
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c)
target_include_directories (h5debug PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(h5debug PRIVATE "${HDF5_CMAKE_C_FLAGS}")
@@ -108,7 +108,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5DEBUG_SRC_FORMAT h5debug)
clang_format (HDF5_H5REPART_SRC_FORMAT h5repart)
clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp)
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index e8b2df4..0fb6da4 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_H5COPY C)
# --------------------------------------------------------------------
# Add the h5copy test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
target_include_directories (h5copygentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5copygentest STATIC)
diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt
index aaf12d8..5f82e9b 100644
--- a/tools/test/h5diff/CMakeLists.txt
+++ b/tools/test/h5diff/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_H5DIFF C)
# --------------------------------------------------------------------
# Add the h5diff and test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
target_include_directories (h5diffgentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5diffgentest STATIC)
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt
index 4367fed..95f690f 100644
--- a/tools/test/h5dump/CMakeLists.txt
+++ b/tools/test/h5dump/CMakeLists.txt
@@ -40,7 +40,7 @@ endif ()
# --------------------------------------------------------------------
# Add the h5dump test executable
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c)
target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5dumpgentest STATIC)
diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt
index 4b81e52..8530093 100644
--- a/tools/test/h5format_convert/CMakeLists.txt
+++ b/tools/test/h5format_convert/CMakeLists.txt
@@ -6,7 +6,7 @@ project (HDF5_TOOLS_TEST_H5FC C)
# --------------------------------------------------------------------
add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c)
target_include_directories (h5fc_chk_idx PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5fc_chk_idx STATIC)
target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
@@ -22,7 +22,7 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TOOLS_TEST_H5FC_h5fc_chk_idx_FORMAT h5fc_chk_idx)
endif ()
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c)
target_include_directories (h5fc_gentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5fc_gentest STATIC)
diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt
index c019885..4413d06 100644
--- a/tools/test/h5import/CMakeLists.txt
+++ b/tools/test/h5import/CMakeLists.txt
@@ -6,7 +6,7 @@ project (HDF5_TOOLS_TEST_H5IMPORT C)
# --------------------------------------------------------------------
add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c)
target_include_directories (h5importtest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5importtest STATIC)
target_link_libraries (h5importtest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt
index 4edf54f..160ecdf 100644
--- a/tools/test/h5jam/CMakeLists.txt
+++ b/tools/test/h5jam/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_H5JAM C)
# --------------------------------------------------------------------
# Add the h5jam test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c)
target_include_directories (h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5jamgentest STATIC)
@@ -23,7 +23,7 @@ endif ()
add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c)
target_include_directories (getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (getub STATIC)
target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
@@ -34,7 +34,7 @@ set_target_properties (getub PROPERTIES FOLDER tools)
add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c)
target_include_directories (tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (tellub STATIC)
target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt
index 54a5f53..3e7c6c2 100644
--- a/tools/test/h5repack/CMakeLists.txt
+++ b/tools/test/h5repack/CMakeLists.txt
@@ -8,7 +8,7 @@ add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/
target_include_directories (testh5repack_detect_szip
PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC)
target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
else ()
@@ -31,7 +31,7 @@ add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK
target_include_directories (h5repacktest
PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_INCLUDE_DIRS};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5repacktest STATIC)
target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
else ()
@@ -97,7 +97,7 @@ endif ()
# --------------------------------------------------------------------
# Add the h5repack test executable
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5repackgentest ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repackgentest.c)
target_include_directories (h5repackgentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5repackgentest STATIC)
diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt
index 3883ff3..a2dca46 100644
--- a/tools/test/h5stat/CMakeLists.txt
+++ b/tools/test/h5stat/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_H5STAT C)
# --------------------------------------------------------------------
# Add the h5stat test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
target_include_directories (h5stat_gentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5stat_gentest STATIC)
diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt
index 6d01d99..a4032c8 100644
--- a/tools/test/misc/CMakeLists.txt
+++ b/tools/test/misc/CMakeLists.txt
@@ -4,16 +4,11 @@ project (HDF5_TOOLS_TEST_MISC C)
# --------------------------------------------------------------------
# Add the misc test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+if (HDF5_BUILD_GENERATORS AND BUILD_STATIC_LIBS)
add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c)
target_include_directories (h5repart_gentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT ONLY_SHARED_LIBS)
- TARGET_C_PROPERTIES (h5repart_gentest STATIC)
- target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
- else ()
- TARGET_C_PROPERTIES (h5repart_gentest SHARED)
- target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
- endif ()
+ TARGET_C_PROPERTIES (h5repart_gentest STATIC)
+ target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools)
#add_test (NAME h5repart_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_gentest>)
@@ -26,13 +21,8 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c)
target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_TEST_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT ONLY_SHARED_LIBS)
- TARGET_C_PROPERTIES (h5clear_gentest STATIC)
- target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
- else ()
- TARGET_C_PROPERTIES (h5clear_gentest SHARED)
- target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
- endif ()
+ TARGET_C_PROPERTIES (h5clear_gentest STATIC)
+ target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (h5clear_gentest PROPERTIES FOLDER tools)
#add_test (NAME H5CLEAR-h5clear_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear_gentest>)
@@ -49,7 +39,7 @@ endif ()
add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c)
target_include_directories (h5repart_test PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (h5repart_test STATIC)
target_link_libraries (h5repart_test PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
@@ -67,7 +57,7 @@ endif ()
add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c)
target_include_directories (clear_open_chk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (clear_open_chk STATIC)
target_link_libraries (clear_open_chk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt
index a459098..026df6f 100644
--- a/tools/test/misc/vds/CMakeLists.txt
+++ b/tools/test/misc/vds/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_TOOLS_TEST_MISC_VDS C)
macro (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c)
target_include_directories (${genfile} PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
TARGET_C_PROPERTIES (${genfile} STATIC)
target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
else ()
diff --git a/utils/tools/h5dwalk/CMakeLists.txt b/utils/tools/h5dwalk/CMakeLists.txt
index 8c8ed62..9e4eb6d 100644
--- a/utils/tools/h5dwalk/CMakeLists.txt
+++ b/utils/tools/h5dwalk/CMakeLists.txt
@@ -4,7 +4,7 @@ project (HDF5_UTILS_TOOLS_H5DWALK C)
# --------------------------------------------------------------------
# Add the h5dwalk and test executables
# --------------------------------------------------------------------
-if (NOT ONLY_SHARED_LIBS)
+if (BUILD_STATIC_LIBS)
add_executable (h5dwalk ${HDF5_UTILS_TOOLS_H5DWALK_SOURCE_DIR}/h5dwalk.c)
# add_custom_target(generate_demo ALL
# DEPENDS "${HDF5_TOOLS_DIR}/test/demo_destfiles.test"
@@ -35,7 +35,7 @@ endif ()
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
- if (NOT ONLY_SHARED_LIBS)
+ if (BUILD_STATIC_LIBS)
clang_format (HDF5_H5DWALK_SRC_FORMAT h5dwalk)
else ()
clang_format (HDF5_H5DWALK_SRC_FORMAT h5dwalk-shared)