diff options
Diffstat (limited to 'fortran/examples/CMakeLists.txt')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index fabc5cd..f2dc896 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -69,38 +69,36 @@ foreach (example ${examples}) endif (BUILD_SHARED_LIBS) endforeach (example ${examples}) -if (HDF5_ENABLE_F2003) - foreach (example ${F2003_examples}) - add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example} STATIC) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ") - target_link_libraries (f03_ex_${example} - ${HDF5_F90_LIB_TARGET} - ${HDF5_LIB_TARGET} +foreach (example ${F2003_examples}) + add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example} STATIC) + TARGET_FORTRAN_PROPERTIES (f03_ex_${example} STATIC " " " ") + target_link_libraries (f03_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f03_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran03 + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) + if (BUILD_SHARED_LIBS) + add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example}-shared SHARED) + TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") + target_link_libraries (f03_ex_${example}-shared + ${HDF5_F90_LIBSH_TARGET} + ${HDF5_LIBSH_TARGET} ) - target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) - set_target_properties (f03_ex_${example} PROPERTIES + target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_target_properties (f03_ex_${example}-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared ) - if (BUILD_SHARED_LIBS) - add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - TARGET_NAMING (f03_ex_${example}-shared SHARED) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") - target_link_libraries (f03_ex_${example}-shared - ${HDF5_F90_LIBSH_TARGET} - ${HDF5_LIBSH_TARGET} - ) - target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) - set_target_properties (f03_ex_${example}-shared PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/fortran03 - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared - ) - endif (BUILD_SHARED_LIBS) - endforeach (example ${F2003_examples}) -endif (HDF5_ENABLE_F2003) + endif (BUILD_SHARED_LIBS) +endforeach (example ${F2003_examples}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) |