summaryrefslogtreecommitdiffstats
path: root/hl
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 /hl
parent3d8dc012a4353336652479541388b8530accb11c (diff)
downloadhdf5-cb679af19d170982f522f57beaf72888da324105.zip
hdf5-cb679af19d170982f522f57beaf72888da324105.tar.gz
hdf5-cb679af19d170982f522f57beaf72888da324105.tar.bz2
Make sure that ONLY_SHARED_LIBS option is correctly set (#2544)
Diffstat (limited to 'hl')
-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
6 files changed, 27 insertions, 27 deletions
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 ()