summaryrefslogtreecommitdiffstats
path: root/fortran/examples
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-08-31 20:15:13 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-08-31 20:15:13 (GMT)
commite65aa8c36566febd00da128e64cc90f3c8ffbc70 (patch)
tree1c52c1ccdf6b28b73702da3b49bad78f5414b33c /fortran/examples
parentb8d1216dcac1b773f9a7f757ee4dca67547dc082 (diff)
downloadhdf5-e65aa8c36566febd00da128e64cc90f3c8ffbc70.zip
hdf5-e65aa8c36566febd00da128e64cc90f3c8ffbc70.tar.gz
hdf5-e65aa8c36566febd00da128e64cc90f3c8ffbc70.tar.bz2
[svn-r19325] Added parallel build commands.
Corrected use/name of source folder aliases. Duplicated FindMPI.cmake so that non-c++ compiler is found first (recommemded commands did not work). Tested: local linux with mpich
Diffstat (limited to 'fortran/examples')
-rw-r--r--fortran/examples/CMakeLists.txt36
1 files changed, 34 insertions, 2 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index f8a453e..f1ed52f 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -1,14 +1,14 @@
cmake_minimum_required (VERSION 2.8)
+PROJECT (HDF5_F90_EXAMPLES C CXX Fortran)
# --------------------------------------------------------------------
# Notes: When creating examples they should be prefixed
# with "f90_ex_". This allows for easier filtering of the examples.
# --------------------------------------------------------------------
-PROJECT (HDF5_F90_EXAMPLES C CXX Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
-INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SOURCE_DIR}/src)
+INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src)
LINK_DIRECTORIES (
${CMAKE_Fortran_MODULE_DIRECTORY}
${HDF5_F90_BINARY_DIR}
@@ -66,3 +66,35 @@ FOREACH (example ${examples})
${HDF5_LIB_TARGET}
)
ENDFOREACH (example ${examples})
+
+IF (H5_HAVE_PARALLEL)
+ ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
+ H5_NAMING (f90_ex_ph5example)
+ IF (WIN32)
+ IF (BUILD_SHARED_LIBS)
+ IF (MSVC)
+ SET_TARGET_PROPERTIES (f90_ex_ph5example
+ PROPERTIES
+ COMPILE_FLAGS "/dll"
+ LINK_FLAGS "/SUBSYSTEM:CONSOLE"
+ )
+ ENDIF (MSVC)
+ ELSE (BUILD_SHARED_LIBS)
+ IF (MSVC)
+ SET_TARGET_PROPERTIES (f90_ex_ph5example
+ PROPERTIES
+ LINK_FLAGS "/NODEFAULTLIB:MSVCRT"
+ )
+ ENDIF (MSVC)
+ ENDIF (BUILD_SHARED_LIBS)
+ SET_PROPERTY (TARGET f90_ex_ph5example
+ APPEND PROPERTY COMPILE_DEFINITIONS
+ HDF5F90_WINDOWS
+ )
+ SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran)
+ ENDIF (WIN32)
+ TARGET_LINK_LIBRARIES (f90_ex_ph5example
+ ${HDF5_F90_LIB_TARGET}
+ ${HDF5_LIB_TARGET}
+ )
+ENDIF (H5_HAVE_PARALLEL)