summaryrefslogtreecommitdiffstats
path: root/hl/fortran
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
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')
-rw-r--r--hl/fortran/examples/CMakeLists.txt15
-rw-r--r--hl/fortran/src/CMakeLists.txt37
-rw-r--r--hl/fortran/test/CMakeLists.txt15
3 files changed, 24 insertions, 43 deletions
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index 265d8db..684b02a 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -9,8 +9,7 @@ set (examples
foreach (example ${examples})
add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90)
target_compile_options(hl_f90_ex_${example}
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
# set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
@@ -23,12 +22,10 @@ foreach (example ${examples})
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (hl_f90_ex_${example}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
target_link_libraries (hl_f90_ex_${example}
- PRIVATE
- ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
+ PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET}
)
set_target_properties (hl_f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
@@ -37,12 +34,10 @@ foreach (example ${examples})
)
else ()
target_include_directories (hl_f90_ex_${example}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
target_link_libraries (hl_f90_ex_${example}
- PRIVATE
- ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
+ PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}
)
set_target_properties (hl_f90_ex_${example} PROPERTIES
LINKER_LANGUAGE Fortran
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">
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index 269cefb..6b6ddf1 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -14,8 +14,7 @@ set (H5_TESTS
macro (ADD_H5_FORTRAN_EXE file)
add_executable (hl_f90_${file} ${file}.F90)
target_compile_options(hl_f90_${file}
- PRIVATE
- $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+ PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
)
# set_property(TARGET hl_f90_${file} APPEND PROPERTY
# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
@@ -28,12 +27,10 @@ macro (ADD_H5_FORTRAN_EXE file)
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (hl_f90_${file}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
target_link_libraries (hl_f90_${file}
- PRIVATE
- ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}
+ PRIVATE ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}
)
set_target_properties (hl_f90_${file} PROPERTIES
LINKER_LANGUAGE Fortran
@@ -42,12 +39,10 @@ macro (ADD_H5_FORTRAN_EXE file)
)
else ()
target_include_directories (hl_f90_${file}
- PRIVATE
- "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
+ PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src"
)
target_link_libraries (hl_f90_${file}
- PRIVATE
- ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}
+ PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}
)
set_target_properties (hl_f90_${file} PROPERTIES
LINKER_LANGUAGE Fortran