summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-05-25 16:00:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-05-25 16:00:56 (GMT)
commitef292895e9817f7134da9d4a6c7c0c699e01ae9e (patch)
treee488dfbd24af16f0dfc6ffdf518059cfa775271f /CMakeLists.txt
parent9f5a4ed901da65a3b5a6b63f75c99a5fe72c6832 (diff)
downloadhdf5-ef292895e9817f7134da9d4a6c7c0c699e01ae9e.zip
hdf5-ef292895e9817f7134da9d4a6c7c0c699e01ae9e.tar.gz
hdf5-ef292895e9817f7134da9d4a6c7c0c699e01ae9e.tar.bz2
[svn-r18890] Update CMake fortran configure/build with changes from community.
- Add an install rule to copy compiled fortran module files - Only build the xlatefile utility if testing and tools are enabled - Don't do MPI HAVE_XXX checks until MPI_FOUND is true - Install needs H5version.h & H5overflow.h to be copied - Add debug information flags to debug compile and link lines for win32 Intel compiler
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 20 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52cd5fb..2efdfbe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -353,6 +353,14 @@ IF (HDF5_ENABLE_PARALLEL)
INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH})
IF (MPI_FOUND)
SET (H5_HAVE_PARALLEL 1)
+ # MPI checks, only do these if MPI_FOUND is true, otherwise they always fail
+ # and once set, they are cached as false and not regenerated
+ SET (CMAKE_REQUIRED_INCLUDES "${MPI_INCLUDE_PATH}/mpi.h" )
+ SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY}" )
+ CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE)
+ # Used by Fortran + MPI
+ CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
+ CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
ENDIF (MPI_FOUND)
ENDIF (HDF5_ENABLE_PARALLEL)
@@ -461,8 +469,10 @@ ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src)
#-----------------------------------------------------------------------------
# Build utility to copy and strip X lines of file
#-----------------------------------------------------------------------------
-SET (XLATE_UTILITY "xlatefile")
-ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_SOURCE_DIR}/Resources/xlatefile.c)
+IF (HDF5_BUILD_TOOLS AND BUILD_TESTING)
+ SET (XLATE_UTILITY "xlatefile")
+ ADD_EXECUTABLE(${XLATE_UTILITY} ${HDF5_SOURCE_DIR}/Resources/xlatefile.c)
+ENDIF (HDF5_BUILD_TOOLS AND BUILD_TESTING)
#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
@@ -559,6 +569,14 @@ INSTALL (
HDF5-config.cmake
)
+# The install rule below copies compiled module files to the install location
+# using a "code" rule. The code string should not be broken up, it must be on one line
+IF (HDF5_BUILD_FORTRAN)
+ INSTALL ( CODE
+ "EXECUTE_PROCESS (COMMAND \"${CMAKE_COMMAND}\" -E copy_directory \"${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}\" \"${CMAKE_INSTALL_PREFIX}/fortran\")"
+ )
+ENDIF (HDF5_BUILD_FORTRAN)
+
#-----------------------------------------------------------------------------
# Export all exported targets to the build tree for use by parent project
#-----------------------------------------------------------------------------