summaryrefslogtreecommitdiffstats
path: root/hl/fortran/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-04-05 15:50:08 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-04-05 15:50:08 (GMT)
commit57f5d00a43421e4d2847d55560e4015f28cf162f (patch)
treee4fd18aca4f73eeb3bc8ca4ca115150f2b91abd4 /hl/fortran/src
parent7a41367a130a615f06e5c35154abbdc621c7c6b7 (diff)
downloadhdf5-57f5d00a43421e4d2847d55560e4015f28cf162f.zip
hdf5-57f5d00a43421e4d2847d55560e4015f28cf162f.tar.gz
hdf5-57f5d00a43421e4d2847d55560e4015f28cf162f.tar.bz2
TRILAB-192 add c++ and fortran warnings build systems one file
Diffstat (limited to 'hl/fortran/src')
-rw-r--r--hl/fortran/src/CMakeLists.txt37
1 files changed, 14 insertions, 23 deletions
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index d4979ba..fa8f442 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -62,6 +62,8 @@ if (NOT ONLY_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
+ target_compile_options(${HDF5_HL_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}")
@@ -78,9 +80,8 @@ if (BUILD_SHARED_LIBS)
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- target_compile_definitions(${HDF5_LIBSH_TARGET}
- PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
- )
+ target_compile_options(${HDF5_HL_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}")
@@ -161,20 +162,15 @@ endif ()
if (NOT ONLY_SHARED_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}>"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
+ PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/static>"
)
target_compile_definitions(${HDF5_HL_F90_LIB_TARGET}
- PUBLIC
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ PUBLIC $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:HDF5F90_WINDOWS>
+ PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
target_link_libraries (${HDF5_HL_F90_LIB_TARGET}
- PUBLIC
- ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
+ PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}
)
# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
@@ -198,23 +194,18 @@ endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
target_include_directories (${HDF5_HL_F90_LIBSH_TARGET}
- PRIVATE
- "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
- INTERFACE
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
+ PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/shared>"
)
target_compile_definitions(${HDF5_HL_F90_LIBSH_TARGET}
- PUBLIC
- "H5_BUILT_AS_DYNAMIC_LIB"
+ PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
PRIVATE
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:BUILD_HDF5_HL_DLL;HDF5F90_WINDOWS>
$<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET}
- PUBLIC
- ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
- PRIVATE
- ${LINK_Fortran_LIBS}
+ PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
+ PRIVATE ${LINK_Fortran_LIBS}
)
# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">