diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-09-28 13:35:11 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-09-28 13:35:11 (GMT) |
commit | 90429e924dd207dc50f6e81d4b9e81acbf110e77 (patch) | |
tree | 38333fe5705c295c6c6bf8b9891a0081f19308df /fortran | |
parent | 0ae77e5f0c57df86c27fb39e58826d5243eacd0c (diff) | |
download | hdf5-90429e924dd207dc50f6e81d4b9e81acbf110e77.zip hdf5-90429e924dd207dc50f6e81d4b9e81acbf110e77.tar.gz hdf5-90429e924dd207dc50f6e81d4b9e81acbf110e77.tar.bz2 |
[svn-r21430] Add F2003 IF-ENDIF protection blocks around _F03 file processing
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 47 | ||||
-rw-r--r-- | fortran/test/CMakeLists.txt | 31 |
2 files changed, 51 insertions, 27 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 6ecfd37..47c221c 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -63,32 +63,31 @@ FOREACH (example ${examples}) ENDFOREACH (example ${examples}) -FOREACH (example ${F2003_examples}) - ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f03_ex_${example} - APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS +IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + FOREACH (example ${F2003_examples}) + ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) + TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "") + IF (WIN32 AND NOT CYGWIN) + SET_PROPERTY (TARGET f03_ex_${example} + APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS + ) + ENDIF (WIN32 AND NOT CYGWIN) + TARGET_LINK_LIBRARIES (f03_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f03_ex_${example} - ${HDF5_F90_LIB_TARGET} - ${HDF5_LIB_TARGET} - ) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - - IF (BUILD_TESTING) - ADD_TEST (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f03_ex_${example}") - ENDIF (BUILD_TESTING) - -ENDFOREACH (example ${F2003_examples}) + SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + IF (BUILD_TESTING) + ADD_TEST (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "f03_ex_${example}") + ENDIF (BUILD_TESTING) + ENDFOREACH (example ${F2003_examples}) +ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 90de6a9..e4cc94d 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -21,9 +21,9 @@ SET (SHARED_LINK_FLAGS " ") IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS - BUILD_HDF5_DLL - ) + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) IF (MSVC) SET (SHARED_LINK_FLAGS "/DLL") ENDIF (MSVC) @@ -99,6 +99,31 @@ SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>) +#-- Adding test for fortranlib_test_F03 +IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + ADD_EXECUTABLE (fortranlib_test_F03 + fortranlib_test_F03.f90 + tH5F.f90 + tH5E_F03.f90 + tH5L_F03.f90 + tH5P_F03.f90 + tH5T_F03.f90 + ) + TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) + TARGET_FORTRAN_WIN_PROPERTIES (fortranlib_test_F03 "") + TARGET_LINK_LIBRARIES (fortranlib_test_F03 + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (fortranlib_test_F03 "ws2_32.lib") + ENDIF (WIN32 AND MSVC) + SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) + + ADD_TEST (NAME fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>) +ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + #-- Adding test for fflush1 ADD_EXECUTABLE (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) |