diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-03-20 18:00:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-20 18:00:00 (GMT) |
commit | 1ffaa38174b0f784b7ed6a471f40bf0e749ceac3 (patch) | |
tree | 7862edd79409afc7806996f166aa6bb7cd2088e9 /fortran | |
parent | c01e27cd8ea443a6ddf68ca1052a491692e28ae9 (diff) | |
download | hdf5-1ffaa38174b0f784b7ed6a471f40bf0e749ceac3.zip hdf5-1ffaa38174b0f784b7ed6a471f40bf0e749ceac3.tar.gz hdf5-1ffaa38174b0f784b7ed6a471f40bf0e749ceac3.tar.bz2 |
Gather latest CMake changes from develop (#2609)
Add HDF5_SRC_INCLUDE_DIRS variable
cleanup cmake comments and documentation
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 12 | ||||
-rw-r--r-- | fortran/src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | fortran/src/H5config_f.inc.cmake | 2 | ||||
-rw-r--r-- | fortran/test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | fortran/test/CMakeTests.cmake | 7 | ||||
-rw-r--r-- | fortran/testpar/CMakeLists.txt | 4 |
6 files changed, 20 insertions, 15 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 14ed5fb..f5714d7 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -45,7 +45,7 @@ foreach (example ${examples}) target_include_directories (f90_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static" - "${HDF5_SRC_DIR}" + "${HDF5_SRC_INCLUDE_DIRS}" "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/static" @@ -60,7 +60,7 @@ foreach (example ${examples}) target_include_directories (f90_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" - "${HDF5_SRC_DIR}" + "${HDF5_SRC_INCLUDE_DIRS}" "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/shared" @@ -86,7 +86,7 @@ foreach (example ${F2003_examples}) target_include_directories (f03_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static" - "${HDF5_SRC_DIR}" + "${HDF5_SRC_INCLUDE_DIRS}" "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/static" @@ -101,7 +101,7 @@ foreach (example ${F2003_examples}) target_include_directories (f03_ex_${example} PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" - "${HDF5_SRC_DIR}" + "${HDF5_SRC_INCLUDE_DIRS}" "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/shared" @@ -127,7 +127,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (f90_ex_ph5example PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static" - "${HDF5_SRC_DIR}" + "${HDF5_SRC_INCLUDE_DIRS}" "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/static" @@ -148,7 +148,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (f90_ex_ph5example PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared" - "${HDF5_SRC_DIR}" + "${HDF5_SRC_INCLUDE_DIRS}" "${HDF5_SRC_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}" "${HDF5_F90_BINARY_DIR}/shared" diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index f204d3e..095daaa 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -71,7 +71,7 @@ add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -target_include_directories (H5match_types PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") +target_include_directories (H5match_types PRIVATE "${HDF5_SRC_BINARY_DIR};${HDF5_SRC_INCLUDE_DIRS};${HDF5_F90_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") add_custom_command (TARGET H5match_types POST_BUILD BYPRODUCTS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 @@ -159,7 +159,7 @@ endif () 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}>" + 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}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_options(${HDF5_F90_C_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -178,7 +178,7 @@ endif () if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS} ${f90CStub_CGEN_SHHDRS}) target_include_directories (${HDF5_F90_C_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_options(${HDF5_F90_C_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake index 565d6eb..9def051 100644 --- a/fortran/src/H5config_f.inc.cmake +++ b/fortran/src/H5config_f.inc.cmake @@ -11,7 +11,7 @@ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure -! Define if we have parallel support +! Define if there is parallel support #cmakedefine01 H5_HAVE_PARALLEL #if H5_HAVE_PARALLEL == 0 #undef H5_HAVE_PARALLEL diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 1df9edc..cdcfc65 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -45,7 +45,7 @@ if (NOT BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c t.h) set_source_files_properties (t.c PROPERTIES LANGUAGE C) target_include_directories (${HDF5_F90_C_TEST_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}>" + 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}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_options(${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -62,7 +62,7 @@ if (NOT BUILD_SHARED_LIBS) else () add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c t.h) target_include_directories (${HDF5_F90_C_TEST_LIBSH_TARGET} - PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) target_compile_options(${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index b27e550..18e9eda 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -150,3 +150,10 @@ add_test ( set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1 ) +add_test ( + NAME FORTRAN_flush1-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove flush.h5 +) +set_tests_properties (FORTRAN_flush1-clean-objects PROPERTIES + DEPENDS FORTRAN_fflush2 +) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 12489528..f2e9201 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ project (HDF5_FORTRAN_TESTPAR C Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)) +set (TESTPAR_INCLUDES ${MPI_Fortran_INCLUDE_DIRS} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) if (NOT BUILD_SHARED_LIBS) set (TESTPAR_INCLUDES ${TESTPAR_INCLUDES} ${CMAKE_Fortran_MODULE_DIRECTORY}/static) else () @@ -53,8 +53,6 @@ else () ) endif () -#set_property(TARGET parallel_test APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">) -#set_property(TARGET parallel_test APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>) if(MSVC) set_property(TARGET parallel_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() |