diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-03-14 01:37:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 01:37:36 (GMT) |
commit | 9a5bde57bd216a08d6a66c1702fd87a0b559fada (patch) | |
tree | b88114eae044446cd8a7b5d6a0bcf2383e0fa2e4 /fortran | |
parent | 1e8ce8767a991f269eb5101fbee700db03b09398 (diff) | |
download | hdf5-9a5bde57bd216a08d6a66c1702fd87a0b559fada.zip hdf5-9a5bde57bd216a08d6a66c1702fd87a0b559fada.tar.gz hdf5-9a5bde57bd216a08d6a66c1702fd87a0b559fada.tar.bz2 |
Make sure that ONLY_SHARED_LIBS option is correctly set (#2546)
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 4 | ||||
-rw-r--r-- | fortran/src/CMakeLists.txt | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 610ee8c..14ed5fb 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 b763883..00d7ca5 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -61,7 +61,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 () @@ -80,7 +80,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} @@ -136,7 +136,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 @@ -156,7 +156,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_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" @@ -199,7 +199,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 @@ -233,7 +233,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} @@ -284,7 +284,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 @@ -316,7 +316,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}>" @@ -398,7 +398,7 @@ install ( COMPONENT fortheaders ) -if (NOT ONLY_SHARED_LIBS) +if (BUILD_STATIC_LIBS) install ( FILES ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h @@ -420,7 +420,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 @@ -514,7 +514,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 () @@ -549,7 +549,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) |