From 3b5163fa8170647d99bd00e180651cb7b103ed19 Mon Sep 17 00:00:00 2001
From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Sat, 29 May 2021 15:31:09 -0500
Subject: Hdf5 1 10 merge fortran cmake changes from dev (#696)

* HDFFV-10865 - merge from dev, HDFArray perf fix.

* Remove duplicate setting

* Whitespace changes after clang format

* Undo version 11 clang format changes

* Merge CMake changes from develop

* test testing script merge from develop

* Update supported platforms

* PR#3 merge from develop

* Merge gcc 10 diagnostics option from develop

* Merge #318 OSX changes from develop

* Merge small changes from develop

* Minor non-space formatting changes

* #386 copyright corrections for java folder

* Merges from develop

#358 patches from vtk
#361 fix header guard spelling

* Merge updates

#358 patches from vtk
#361 fix header guard spelling

* format fix

* Fix missing underscore and make H5public.h closer to dev

* Merges from develop

#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup

* format alignment

* Add missing test ref file

* Merge #380 from develop

* Finish java merges from develop

* Fix java issues with tests and javadoc

* Correct use of attribute access plist

* Remove debug code

* Remove unused variable

* Change file access to read only for java tests

* Split clang format operations.

* More javadoc comments

* Remove pre-split setting

* format source

* Change windows TS to use older VS.

* Mostly all javadoc fixes, one argument rename.

* synch file

* Merge of long double fix and compiler flags

* HDFFV-11229 merge changes from develop

* HDFFV-11229 correct test script

* HDFFV-11229 update autotools test script for two ref files

* HDFFV-11229 merge dev changes for long double display in tools

* Committing clang-format changes

* minor whitespace

* remove unneeded macro

* Committing clang-format changes

* Add "option" command for clang options

* Rework CMake add_custom to use the BYPRODUCTS argument

Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.

* Fortran target depends

* Remove incorrect source attribute

* Revert define removal

* printf specifiers and VS2015 min changes

* Committing clang-format changes

* Add time struct

* TRILAB-227 and tools debug merges from develop

* Merge various changes from dev

* Issue #669 remove version from pkgcfg filename

* remove version from h5cc script

* doxygen changes merged from develop

* Committing clang-format changes

* Merge CMake fortran ninja changes from dev

* Enable fortran to gcc yaml

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
---
 .github/workflows/main.yml     |  2 +-
 .github/workflows/pr-check.yml |  2 +-
 fortran/src/CMakeLists.txt     | 10 +++++-----
 fortran/test/CMakeLists.txt    |  4 ++--
 hl/fortran/src/CMakeLists.txt  |  4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 78e1115..ae429a2 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -36,7 +36,7 @@ jobs:
             os: ubuntu-latest
             build_type: "Release"
             cpp: ON
-            fortran: OFF
+            fortran: ON
             java: ON
             ts: OFF
             hl: ON
diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml
index b50bf59..0acaf2d 100644
--- a/.github/workflows/pr-check.yml
+++ b/.github/workflows/pr-check.yml
@@ -31,7 +31,7 @@ jobs:
             os: ubuntu-latest
             build_type: "Release"
             cpp: ON
-            fortran: OFF
+            fortran: ON
             java: ON
             ts: OFF
             hl: ON
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index fd11c39..cb83fd1 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -74,7 +74,7 @@ add_executable (H5match_types
 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}>")
 
 add_custom_command (TARGET H5match_types POST_BUILD
-    BYPRODUCTS H5f90i_gen.h H5fortran_types.F90
+    BYPRODUCTS ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90
     COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5match_types>
     WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
     DEPENDS H5match_types
@@ -82,7 +82,7 @@ add_custom_command (TARGET H5match_types POST_BUILD
 
 if (NOT ONLY_SHARED_LIBS)
   add_custom_command (TARGET H5match_types POST_BUILD
-      BYPRODUCTS H5f90i_gen.h H5fortran_types.F90
+      BYPRODUCTS ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90
       COMMAND    ${CMAKE_COMMAND}
       ARGS       -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h
       COMMAND    ${CMAKE_COMMAND}
@@ -95,7 +95,7 @@ if (NOT ONLY_SHARED_LIBS)
 endif ()
 if (BUILD_SHARED_LIBS)
   add_custom_command (TARGET H5match_types POST_BUILD
-      BYPRODUCTS H5f90i_gen.h H5fortran_types.F90
+      BYPRODUCTS ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5fortran_types.F90
       COMMAND    ${CMAKE_COMMAND}
       ARGS       -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/shared/H5f90i_gen.h
       COMMAND    ${CMAKE_COMMAND}
@@ -235,7 +235,7 @@ add_custom_command (TARGET H5_buildiface POST_BUILD
 )
 if (NOT ONLY_SHARED_LIBS)
   add_custom_command (TARGET H5_buildiface POST_BUILD
-      BYPRODUCTS H5_gen.F90
+      BYPRODUCTS ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
       COMMAND    ${CMAKE_COMMAND}
       ARGS       -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ${HDF5_F90_BINARY_DIR}/static/H5_gen.F90
       WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/static
@@ -250,7 +250,7 @@ endif ()
 
 if (BUILD_SHARED_LIBS)
   add_custom_command (TARGET H5_buildiface POST_BUILD
-      BYPRODUCTS H5_gen.F90
+      BYPRODUCTS ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
       COMMAND    ${CMAKE_COMMAND}
       ARGS       -E copy_if_different ${HDF5_F90_BINARY_DIR}/H5_gen.F90 ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90
       WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}/shared
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 0dea405..1df9edc 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -92,7 +92,7 @@ endif ()
 
 if (NOT BUILD_SHARED_LIBS)
   add_custom_command (TARGET H5_test_buildiface POST_BUILD
-      BYPRODUCTS tf_gen.F90
+      BYPRODUCTS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90
       COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_test_buildiface>
       WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static
       DEPENDS H5_test_buildiface
@@ -104,7 +104,7 @@ if (NOT BUILD_SHARED_LIBS)
   set_source_files_properties (${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 PROPERTIES GENERATED TRUE)
 else ()
   add_custom_command (TARGET H5_test_buildiface POST_BUILD
-      BYPRODUCTS tf_gen.F90
+      BYPRODUCTS ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared/tf_gen.F90
       COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5_test_buildiface>
       WORKING_DIRECTORY ${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared
       DEPENDS H5_test_buildiface
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index 6c97886..973299f 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -115,7 +115,7 @@ set (HDF5_HL_F90_F_BASE_SOURCES
 
 if (NOT ONLY_SHARED_LIBS)
   add_custom_command (TARGET H5HL_buildiface POST_BUILD
-      BYPRODUCTS $H5LTff_gen.F90 H5TBff_gen.F90
+      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>
       WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static
       DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
@@ -132,7 +132,7 @@ if (NOT ONLY_SHARED_LIBS)
 endif ()
 if (BUILD_SHARED_LIBS)
   add_custom_command (TARGET H5HL_buildiface POST_BUILD
-      BYPRODUCTS H5LTff_gen.F90 H5TBff_gen.F90
+      BYPRODUCTS ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
       COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
       WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared
       DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
-- 
cgit v0.12