summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-11-04 18:45:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-11-04 18:45:41 (GMT)
commit141383fb261f02c5fab510ffa9b2ff8be11f1cec (patch)
treeafe2beaebfb2aea6750925c64f051a8fa98169de
parent9417e52b8be3453b60f7717ab33d42d7d91784a2 (diff)
downloadhdf5-141383fb261f02c5fab510ffa9b2ff8be11f1cec.zip
hdf5-141383fb261f02c5fab510ffa9b2ff8be11f1cec.tar.gz
hdf5-141383fb261f02c5fab510ffa9b2ff8be11f1cec.tar.bz2
[svn-r21717] Update cmake configuration
Update cmake to generate source folders in VS Brought parallel changes from trunk Tested: local linux
-rw-r--r--CMakeLists.txt48
-rw-r--r--CTestConfig.cmake4
-rw-r--r--c++/examples/CMakeLists.txt1
-rw-r--r--c++/src/CMakeLists.txt2
-rw-r--r--c++/test/CMakeLists.txt1
-rw-r--r--config/cmake/CPack.cmake509
-rw-r--r--config/cmake/CTest.cmake21
-rw-r--r--config/cmake/ConfigureChecks.cmake4
-rw-r--r--config/cmake/FindMPI.cmake880
-rwxr-xr-xconfig/cmake/cacheinit.cmake6
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--fortran/CMakeLists.txt8
-rw-r--r--fortran/examples/CMakeLists.txt10
-rw-r--r--fortran/src/CMakeLists.txt13
-rw-r--r--fortran/test/CMakeLists.txt17
-rw-r--r--fortran/testpar/CMakeLists.txt2
-rw-r--r--hl/c++/examples/CMakeLists.txt2
-rw-r--r--hl/c++/src/CMakeLists.txt1
-rw-r--r--hl/c++/test/CMakeLists.txt1
-rw-r--r--hl/examples/CMakeLists.txt1
-rw-r--r--hl/fortran/examples/CMakeLists.txt1
-rw-r--r--hl/fortran/src/CMakeLists.txt2
-rw-r--r--hl/fortran/test/CMakeLists.txt4
-rw-r--r--hl/src/CMakeLists.txt1
-rw-r--r--hl/test/CMakeLists.txt2
-rw-r--r--hl/tools/CMakeLists.txt3
-rw-r--r--perform/CMakeLists.txt11
-rw-r--r--release_docs/CMake.txt11
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--test/CMakeLists.txt20
-rw-r--r--testpar/CMakeLists.txt7
-rw-r--r--tools/h5copy/CMakeLists.txt2
-rw-r--r--tools/h5diff/CMakeLists.txt5
-rw-r--r--tools/h5dump/CMakeLists.txt2
-rw-r--r--tools/h5import/CMakeLists.txt2
-rw-r--r--tools/h5jam/CMakeLists.txt5
-rw-r--r--tools/h5ls/CMakeLists.txt1
-rw-r--r--tools/h5repack/CMakeLists.txt3
-rw-r--r--tools/h5stat/CMakeLists.txt2
-rw-r--r--tools/lib/CMakeLists.txt1
-rw-r--r--tools/misc/CMakeLists.txt5
41 files changed, 763 insertions, 861 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb4450e..a0f2f2b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,6 +69,7 @@ PROJECT (HDF5 C CXX)
# # Add the sub project
# ADD_SUBDIRECTORY(Utilities/hdf5-1.8)
#-----------------------------------------------------------------------------
+
IF (BUILD_SHARED_LIBS)
SET (BUILD_NAME_EXT "SHARED")
ELSE (BUILD_SHARED_LIBS)
@@ -76,6 +77,21 @@ ELSE (BUILD_SHARED_LIBS)
ENDIF (BUILD_SHARED_LIBS)
#-----------------------------------------------------------------------------
+# Allow Visual Studio solution directories
+#-----------------------------------------------------------------------------
+# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
+# organization feature. Default to ON for non-Express users. Express users must
+# explicitly turn off this option to build HDF5 in the Express IDE...
+#
+OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
+MARK_AS_ADVANCED (HDF5_USE_FOLDERS)
+IF (HDF5_USE_FOLDERS)
+ SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON)
+ENDIF (HDF5_USE_FOLDERS)
+OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF)
+MARK_AS_ADVANCED (HDF5_NO_PACKAGES)
+
+#-----------------------------------------------------------------------------
# Set the core names of all the libraries
#-----------------------------------------------------------------------------
SET (HDF5_LIB_CORENAME "hdf5")
@@ -389,7 +405,7 @@ IF (CMAKE_COMPILER_IS_GNUCC)
IF (CMAKE_BUILD_TYPE MATCHES Debug)
SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common")
ELSE (CMAKE_BUILD_TYPE MATCHES Debug)
- SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
+ SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
ENDIF (CMAKE_COMPILER_IS_GNUCC)
@@ -452,28 +468,25 @@ SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH})
OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
IF (HDF5_ENABLE_PARALLEL)
INCLUDE (FindMPI)
- INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH})
- IF (MPI_FOUND)
+ INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH})
+ IF (MPI_C_FOUND)
SET (H5_HAVE_PARALLEL 1)
- # MPI checks, only do these if MPI_FOUND is true, otherwise they always fail
+ # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail
# and once set, they are cached as false and not regenerated
- SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY};${MPI_EXTRA_LIBRARY}" )
+ SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" )
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)
+ CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
+ CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
+ ENDIF (MPI_C_FOUND)
ENDIF (HDF5_ENABLE_PARALLEL)
# Parallel IO usage requires MPI to be Linked and Included
IF (H5_HAVE_PARALLEL)
- SET (LINK_LIBS ${LINK_LIBS} ${MPI_LIBRARY})
- IF (MPI_LINK_FLAGS)
- SET (CMAKE_EXE_LINKER_FLAGS ${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS})
- ENDIF (MPI_LINK_FLAGS)
- IF (MPI_EXTRA_LIBRARY)
- SET (LINK_LIBS ${LINK_LIBS} ${MPI_EXTRA_LIBRARY})
- ENDIF (MPI_EXTRA_LIBRARY)
+ SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES})
+ IF (MPI_C_LINK_FLAGS)
+ SET (CMAKE_EXE_LINKER_FLAGS ${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS})
+ ENDIF (MPI_C_LINK_FLAGS)
ENDIF (H5_HAVE_PARALLEL)
#-----------------------------------------------------------------------------
@@ -544,7 +557,7 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT)
SET (H5_HAVE_LIBZ 1)
MESSAGE (STATUS "Filter ZLIB is built")
ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
- MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5")
+ MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5")
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
ENDIF (ZLIB_FOUND)
ELSE (NOT H5_ZLIB_HEADER)
@@ -614,6 +627,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED)
ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND)
ENDIF (HDF5_PACKAGE_EXTLIBS)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
+
#-----------------------------------------------------------------------------
# Option to use threadsafe
# Note: Currently CMake only allows configuring of threadsafe on WINDOWS.
@@ -627,7 +641,7 @@ IF (WIN32 AND NOT CYGWIN)
ENDIF (HDF5_ENABLE_PARALLEL)
SET (H5_HAVE_THREADSAFE 1)
IF (H5_HAVE_IOEO)
- MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7)**** ")
+ MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ")
SET (H5_HAVE_WIN_THREADS 1)
ELSE (H5_HAVE_IOEO)
IF (NOT H5_HAVE_PTHREAD_H)
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
index 655f76d..a895aaa 100644
--- a/CTestConfig.cmake
+++ b/CTestConfig.cmake
@@ -23,4 +23,6 @@ SET (VALGRIND_COMMAND "/usr/bin/valgrind")
SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")
SET (CTEST_TESTING_TIMEOUT 3600)
-SET (DART_TESTING_TIMEOUT 3600)
+SET (DART_TESTING_TIMEOUT 3600)
+
+SET (CTEST_SUBMIT_RETRY_DELAY 20)
diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt
index ebeff57..133cbea 100644
--- a/c++/examples/CMakeLists.txt
+++ b/c++/examples/CMakeLists.txt
@@ -24,6 +24,7 @@ FOREACH (example ${examples})
ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp)
TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE})
TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp)
ENDFOREACH (example ${examples})
IF (BUILD_TESTING)
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index ffc2da3..71e016c 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -85,6 +85,7 @@ ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS})
TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
@@ -112,4 +113,3 @@ IF (HDF5_EXPORTED_TARGETS)
RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries
)
ENDIF (HDF5_EXPORTED_TARGETS)
-
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 84c3920..5632e0f 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -42,6 +42,7 @@ TARGET_LINK_LIBRARIES (cpp_testhdf5
${HDF5_LIB_TARGET}
${HDF5_TEST_LIB_TARGET}
)
+SET_TARGET_PROPERTIES (cpp_testhdf5 PROPERTIES FOLDER test/cpp)
ADD_CUSTOM_COMMAND (
TARGET cpp_testhdf5
diff --git a/config/cmake/CPack.cmake b/config/cmake/CPack.cmake
index 1f19067..2e6b23a 100644
--- a/config/cmake/CPack.cmake
+++ b/config/cmake/CPack.cmake
@@ -11,13 +11,7 @@
# For certain kinds of binary installers (including the graphical
# installers on Mac OS X and Windows), CPack generates installers that
# allow users to select individual application components to
-# install. The contents of each of the components are identified by
-# the COMPONENT argument of CMake's INSTALL command. These components
-# can be annotated with user-friendly names and descriptions,
-# inter-component dependencies, etc., and grouped in various ways to
-# customize the resulting installer. See the cpack_add_* commands,
-# described below, for more information about component-specific
-# installations.
+# install. See CPackComponent module for that.
#
# The CPACK_GENERATOR variable has different meanings in different
# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a
@@ -183,93 +177,6 @@
# automatically detected command (or specify its location if the
# auto-detection fails to find it.)
#
-# Installers built on Mac OS X using the Bundle generator use the
-# aforementioned DragNDrop variables, plus the following Bundle-specific
-# parameters:
-#
-# CPACK_BUNDLE_NAME - The name of the generated bundle. This
-# appears in the OSX finder as the bundle name. Required.
-#
-# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
-# as the Info.plist for the generated bundle. This assumes that
-# the caller has generated or specified their own Info.plist file.
-# Required.
-#
-# CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as
-# the icon for the generated bundle. This is the icon that appears
-# in the OSX finder for the bundle, and in the OSX dock when the
-# bundle is opened. Required.
-#
-# CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that
-# will be run whenever an end-user double-clicks the generated bundle
-# in the OSX Finder. Optional.
-#
-# The following variables are specific to the graphical installers built
-# on Windows using the Nullsoft Installation System.
-#
-# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
-# installing this project.
-#
-# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
-# to the end user by the NSIS installer is under this root dir. The full
-# directory presented to the end user is:
-# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
-#
-# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
-# install program.
-#
-# CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
-# uninstall program.
-#
-# CPACK_PACKAGE_ICON - A branding image that will be displayed inside
-# the installer.
-#
-# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
-# be added to the install Section.
-#
-# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
-# be added to the uninstall Section.
-#
-# CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
-# NSIS SetCompressor command.
-#
-# CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
-# will appear in the installer that will allow the user to choose
-# whether the program directory should be added to the system PATH
-# variable.
-#
-# CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
-# the Windows Add/Remove Program control panel
-#
-# CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
-# installer.
-#
-# CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
-# contains the installer icon.
-#
-# CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
-# installing your application.
-#
-# CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
-# information about your application.
-#
-# CPACK_NSIS_CONTACT - Contact information for questions and comments
-# about the installation process.
-#
-# CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
-# creating start menu shortcuts.
-#
-# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
-# uninstall start menu shortcuts.
-#
-# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
-# assumes that they are in 'bin' unless this variable is set.
-# For example, you would set this to 'exec' if your executables are
-# in an exec directory.
-#
-# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
-# to run on the finish page of the NSIS installer.
-#
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
#
@@ -308,196 +215,8 @@
#
# CPACK_INSTALL_COMMANDS - Extra commands to install components.
#
-# CPACK_INSTALL_DIRECTORIES - Extra directories to install.
-#
-# Component-specific installation allows users to select specific sets
-# of components to install during the install process. Installation
-# components are identified by the COMPONENT argument of CMake's
-# INSTALL commands, and should be further described by the following
-# CPack commands:
-#
-# cpack_add_component - Describes a CPack installation component
-# named by the COMPONENT argument to a CMake INSTALL command.
-#
-# cpack_add_component(compname
-# [DISPLAY_NAME name]
-# [DESCRIPTION description]
-# [HIDDEN | REQUIRED | DISABLED ]
-# [GROUP group]
-# [DEPENDS comp1 comp2 ... ]
-# [INSTALL_TYPES type1 type2 ... ]
-# [DOWNLOADED]
-# [ARCHIVE_FILE filename])
-#
-# The cmake_add_component command describes an installation
-# component, which the user can opt to install or remove as part of
-# the graphical installation process. compname is the name of the
-# component, as provided to the COMPONENT argument of one or more
-# CMake INSTALL commands.
-#
-# DISPLAY_NAME is the displayed name of the component, used in
-# graphical installers to display the component name. This value can
-# be any string.
-#
-# DESCRIPTION is an extended description of the component, used in
-# graphical installers to give the user additional information about
-# the component. Descriptions can span multiple lines using "\n" as
-# the line separator. Typically, these descriptions should be no
-# more than a few lines long.
-#
-# HIDDEN indicates that this component will be hidden in the
-# graphical installer, so that the user cannot directly change
-# whether it is installed or not.
-#
-# REQUIRED indicates that this component is required, and therefore
-# will always be installed. It will be visible in the graphical
-# installer, but it cannot be unselected. (Typically, required
-# components are shown greyed out).
-#
-# DISABLED indicates that this component should be disabled
-# (unselected) by default. The user is free to select this component
-# for installation, unless it is also HIDDEN.
-#
-# DEPENDS lists the components on which this component depends. If
-# this component is selected, then each of the components listed
-# must also be selected. The dependency information is encoded
-# within the installer itself, so that users cannot install
-# inconsitent sets of components.
-#
-# GROUP names the component group of which this component is a
-# part. If not provided, the component will be a standalone
-# component, not part of any component group. Component groups are
-# described with the cpack_add_component_group command, detailed
-# below.
-#
-# INSTALL_TYPES lists the installation types of which this component
-# is a part. When one of these installations types is selected, this
-# component will automatically be selected. Installation types are
-# described with the cpack_add_install_type command, detailed below.
-#
-# DOWNLOADED indicates that this component should be downloaded
-# on-the-fly by the installer, rather than packaged in with the
-# installer itself. For more information, see the cpack_configure_downloads
-# command.
-#
-# ARCHIVE_FILE provides a name for the archive file created by CPack
-# to be used for downloaded components. If not supplied, CPack will
-# create a file with some name based on CPACK_PACKAGE_FILE_NAME and
-# the name of the component. See cpack_configure_downloads for more
-# information.
-#
-# cpack_add_component_group - Describes a group of related CPack
-# installation components.
-#
-# cpack_add_component_group(groupname
-# [DISPLAY_NAME name]
-# [DESCRIPTION description]
-# [PARENT_GROUP parent]
-# [EXPANDED]
-# [BOLD_TITLE])
-#
-# The cpack_add_component_group describes a group of installation
-# components, which will be placed together within the listing of
-# options. Typically, component groups allow the user to
-# select/deselect all of the components within a single group via a
-# single group-level option. Use component groups to reduce the
-# complexity of installers with many options. groupname is an
-# arbitrary name used to identify the group in the GROUP argument of
-# the cpack_add_component command, which is used to place a
-# component in a group. The name of the group must not conflict with
-# the name of any component.
-#
-# DISPLAY_NAME is the displayed name of the component group, used in
-# graphical installers to display the component group name. This
-# value can be any string.
-#
-# DESCRIPTION is an extended description of the component group,
-# used in graphical installers to give the user additional
-# information about the components within that group. Descriptions
-# can span multiple lines using "\n" as the line
-# separator. Typically, these descriptions should be no more than a
-# few lines long.
-#
-# PARENT_GROUP, if supplied, names the parent group of this group.
-# Parent groups are used to establish a hierarchy of groups,
-# providing an arbitrary hierarchy of groups.
-#
-# EXPANDED indicates that, by default, the group should show up as
-# "expanded", so that the user immediately sees all of the
-# components within the group. Otherwise, the group will initially
-# show up as a single entry.
-#
-# BOLD_TITLE indicates that the group title should appear in bold,
-# to call the user's attention to the group.
-#
-# cpack_add_install_type - Add a new installation type containing a
-# set of predefined component selections to the graphical installer.
-#
-# cpack_add_install_type(typename
-# [DISPLAY_NAME name])
-#
-# The cpack_add_install_type command identifies a set of preselected
-# components that represents a common use case for an
-# application. For example, a "Developer" install type might include
-# an application along with its header and library files, while an
-# "End user" install type might just include the application's
-# executable. Each component identifies itself with one or more
-# install types via the INSTALL_TYPES argument to
-# cpack_add_component.
-#
-# DISPLAY_NAME is the displayed name of the install type, which will
-# typically show up in a drop-down box within a graphical
-# installer. This value can be any string.
-#
-# cpack_configure_downloads - Configure CPack to download selected
-# components on-the-fly as part of the installation process.
-#
-# cpack_configure_downloads(site
-# [UPLOAD_DIRECTORY dirname]
-# [ALL]
-# [ADD_REMOVE|NO_ADD_REMOVE])
-#
-# The cpack_configure_downloads command configures installation-time
-# downloads of selected components. For each downloadable component,
-# CPack will create an archive containing the contents of that
-# component, which should be uploaded to the given site. When the
-# user selects that component for installation, the installer will
-# download and extract the component in place. This feature is
-# useful for creating small installers that only download the
-# requested components, saving bandwidth. Additionally, the
-# installers are small enough that they will be installed as part of
-# the normal installation process, and the "Change" button in
-# Windows Add/Remove Programs control panel will allow one to add or
-# remove parts of the application after the original
-# installation. On Windows, the downloaded-components functionality
-# requires the ZipDLL plug-in for NSIS, available at:
-#
-# http://nsis.sourceforge.net/ZipDLL_plug-in
-#
-# On Mac OS X, installers that download components on-the-fly can
-# only be built and installed on system using Mac OS X 10.5 or
-# later.
-#
-# The site argument is a URL where the archives for downloadable
-# components will reside, e.g., http://www.cmake.org/files/2.6.1/installer/
-# All of the archives produced by CPack should be uploaded to that location.
-#
-# UPLOAD_DIRECTORY is the local directory where CPack will create the
-# various archives for each of the components. The contents of this
-# directory should be uploaded to a location accessible by the URL given
-# in the site argument. If omitted, CPack will use the directory
-# CPackUploads inside the CMake binary directory to store the generated
-# archives.
-#
-# The ALL flag indicates that all components be downloaded. Otherwise, only
-# those components explicitly marked as DOWNLOADED or that have a specified
-# ARCHIVE_FILE will be downloaded. Additionally, the ALL option implies
-# ADD_REMOVE (unless NO_ADD_REMOVE is specified).
-#
-# ADD_REMOVE indicates that CPack should install a copy of the installer
-# that can be called from Windows' Add/Remove Programs dialog (via the
-# "Modify" button) to change the set of installed components. NO_ADD_REMOVE
-# turns off this behavior. This option is ignored on Mac OS X.
+# CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
+#
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -512,6 +231,13 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Define this var in order to avoid (or warn) concerning multiple inclusion
+IF(CPack_CMake_INCLUDED)
+ MESSAGE(WARNING "CPack.cmake has already been included!!")
+ELSE(CPack_CMake_INCLUDED)
+ SET(CPack_CMake_INCLUDED 1)
+ENDIF(CPack_CMake_INCLUDED)
+
# Pick a configuration file
SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
@@ -522,214 +248,9 @@ IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
-# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
-MACRO(cpack_parse_arguments prefix arg_names option_names)
- SET(${prefix}_DEFAULT_ARGS)
- FOREACH(arg_name ${arg_names})
- SET(${prefix}_${arg_name})
- ENDFOREACH(arg_name)
- FOREACH(option ${option_names})
- SET(${prefix}_${option} FALSE)
- ENDFOREACH(option)
-
- SET(current_arg_name DEFAULT_ARGS)
- SET(current_arg_list)
- FOREACH(arg ${ARGN})
- SET(larg_names ${arg_names})
- LIST(FIND larg_names "${arg}" is_arg_name)
- IF (is_arg_name GREATER -1)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
- SET(current_arg_name ${arg})
- SET(current_arg_list)
- ELSE (is_arg_name GREATER -1)
- SET(loption_names ${option_names})
- LIST(FIND loption_names "${arg}" is_option)
- IF (is_option GREATER -1)
- SET(${prefix}_${arg} TRUE)
- ELSE (is_option GREATER -1)
- SET(current_arg_list ${current_arg_list} ${arg})
- ENDIF (is_option GREATER -1)
- ENDIF (is_arg_name GREATER -1)
- ENDFOREACH(arg)
- SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(cpack_parse_arguments)
-
-# Macro that appends a SET command for the given variable name (var)
-# to the macro named strvar, but only if the variable named "var"
-# has been defined. The string will eventually be appended to a CPack
-# configuration file.
-MACRO(cpack_append_variable_set_command var strvar)
- IF (DEFINED ${var})
- SET(${strvar} "${${strvar}}SET(${var}")
- FOREACH(APPENDVAL ${${var}})
- SET(${strvar} "${${strvar}} ${APPENDVAL}")
- ENDFOREACH(APPENDVAL)
- SET(${strvar} "${${strvar}})\n")
- ENDIF (DEFINED ${var})
-ENDMACRO(cpack_append_variable_set_command)
-
-# Macro that appends a SET command for the given variable name (var)
-# to the macro named strvar, but only if the variable named "var"
-# has been defined and is a string. The string will eventually be
-# appended to a CPack configuration file.
-MACRO(cpack_append_string_variable_set_command var strvar)
- IF (DEFINED ${var})
- LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
- IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
- ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- ENDIF (DEFINED ${var})
-ENDMACRO(cpack_append_string_variable_set_command)
-
-# Macro that appends a SET command for the given variable name (var)
-# to the macro named strvar, but only if the variable named "var"
-# has been set to true. The string will eventually be
-# appended to a CPack configuration file.
-MACRO(cpack_append_option_set_command var strvar)
- IF (${var})
- LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
- IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
- ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
- ENDIF (${var})
-ENDMACRO(cpack_append_option_set_command)
-
-# Macro that adds a component to the CPack installer
-MACRO(cpack_add_component compname)
- STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
- cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
- "DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
- "HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
- ${ARGN}
- )
-
- if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
- SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
- else ()
- SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
- endif ()
-
- IF(NOT CPACK_MONOLITHIC_INSTALL)
- # If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
- # value of CPACK_COMPONENTS_ALL in the configuration file. This will
- # take care of any components that have been added after the CPack
- # moduled was included.
- IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
- GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
- SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
- FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
- SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
- ENDFOREACH(COMP)
- SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
- ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
- ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
-
- cpack_append_string_variable_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
- CPACK_ADDCOMP_STR)
- cpack_append_string_variable_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DESCRIPTION
- CPACK_ADDCOMP_STR)
- cpack_append_variable_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_GROUP
- CPACK_ADDCOMP_STR)
- cpack_append_variable_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DEPENDS
- CPACK_ADDCOMP_STR)
- cpack_append_variable_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_INSTALL_TYPES
- CPACK_ADDCOMP_STR)
- cpack_append_string_variable_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_ARCHIVE_FILE
- CPACK_ADDCOMP_STR)
- cpack_append_option_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_HIDDEN
- CPACK_ADDCOMP_STR)
- cpack_append_option_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_REQUIRED
- CPACK_ADDCOMP_STR)
- cpack_append_option_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISABLED
- CPACK_ADDCOMP_STR)
- cpack_append_option_set_command(
- CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED
- CPACK_ADDCOMP_STR)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
-ENDMACRO(cpack_add_component)
-
-# Macro that adds a component group to the CPack installer
-MACRO(cpack_add_component_group grpname)
- STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
- cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
- "DISPLAY_NAME;DESCRIPTION"
- "EXPANDED;BOLD_TITLE"
- ${ARGN}
- )
-
- SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
- cpack_append_string_variable_set_command(
- CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
- CPACK_ADDGRP_STR)
- cpack_append_string_variable_set_command(
- CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DESCRIPTION
- CPACK_ADDGRP_STR)
- cpack_append_option_set_command(
- CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_EXPANDED
- CPACK_ADDGRP_STR)
- cpack_append_option_set_command(
- CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_BOLD_TITLE
- CPACK_ADDGRP_STR)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
-ENDMACRO(cpack_add_component_group)
-
-# Macro that adds an installation type to the CPack installer
-MACRO(cpack_add_install_type insttype)
- STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
- cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
- "DISPLAY_NAME"
- ""
- ${ARGN}
- )
-
- SET(CPACK_INSTTYPE_STR
- "\n# Configuration for installation type \"${insttype}\"\n")
- SET(CPACK_INSTTYPE_STR
- "${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
- cpack_append_string_variable_set_command(
- CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
- CPACK_INSTTYPE_STR)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
-ENDMACRO(cpack_add_install_type)
-
-MACRO(cpack_configure_downloads site)
- cpack_parse_arguments(CPACK_DOWNLOAD
- "UPLOAD_DIRECTORY"
- "ALL;ADD_REMOVE;NO_ADD_REMOVE"
- ${ARGN}
- )
-
- SET(CPACK_CONFIG_DL_STR
- "\n# Downloaded components configuration\n")
- SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
- SET(CPACK_DOWNLOAD_SITE ${site})
- cpack_append_string_variable_set_command(
- CPACK_DOWNLOAD_SITE
- CPACK_CONFIG_DL_STR)
- cpack_append_string_variable_set_command(
- CPACK_UPLOAD_DIRECTORY
- CPACK_CONFIG_DL_STR)
- cpack_append_option_set_command(
- CPACK_DOWNLOAD_ALL
- CPACK_CONFIG_DL_STR)
- IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
- SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
- ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
- SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
- cpack_append_option_set_command(
- CPACK_ADD_REMOVE
- CPACK_CONFIG_DL_STR)
- FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
-ENDMACRO(cpack_configure_downloads)
+# Backward compatibility
+# Include CPackComponent macros if it has not already been included before.
+include(CPackComponent)
# Macro for setting values if a user did not overwrite them
MACRO(cpack_set_if_not_set name value)
@@ -739,7 +260,7 @@ MACRO(cpack_set_if_not_set name value)
ENDMACRO(cpack_set_if_not_set)
# Macro to encode variables for the configuration file
-# find any varable that stars with CPACK and create a variable
+# find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
# used as an @ replacment in configure_file for the CPackConfig.
@@ -805,7 +326,7 @@ cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME
cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY
"${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
+ "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/")
cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
diff --git a/config/cmake/CTest.cmake b/config/cmake/CTest.cmake
index 518f61e..c69166c 100644
--- a/config/cmake/CTest.cmake
+++ b/config/cmake/CTest.cmake
@@ -63,7 +63,8 @@ OPTION(BUILD_TESTING "Build the testing tree." ON)
# function to turn generator name into a version string
# like vs7 vs71 vs8 vs9
FUNCTION(GET_VS_VERSION_STRING generator var)
- STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}")
+ STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
+ NUMBER "${generator}")
IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
SET(ver_string "vs71")
ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
@@ -260,15 +261,16 @@ IF(BUILD_TESTING)
ENDIF(CTEST_USE_LAUNCHERS)
MARK_AS_ADVANCED(
+ BZRCOMMAND
+ BZR_UPDATE_OPTIONS
COVERAGE_COMMAND
+ CTEST_SUBMIT_RETRY_DELAY
+ CTEST_SUBMIT_RETRY_COUNT
CVSCOMMAND
- SVNCOMMAND
- BZRCOMMAND
- HGCOMMAND
- GITCOMMAND
CVS_UPDATE_OPTIONS
- SVN_UPDATE_OPTIONS
- BZR_UPDATE_OPTIONS
+ DART_TESTING_TIMEOUT
+ GITCOMMAND
+ HGCOMMAND
MAKECOMMAND
MEMORYCHECK_COMMAND
MEMORYCHECK_SUPPRESSIONS_FILE
@@ -277,10 +279,9 @@ IF(BUILD_TESTING)
SLURM_SBATCH_COMMAND
SLURM_SRUN_COMMAND
SITE
- CTEST_SUBMIT_RETRY_DELAY
- CTEST_SUBMIT_RETRY_COUNT
+ SVNCOMMAND
+ SVN_UPDATE_OPTIONS
)
- # BUILDNAME
IF(NOT RUN_FROM_DART)
SET(RUN_FROM_CTEST_OR_DART 1)
INCLUDE(CTestTargets)
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index be03e52..5ad20a0 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -295,7 +295,6 @@ ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED)
SET (LINUX_LFS 0)
SET (HDF5_EXTRA_FLAGS)
-#IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.")
IF (NOT WINDOWS)
# Linux Specific flags
SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE)
@@ -303,7 +302,7 @@ IF (NOT WINDOWS)
IF (HDF5_ENABLE_LARGE_FILE)
SET (msg "Performing TEST_LFS_WORKS")
TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
- ${HDF5_BINARY_DIR}/CMake
+ ${CMAKE_BINARY_DIR}
${HDF5_RESOURCES_DIR}/HDF5Tests.c
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
OUTPUT_VARIABLE OUTPUT
@@ -331,7 +330,6 @@ IF (NOT WINDOWS)
ENDIF (HDF5_ENABLE_LARGE_FILE)
SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS})
ENDIF (NOT WINDOWS)
-#ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.")
ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS})
diff --git a/config/cmake/FindMPI.cmake b/config/cmake/FindMPI.cmake
index 555d2d5..b16c9c3 100644
--- a/config/cmake/FindMPI.cmake
+++ b/config/cmake/FindMPI.cmake
@@ -1,59 +1,70 @@
-# - Message Passing Interface (MPI) module.
-#
+# - Find a Message Passing Interface (MPI) implementation
# The Message Passing Interface (MPI) is a library used to write
-# high-performance parallel applications that use message passing, and
+# high-performance distributed-memory parallel applications, and
# is typically deployed on a cluster. MPI is a standard interface
# (defined by the MPI forum) for which many implementations are
-# available. All of these implementations have somewhat different
-# compilation approaches (different include paths, libraries to link
-# against, etc.), and this module tries to smooth out those differences.
-#
-# This module will set the following variables:
-# MPI_FOUND TRUE if we have found MPI
-# MPI_COMPILE_FLAGS Compilation flags for MPI programs
-# MPI_INCLUDE_PATH Include path(s) for MPI header
-# MPI_LINK_FLAGS Linking flags for MPI programs
-# MPI_LIBRARY First MPI library to link against (cached)
-# MPI_EXTRA_LIBRARY Extra MPI libraries to link against (cached)
-# MPI_LIBRARIES All libraries to link MPI programs against
-# MPIEXEC Executable for running MPI programs
-# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving it the
-# number of processors to run on
-# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly before the
-# executable to run.
-# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after all other flags.
+# available. All of them have somewhat different include paths,
+# libraries to link against, etc., and this module tries to smooth
+# out those differences.
#
-# This module will attempt to auto-detect these settings, first by
-# looking for a MPI compiler, which many MPI implementations provide
-# as a pass-through to the native compiler to simplify the compilation
-# of MPI programs. The MPI compiler is stored in the cache variable
-# MPI_COMPILER, and will attempt to look for commonly-named drivers
-# mpic++, mpicxx, mpiCC, or mpicc. If the compiler driver is found and
-# recognized, it will be used to set all of the module variables. To
-# skip this auto-detection, set MPI_LIBRARY and MPI_INCLUDE_PATH in
-# the CMake cache.
+# === Variables ===
#
-# If no compiler driver is found or the compiler driver is not
-# recognized, this module will then search for common include paths
-# and library names to try to detect MPI.
+# This module will set the following variables per language in your project,
+# where <lang> is one of C, CXX, or Fortran:
+# MPI_<lang>_FOUND TRUE if FindMPI found MPI flags for <lang>
+# MPI_<lang>_COMPILER MPI Compiler wrapper for <lang>
+# MPI_<lang>_COMPILE_FLAGS Compilation flags for MPI programs
+# MPI_<lang>_INCLUDE_PATH Include path(s) for MPI header
+# MPI_<lang>_LINK_FLAGS Linking flags for MPI programs
+# MPI_<lang>_LIBRARIES All libraries to link MPI programs against
+# Additionally, FindMPI sets the following variables for running MPI
+# programs from the command line:
+# MPIEXEC Executable for running MPI programs
+# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
+# it the number of processors to run on
+# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
+# before the executable to run.
+# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
+# === Usage ===
#
-# If CMake initially finds a different MPI than was intended, and you
-# want to use the MPI compiler auto-detection for a different MPI
-# implementation, set MPI_COMPILER to the MPI compiler driver you want
-# to use (e.g., mpicxx) and then set MPI_LIBRARY to the string
-# MPI_LIBRARY-NOTFOUND. When you re-configure, auto-detection of MPI
-# will run again with the newly-specified MPI_COMPILER.
+# To use this module, simply call FindMPI from a CMakeLists.txt file, or
+# run find_package(MPI), then run CMake. If you are happy with the auto-
+# detected configuration for your language, then you're done. If not, you
+# have two options:
+# 1. Set MPI_<lang>_COMPILER to the MPI wrapper (mpicc, etc.) of your
+# choice and reconfigure. FindMPI will attempt to determine all the
+# necessary variables using THAT compiler's compile and link flags.
+# 2. If this fails, or if your MPI implementation does not come with
+# a compiler wrapper, then set both MPI_<lang>_LIBRARIES and
+# MPI_<lang>_INCLUDE_PATH. You may also set any other variables
+# listed above, but these two are required. This will circumvent
+# autodetection entirely.
+# When configuration is successful, MPI_<lang>_COMPILER will be set to the
+# compiler wrapper for <lang>, if it was found. MPI_<lang>_FOUND and other
+# variables above will be set if any MPI implementation was found for <lang>,
+# regardless of whether a compiler was found.
#
-# When using MPIEXEC to execute MPI applications, you should typically
-# use all of the MPIEXEC flags as follows:
-# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS ${MPIEXEC_PREFLAGS} EXECUTABLE
-# ${MPIEXEC_POSTFLAGS} ARGS
+# When using MPIEXEC to execute MPI applications, you should typically use
+# all of the MPIEXEC flags as follows:
+# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
+# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
# where PROCS is the number of processors on which to execute the program,
# EXECUTABLE is the MPI program, and ARGS are the arguments to pass to the
# MPI program.
+#
+# === Backward Compatibility ===
+#
+# For backward compatibility with older versions of FindMPI, these
+# variables are set, but deprecated:
+# MPI_FOUND MPI_COMPILER MPI_LIBRARY
+# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
+# MPI_LINK_FLAGS MPI_LIBRARIES
+# In new projects, please use the MPI_<lang>_XXX equivalents.
#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
+# Copyright 2001-2011 Kitware, Inc.
+# Copyright 2010-2011 Todd Gamblin tgamblin@llnl.gov
+# Copyright 2001-2009 Dave Partyka
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -62,303 +73,556 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
+# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-# This module is maintained by David Partyka <dave.partyka@kitware.com>.
+# include this to handle the QUIETLY and REQUIRED arguments
+include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
+include(GetPrerequisites)
+
+#
+# This part detects MPI compilers, attempting to wade through the mess of compiler names in
+# a sensible way.
+#
+# The compilers are detected in this order:
+#
+# 1. Try to find the most generic availble MPI compiler, as this is usually set up by
+# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's
+# the right compiler.
+#
+# 2. If a generic mpicc is NOT found, then we attempt to find one that matches
+# CMAKE_<lang>_COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc
+# and company, but not mpiicc. This hopefully prevents toolchain mismatches.
+#
+# If you want to force a particular MPI compiler other than what we autodetect (e.g. if you
+# want to compile regular stuff with GNU and parallel stuff with Intel), you can always set
+# your favorite MPI_<lang>_COMPILER explicitly and this stuff will be ignored.
+#
+
+# Start out with the generic MPI compiler names, as these are most commonly used.
+set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r)
+set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++
+ mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r)
+set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r
+ mpif90 mpif90_r mpf90 mpf90_r
+ mpif77 mpif77_r mpf77 mpf77_r)
+
+# GNU compiler names
+set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r)
+set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r)
+set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r
+ mpig77 mpig77_r mpg77 mpg77_r)
+
+# Intel MPI compiler names
+set(_MPI_Intel_C_COMPILER_NAMES mpiicc)
+set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC)
+set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77)
+
+# PGI compiler names
+set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc)
+set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC)
+set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77)
+
+# XLC MPI Compiler names
+set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r)
+set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC
+ mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r)
+set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r
+ mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r
+ mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r
+ mpixlf mpixlf_r mpxlf mpxlf_r)
+
+# append vendor-specific compilers to the list if we either don't know the compiler id,
+# or if we know it matches the regular compiler.
+foreach (lang C CXX Fortran)
+ foreach (id GNU Intel PGI XL)
+ if (NOT CMAKE_${lang}_COMPILER_ID OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "${id}")
+ list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES})
+ endif()
+ unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here
+ endforeach()
+endforeach()
-# A set of directories to search through in addition to the standard system paths
-# that find_program will search through.
-# Microsoft HPC SDK is automatically added to the system path
-# Argonne National Labs MPICH2 sets a registry key that we can use.
-set(_MPI_PACKAGE_DIR
- mpi
- mpich
- openmpi
- lib/mpi
- lib/mpich
- lib/openmpi
- "MPICH/SDK"
- "Microsoft Compute Cluster Pack"
- )
+# Names to try for MPI exec
+set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun)
+# Grab the path to MPI from the registry if we're on windows.
set(_MPI_PREFIX_PATH)
if(WIN32)
list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..")
list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]")
+ list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/")
endif()
+# Build a list of prefixes to search for MPI.
foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH})
foreach(MpiPackageDir ${_MPI_PREFIX_PATH})
if(EXISTS ${SystemPrefixDir}/${MpiPackageDir})
list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}")
endif()
- endforeach(MpiPackageDir)
-endforeach(SystemPrefixDir)
+ endforeach()
+endforeach()
+
+
+#
+# interrogate_mpi_compiler(lang try_libs)
+#
+# Attempts to extract compiler and linker args from an MPI compiler. The arguments set
+# by this function are:
+#
+# MPI_<lang>_INCLUDE_PATH MPI_<lang>_LINK_FLAGS MPI_<lang>_FOUND
+# MPI_<lang>_COMPILE_FLAGS MPI_<lang>_LIBRARIES
+#
+# MPI_<lang>_COMPILER must be set beforehand to the absolute path to an MPI compiler for
+# <lang>. Additionally, MPI_<lang>_INCLUDE_PATH and MPI_<lang>_LIBRARIES may be set
+# to skip autodetection.
+#
+# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual
+# way. In general, this is not as effective as interrogating the compilers, as it
+# ignores language-specific flags and libraries. However, some MPI implementations
+# (Windows implementations) do not have compiler wrappers, so this approach must be used.
+#
+function (interrogate_mpi_compiler lang try_libs)
+ # MPI_${lang}_NO_INTERROGATE will be set to a compiler name when the *regular* compiler was
+ # discovered to be the MPI compiler. This happens on machines like the Cray XE6 that use
+ # modules to set cc, CC, and ftn to the MPI compilers. If the user force-sets another MPI
+ # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll
+ # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache.
+ string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate)
+
+ # If MPI is set already in the cache, don't bother with interrogating the compiler.
+ if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES)))
+ if (MPI_${lang}_COMPILER)
+ # Check whether the -showme:compile option works. This indicates that we have either OpenMPI
+ # or a newer version of LAM-MPI, and implies that -showme:link will also work.
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -showme:compile
+ OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE MPI_COMPILER_RETURN)
+
+ if (MPI_COMPILER_RETURN EQUAL 0)
+ # If we appear to have -showme:compile, then we should
+ # also have -showme:link. Try it.
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -showme:link
+ OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE MPI_COMPILER_RETURN)
+
+ if (MPI_COMPILER_RETURN EQUAL 0)
+ # We probably have -showme:incdirs and -showme:libdirs as well,
+ # so grab that while we're at it.
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs
+ OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE)
+
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs
+ OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE)
+
+ else()
+ # reset things here if something went wrong.
+ set(MPI_COMPILE_CMDLINE)
+ set(MPI_LINK_CMDLINE)
+ endif()
+ endif ()
+
+ # Older versions of LAM-MPI have "-showme". Try to find that.
+ if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -showme
+ OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE MPI_COMPILER_RETURN)
+ endif()
+
+ # MVAPICH uses -compile-info and -link-info. Try them.
+ if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -compile-info
+ OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE MPI_COMPILER_RETURN)
+
+ # If we have compile-info, also have link-info.
+ if (MPI_COMPILER_RETURN EQUAL 0)
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -link-info
+ OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE MPI_COMPILER_RETURN)
+ endif()
+
+ # make sure we got compile and link. Reset vars if something's wrong.
+ if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ set(MPI_COMPILE_CMDLINE)
+ set(MPI_LINK_CMDLINE)
+ endif()
+ endif()
+
+ # MPICH just uses "-show". Try it.
+ if (NOT MPI_COMPILER_RETURN EQUAL 0)
+ execute_process(
+ COMMAND ${MPI_${lang}_COMPILER} -show
+ OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE MPI_COMPILER_RETURN)
+ endif()
+
+ if (MPI_COMPILER_RETURN EQUAL 0)
+ # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE
+ # into MPI_LINK_CMDLINE, if we didn't find the link line.
+ if (NOT MPI_LINK_CMDLINE)
+ set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE})
+ endif()
+ else()
+ message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}")
+ set(MPI_COMPILE_CMDLINE)
+ set(MPI_LINK_CMDLINE)
+ endif()
+
+ # Here, we're done with the interrogation part, and we'll try to extract args we care
+ # about from what we learned from the compiler wrapper scripts.
+
+ # If interrogation came back with something, extract our variable from the MPI command line
+ if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE)
+ # Extract compile flags from the compile command line.
+ string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
+ set(MPI_COMPILE_FLAGS_WORK)
+
+ foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
+ if (MPI_COMPILE_FLAGS_WORK)
+ set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}")
+ else()
+ set(MPI_COMPILE_FLAGS_WORK ${FLAG})
+ endif()
+ endforeach()
+
+ # Extract include paths from compile command line
+ string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
+ foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
+ string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
+ string(REGEX REPLACE "//" "/" IPATH ${IPATH})
+ list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
+ endforeach()
+
+ # try using showme:incdirs if extracting didn't work.
+ if (NOT MPI_INCLUDE_PATH_WORK)
+ set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS})
+ separate_arguments(MPI_INCLUDE_PATH_WORK)
+ endif()
+
+ # If all else fails, just search for mpi.h in the normal include paths.
+ if (NOT MPI_INCLUDE_PATH_WORK)
+ set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+ find_path(MPI_HEADER_PATH mpi.h
+ HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
+ PATH_SUFFIXES include)
+ set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH})
+ endif()
+
+ # Extract linker paths from the link command line
+ string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
+ set(MPI_LINK_PATH)
+ foreach(LPATH ${MPI_ALL_LINK_PATHS})
+ string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
+ string(REGEX REPLACE "//" "/" LPATH ${LPATH})
+ list(APPEND MPI_LINK_PATH ${LPATH})
+ endforeach()
+
+ # try using showme:libdirs if extracting didn't work.
+ if (NOT MPI_LINK_PATH)
+ set(MPI_LINK_PATH ${MPI_LIBDIRS})
+ separate_arguments(MPI_LINK_PATH)
+ endif()
+
+ # Extract linker flags from the link command line
+ string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
+ set(MPI_LINK_FLAGS_WORK)
+ foreach(FLAG ${MPI_ALL_LINK_FLAGS})
+ if (MPI_LINK_FLAGS_WORK)
+ set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}")
+ else()
+ set(MPI_LINK_FLAGS_WORK ${FLAG})
+ endif()
+ endforeach()
+
+ # Extract the set of libraries to link against from the link command
+ # line
+ string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+
+ # Determine full path names for all of the libraries that one needs
+ # to link against in an MPI program
+ foreach(LIB ${MPI_LIBNAMES})
+ string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
+ # MPI_LIB is cached by find_library, but we don't want that. Clear it first.
+ set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+ find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH})
+
+ if (MPI_LIB)
+ list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
+ elseif (NOT MPI_FIND_QUIETLY)
+ message(WARNING "Unable to find MPI library ${LIB}")
+ endif()
+ endforeach()
+
+ # Sanity check MPI_LIBRARIES to make sure there are enough libraries
+ list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS)
+ list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED)
+ if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
+ set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND")
+ endif()
+ endif()
+
+ elseif(try_libs)
+ # If we didn't have an MPI compiler script to interrogate, attempt to find everything
+ # with plain old find functions. This is nasty because MPI implementations have LOTS of
+ # different library names, so this section isn't going to be very generic. We need to
+ # make sure it works for MS MPI, though, since there are no compiler wrappers for that.
+ find_path(MPI_HEADER_PATH mpi.h
+ HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
+ PATH_SUFFIXES include Inc)
+ set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH})
+
+ # Decide between 32-bit and 64-bit libraries for Microsoft's MPI
+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
+ set(MS_MPI_ARCH_DIR amd64)
+ else()
+ set(MS_MPI_ARCH_DIR i386)
+ endif()
+
+ set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+ find_library(MPI_LIB
+ NAMES mpi mpich mpich2 msmpi
+ HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
+ PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR})
+ set(MPI_LIBRARIES_WORK ${MPI_LIB})
+
+ # Right now, we only know about the extra libs for C++.
+ # We could add Fortran here (as there is usually libfmpich, etc.), but
+ # this really only has to work with MS MPI on Windows.
+ # Assume that other MPI's are covered by the compiler wrappers.
+ if (${lang} STREQUAL CXX)
+ set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+ find_library(MPI_LIB
+ NAMES mpi++ mpicxx cxx mpi_cxx
+ HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
+ PATH_SUFFIXES lib)
+ if (MPI_LIBRARIES_WORK AND MPI_LIB)
+ set(MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK} ${MPI_LIB})
+ endif()
+ endif()
+
+ if (${lang} STREQUAL Fortran)
+ set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+ find_library(MPI_LIB
+ NAMES fmpi fmpich fmpich2 fmpich2g
+ HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
+ PATH_SUFFIXES lib)
+ if (MPI_LIBRARIES_WORK AND MPI_LIB)
+ set(MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK} ${MPI_LIB})
+ endif()
+ endif()
+
+ if (NOT MPI_LIBRARIES_WORK)
+ set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND")
+ endif()
+ endif()
+
+ # If we found MPI, set up all of the appropriate cache entries
+ set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE)
+ set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE)
+ set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE)
+ set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE)
+ mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES)
+
+ # clear out our temporary lib/header detectionv variable here.
+ set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE)
+ set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE)
+ endif()
+
+ # finally set a found variable for each MPI language
+ if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES)
+ set(MPI_${lang}_FOUND TRUE PARENT_SCOPE)
+ else()
+ set(MPI_${lang}_FOUND FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
+
+# This function attempts to compile with the regular compiler, to see if MPI programs
+# work with it. This is a last ditch attempt after we've tried interrogating mpicc and
+# friends, and after we've tried to find generic libraries. Works on machines like
+# Cray XE6, where the modules environment changes what MPI version cc, CC, and ftn use.
+function(try_regular_compiler lang success)
+ set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
+ if (${lang} STREQUAL Fortran)
+ set(test_file ${scratch_directory}/cmake_mpi_test.f90)
+ file(WRITE ${test_file}
+ "program hello\n"
+ "include 'mpif.h'\n"
+ "integer ierror\n"
+ "call MPI_INIT(ierror)\n"
+ "call MPI_FINALIZE(ierror)\n"
+ "end\n")
+ else()
+ if (${lang} STREQUAL CXX)
+ set(test_file ${scratch_directory}/cmake_mpi_test.cpp)
+ else()
+ set(test_file ${scratch_directory}/cmake_mpi_test.c)
+ endif()
+ file(WRITE ${test_file}
+ "#include <mpi.h>\n"
+ "int main(int argc, char **argv) {\n"
+ " MPI_Init(&argc, &argv);\n"
+ " MPI_Finalize();\n"
+ "}\n")
+ endif()
+ try_compile(compiler_has_mpi ${scratch_directory} ${test_file})
+ if (compiler_has_mpi)
+ set(MPI_${lang}_NO_INTERROGATE ${CMAKE_${lang}_COMPILER} CACHE STRING "Whether to interrogate MPI ${lang} compiler" FORCE)
+ set(MPI_${lang}_COMPILER ${CMAKE_${lang}_COMPILER} CACHE STRING "MPI ${lang} compiler" FORCE)
+ set(MPI_${lang}_COMPILE_FLAGS "" CACHE STRING "MPI ${lang} compilation flags" FORCE)
+ set(MPI_${lang}_INCLUDE_PATH "" CACHE STRING "MPI ${lang} include path" FORCE)
+ set(MPI_${lang}_LINK_FLAGS "" CACHE STRING "MPI ${lang} linking flags" FORCE)
+ set(MPI_${lang}_LIBRARIES "" CACHE STRING "MPI ${lang} libraries to link against" FORCE)
+ endif()
+ set(${success} ${compiler_has_mpi} PARENT_SCOPE)
+ unset(compiler_has_mpi CACHE)
+endfunction()
+
+# End definitions, commence real work here.
# Most mpi distros have some form of mpiexec which gives us something we can reliably look for.
find_program(MPIEXEC
- NAMES mpiexec mpirun lamexec
+ NAMES ${_MPI_EXEC_NAMES}
PATHS ${_MPI_PREFIX_PATH}
PATH_SUFFIXES bin
- DOC "Executable for running MPI programs."
- )
+ DOC "Executable for running MPI programs.")
# call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin).
# This gives us a fairly reliable base directory to search for /bin /lib and /include from.
get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH)
get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH)
-# If there is an mpi compiler find it and interogate (farther below) it for the include
-# and lib dirs otherwise we will continue to search from ${_MPI_BASE_DIR}.
-find_program(MPI_COMPILER
- NAMES mpiCC mpicc mpic++ mpicxx
- HINTS "${_MPI_BASE_DIR}"
- PATH_SUFFIXES bin
- DOC "MPI compiler. Used only to detect MPI compilation flags.")
-mark_as_advanced(MPI_COMPILER)
-
set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.")
-set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.")
-set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.")
-set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.")
-mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS
- MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS)
-
-if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
- # Do nothing: we already have MPI_INCLUDE_PATH and MPI_LIBRARY in
- # the cache, and we don't want to override those settings.
-elseif (MPI_COMPILER)
- # Check whether the -showme:compile option works. This indicates
- # that we have either Open MPI or a newer version of LAM-MPI, and
- # implies that -showme:link will also work.
- # Note that Windows distros do not have an mpi compiler to interogate.
- exec_program(${MPI_COMPILER}
- ARGS -showme:compile
- OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
- RETURN_VALUE MPI_COMPILER_RETURN)
-
- if (MPI_COMPILER_RETURN EQUAL 0)
- # If we appear to have -showme:compile, then we should also have
- # -showme:link. Try it.
- exec_program(${MPI_COMPILER}
- ARGS -showme:link
- OUTPUT_VARIABLE MPI_LINK_CMDLINE
- RETURN_VALUE MPI_COMPILER_RETURN)
-
- # Note that we probably have -showme:incdirs and -showme:libdirs
- # as well.
- set(MPI_COMPILER_MAY_HAVE_INCLIBDIRS TRUE)
- endif (MPI_COMPILER_RETURN EQUAL 0)
-
- if (MPI_COMPILER_RETURN EQUAL 0)
- # Do nothing: we have our command lines now
- else (MPI_COMPILER_RETURN EQUAL 0)
- # Older versions of LAM-MPI have "-showme". Try it.
- exec_program(${MPI_COMPILER}
- ARGS -showme
- OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
- RETURN_VALUE MPI_COMPILER_RETURN)
- endif (MPI_COMPILER_RETURN EQUAL 0)
-
- if (MPI_COMPILER_RETURN EQUAL 0)
- # Do nothing: we have our command lines now
- else (MPI_COMPILER_RETURN EQUAL 0)
- # MPICH uses "-show". Try it.
- exec_program(${MPI_COMPILER}
- ARGS -show
- OUTPUT_VARIABLE MPI_COMPILE_CMDLINE
- RETURN_VALUE MPI_COMPILER_RETURN)
- endif (MPI_COMPILER_RETURN EQUAL 0)
-
- if (MPI_COMPILER_RETURN EQUAL 0)
- # We have our command lines, but we might need to copy
- # MPI_COMPILE_CMDLINE into MPI_LINK_CMDLINE, if the underlying
- if (NOT MPI_LINK_CMDLINE)
- SET(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE})
- endif (NOT MPI_LINK_CMDLINE)
- else (MPI_COMPILER_RETURN EQUAL 0)
- message(STATUS "Unable to determine MPI from MPI driver ${MPI_COMPILER}")
- endif (MPI_COMPILER_RETURN EQUAL 0)
-endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
-
-if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
- # Do nothing: we already have MPI_INCLUDE_PATH and MPI_LIBRARY in
- # the cache, and we don't want to override those settings.
-elseif (MPI_COMPILE_CMDLINE)
- # Extract compile flags from the compile command line.
- string(REGEX MATCHALL "-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}")
- set(MPI_COMPILE_FLAGS_WORK)
- foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
- if (MPI_COMPILE_FLAGS_WORK)
- set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}")
- else(MPI_COMPILE_FLAGS_WORK)
- set(MPI_COMPILE_FLAGS_WORK ${FLAG})
- endif(MPI_COMPILE_FLAGS_WORK)
- endforeach(FLAG)
-
- # Extract include paths from compile command line
- string(REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
- set(MPI_INCLUDE_PATH_WORK)
- foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
- string(REGEX REPLACE "^-I" "" IPATH ${IPATH})
- string(REGEX REPLACE "//" "/" IPATH ${IPATH})
- list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH})
- endforeach(IPATH)
-
- if (NOT MPI_INCLUDE_PATH_WORK)
- if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
- # The compile command line didn't have any include paths on it,
- # but we may have -showme:incdirs. Use it.
- exec_program(${MPI_COMPILER}
- ARGS -showme:incdirs
- OUTPUT_VARIABLE MPI_INCLUDE_PATH_WORK
- RETURN_VALUE MPI_COMPILER_RETURN)
- separate_arguments(MPI_INCLUDE_PATH_WORK)
- endif (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
- endif (NOT MPI_INCLUDE_PATH_WORK)
-
- if (NOT MPI_INCLUDE_PATH_WORK)
- # If all else fails, just search for mpi.h in the normal include
- # paths.
- find_path(MPI_INCLUDE_PATH mpi.h
- HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
- PATH_SUFFIXES include
- )
- set(MPI_INCLUDE_PATH_WORK ${MPI_INCLUDE_PATH})
- endif (NOT MPI_INCLUDE_PATH_WORK)
-
- # Extract linker paths from the link command line
- string(REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
- set(MPI_LINK_PATH)
- foreach(LPATH ${MPI_ALL_LINK_PATHS})
- string(REGEX REPLACE "^-L" "" LPATH ${LPATH})
- string(REGEX REPLACE "//" "/" LPATH ${LPATH})
- list(APPEND MPI_LINK_PATH ${LPATH})
- endforeach(LPATH)
-
- if (NOT MPI_LINK_PATH)
- if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
- # The compile command line didn't have any linking paths on it,
- # but we may have -showme:libdirs. Use it.
- exec_program(${MPI_COMPILER}
- ARGS -showme:libdirs
- OUTPUT_VARIABLE MPI_LINK_PATH
- RETURN_VALUE MPI_COMPILER_RETURN)
- separate_arguments(MPI_LINK_PATH)
- endif (MPI_COMPILER_MAY_HAVE_INCLIBDIRS)
- endif (NOT MPI_LINK_PATH)
-
- # Extract linker flags from the link command line
- string(REGEX MATCHALL "-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
- set(MPI_LINK_FLAGS_WORK)
- foreach(FLAG ${MPI_ALL_LINK_FLAGS})
- if (MPI_LINK_FLAGS_WORK)
- set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}")
- else(MPI_LINK_FLAGS_WORK)
- set(MPI_LINK_FLAGS_WORK ${FLAG})
- endif(MPI_LINK_FLAGS_WORK)
- endforeach(FLAG)
-
- # Extract the set of libraries to link against from the link command
- # line
- string(REGEX MATCHALL "-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
-
- # Determine full path names for all of the libraries that one needs
- # to link against in an MPI program
- set(MPI_LIBRARIES)
- foreach(LIB ${MPI_LIBNAMES})
- string(REGEX REPLACE "^-l" "" LIB ${LIB})
- set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
- find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH})
- if (MPI_LIB)
- list(APPEND MPI_LIBRARIES ${MPI_LIB})
- else (MPI_LIB)
- message(SEND_ERROR "Unable to find MPI library ${LIB}")
- endif (MPI_LIB)
- endforeach(LIB)
- set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE)
-
- # Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and
- # MPI_EXTRA_LIBRARY.
- list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
- list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED)
- if (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
- list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK)
- set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE)
- else (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
- set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE)
- endif (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
- if (MPI_NUMLIBS GREATER 1)
- set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES})
- list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0)
- set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE)
- else (MPI_NUMLIBS GREATER 1)
- set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE)
- endif (MPI_NUMLIBS GREATER 1)
-
- # Set up all of the appropriate cache entries
- set(MPI_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI compilation flags" FORCE)
- set(MPI_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI include path" FORCE)
- set(MPI_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI linking flags" FORCE)
-else (MPI_COMPILE_CMDLINE)
-# No MPI compiler to interogate so attempt to find everything with find functions.
- find_path(MPI_INCLUDE_PATH mpi.h
- HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
- PATH_SUFFIXES include
- )
-
- # Decide between 32-bit and 64-bit libraries for Microsoft's MPI
- if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
- set(MS_MPI_ARCH_DIR amd64)
- else()
- set(MS_MPI_ARCH_DIR i386)
+set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.")
+set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.")
+set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.")
+mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS)
+
+
+#=============================================================================
+# Backward compatibility input hacks. Propagate the FindMPI hints to C and
+# CXX if the respective new versions are not defined. Translate the old
+# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES.
+#
+# Once we find the new variables, we translate them back into their old
+# equivalents below.
+foreach (lang C CXX)
+ # Old input variables.
+ set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
+
+ # Set new vars based on their old equivalents, if the new versions are not already set.
+ foreach (var ${_MPI_OLD_INPUT_VARS})
+ if (NOT MPI_${lang}_${var} AND MPI_${var})
+ set(MPI_${lang}_${var} "${MPI_${var}}")
+ endif()
+ endforeach()
+
+ # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the
+ # new FindMPI. These need to be merged into MPI_<lang>_LIBRARIES
+ if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY))
+ set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
+ endif()
+endforeach()
+#=============================================================================
+
+
+# This loop finds the compilers and sends them off for interrogation.
+foreach (lang C CXX Fortran)
+ if (CMAKE_${lang}_COMPILER_WORKS)
+ # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
+ if (MPI_${lang}_COMPILER)
+ is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE)
+ if (NOT MPI_COMPILER_IS_EXECUTABLE)
+ # Get rid of our default list of names and just search for the name the user wants.
+ set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER})
+ set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
+ # If the user specifies a compiler, we don't want to try to search libraries either.
+ set(try_libs FALSE)
+ endif()
+ else()
+ set(try_libs TRUE)
+ endif()
+
+ find_program(MPI_${lang}_COMPILER
+ NAMES ${_MPI_${lang}_COMPILER_NAMES}
+ PATHS "${MPI_HOME}/bin" "$ENV{MPI_HOME}/bin" ${_MPI_PREFIX_PATH})
+ interrogate_mpi_compiler(${lang} ${try_libs})
+ mark_as_advanced(MPI_${lang}_COMPILER)
+
+ # last ditch try -- if nothing works so far, just try running the regular compiler and
+ # see if we can create an MPI executable.
+ set(regular_compiler_worked 0)
+ if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH)
+ try_regular_compiler(${lang} regular_compiler_worked)
+ endif()
+
+ if (regular_compiler_worked)
+ find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER)
+ else()
+ find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH)
+ endif()
endif()
+endforeach()
- find_library(MPI_LIBRARY
- NAMES mpi mpich msmpi
- HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
- PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}
- )
-
- find_library(MPI_EXTRA_LIBRARY
- NAMES mpi++
- HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
- PATH_SUFFIXES lib
- DOC "Extra MPI libraries to link against.")
-
- set(MPI_COMPILE_FLAGS "" CACHE STRING "MPI compilation flags")
- set(MPI_LINK_FLAGS "" CACHE STRING "MPI linking flags")
-endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
-
-# on BlueGene/L the MPI lib is named libmpich.rts.a, there also these additional libs are required
-if("${MPI_LIBRARY}" MATCHES "mpich.rts")
- set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
- set(MPI_LIBRARY ${MPI_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts)
-endif("${MPI_LIBRARY}" MATCHES "mpich.rts")
-
-# Set up extra variables to conform to
-if (MPI_EXTRA_LIBRARY)
- set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
-else (MPI_EXTRA_LIBRARY)
- set(MPI_LIBRARIES ${MPI_LIBRARY})
-endif (MPI_EXTRA_LIBRARY)
-
-if (MPI_INCLUDE_PATH AND MPI_LIBRARY)
- set(MPI_FOUND TRUE)
-else (MPI_INCLUDE_PATH AND MPI_LIBRARY)
+
+#=============================================================================
+# More backward compatibility stuff
+#
+# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found.
+# This mimics the behavior of the old language-oblivious FindMPI.
+set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES)
+if (MPI_CXX_FOUND)
+ foreach (var ${_MPI_OLD_VARS})
+ set(MPI_${var} ${MPI_CXX_${var}})
+ endforeach()
+elseif (MPI_C_FOUND)
+ foreach (var ${_MPI_OLD_VARS})
+ set(MPI_${var} ${MPI_C_${var}})
+ endforeach()
+else()
+ # Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND
set(MPI_FOUND FALSE)
-endif (MPI_INCLUDE_PATH AND MPI_LIBRARY)
+endif()
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments
-find_package_handle_standard_args(MPI DEFAULT_MSG MPI_LIBRARY MPI_INCLUDE_PATH)
+# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache.
+if (MPI_LIBRARIES)
+ list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK)
+ set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE)
+else()
+ set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE)
+endif()
-mark_as_advanced(MPI_INCLUDE_PATH MPI_COMPILE_FLAGS MPI_LINK_FLAGS MPI_LIBRARY
- MPI_EXTRA_LIBRARY)
+list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
+if (MPI_NUMLIBS GREATER 1)
+ set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES})
+ list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0)
+ set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE)
+else()
+ set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE)
+endif()
+#=============================================================================
-# unset to cleanup namespace
-unset(_MPI_PACKAGE_DIR)
+# unset these vars to cleanup namespace
+unset(_MPI_OLD_VARS)
unset(_MPI_PREFIX_PATH)
unset(_MPI_BASE_DIR)
+foreach (lang C CXX Fortran)
+ unset(_MPI_${lang}_COMPILER_NAMES)
+endforeach()
diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake
index 1aa4aa2..b49df17 100755
--- a/config/cmake/cacheinit.cmake
+++ b/config/cmake/cacheinit.cmake
@@ -32,18 +32,24 @@ SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API
SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
+SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE)
+
SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE)
SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE)
SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE)
+SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE)
+
SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE)
SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE)
SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE)
+SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE)
+
SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE)
SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 2bc8aac..951da39 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -26,12 +26,14 @@ FOREACH (example ${examples})
ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c)
TARGET_NAMING (${example} ${LIB_TYPE})
TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples)
ENDFOREACH (example ${examples})
IF (H5_HAVE_PARALLEL)
ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
TARGET_NAMING (ph5example ${LIB_TYPE})
TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples)
ENDIF (H5_HAVE_PARALLEL)
IF (BUILD_TESTING)
diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt
index 1a6329f..4796187 100644
--- a/fortran/CMakeLists.txt
+++ b/fortran/CMakeLists.txt
@@ -1,6 +1,10 @@
cmake_minimum_required (VERSION 2.8)
PROJECT (HDF5_F90 C CXX Fortran)
+IF (H5_HAVE_PARALLEL)
+ FIND_PACKAGE (MPI)
+ENDIF (H5_HAVE_PARALLEL)
+
#-----------------------------------------------------------------------------
# Traverse source subdirectory
#-----------------------------------------------------------------------------
@@ -18,7 +22,7 @@ ENDIF (HDF5_BUILD_EXAMPLES)
#-----------------------------------------------------------------------------
IF (BUILD_TESTING)
ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test)
- IF (H5_HAVE_PARALLEL)
+ IF (MPI_Fortran_FOUND)
ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar)
- ENDIF (H5_HAVE_PARALLEL)
+ ENDIF (MPI_Fortran_FOUND)
ENDIF (BUILD_TESTING)
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index 47c221c..8f858a3 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -52,6 +52,7 @@ FOREACH (example ${examples})
${HDF5_LIB_TARGET}
)
SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
+ SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES FOLDER examples/fortran)
IF (BUILD_TESTING)
ADD_TEST (NAME f90_ex_${example} COMMAND $<TARGET_FILE:f90_ex_${example}>)
@@ -78,6 +79,7 @@ IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003)
${HDF5_LIB_TARGET}
)
SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
+ SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES FOLDER examples/fortran03)
IF (BUILD_TESTING)
ADD_TEST (NAME f03_ex_${example} COMMAND $<TARGET_FILE:f03_ex_${example}>)
@@ -89,7 +91,7 @@ IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003)
ENDFOREACH (example ${F2003_examples})
ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003)
-IF (H5_HAVE_PARALLEL)
+IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90)
TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE})
TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "")
@@ -102,11 +104,13 @@ IF (H5_HAVE_PARALLEL)
TARGET_LINK_LIBRARIES (f90_ex_ph5example
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
+ ${MPI_Fortran_LIBRARIES}
)
SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran)
+ SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES FOLDER examples/fortran)
IF (BUILD_TESTING)
- ADD_TEST (NAME f90_ex_ph5example COMMAND $<TARGET_FILE:f90_ex_ph5example>)
+ ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:f90_ex_ph5example>)
ENDIF (BUILD_TESTING)
-ENDIF (H5_HAVE_PARALLEL)
+ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index bb927eb..ec4d7d1 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -115,9 +115,10 @@ ENDIF (H5_HAVE_PARALLEL)
SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C)
ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS})
-TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
+TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran)
#-----------------------------------------------------------------------------
# Fortran 2003 standard
@@ -179,18 +180,18 @@ SET (f90_F_SRCS
#-----------------------------------------------------------------------------
# Add H5FDMPIO if parallel
#-----------------------------------------------------------------------------
-IF (H5_HAVE_PARALLEL)
+IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
SET (f90_F_SRCS
${f90_F_SRCS}
${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90
${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90
)
-ELSE (H5_HAVE_PARALLEL)
+ELSE (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
SET (f90_F_SRCS
${f90_F_SRCS}
${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90
)
-ENDIF (H5_HAVE_PARALLEL)
+ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
#-----------------------------------------------------------------------------
# Add Main fortran library
@@ -219,8 +220,12 @@ ENDIF (WIN32 AND NOT CYGWIN)
TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET})
+IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
+ TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES})
+ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index e4cc94d..ed7c147 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -15,23 +15,18 @@ TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET}
${HDF5_TEST_LIB_TARGET}
)
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran)
ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90)
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
- )
+ SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL)
IF (MSVC)
SET (SHARED_LINK_FLAGS "/DLL")
ENDIF (MSVC)
ENDIF (BUILD_SHARED_LIBS)
- SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET}
- APPEND PROPERTY COMPILE_DEFINITIONS
- HDF5F90_WINDOWS
- )
+ SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS)
ENDIF (WIN32 AND NOT CYGWIN)
TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${SHARED_LINK_FLAGS})
SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
@@ -41,6 +36,7 @@ TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET}
${HDF5_LIB_TARGET}
)
H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran)
#-----------------------------------------------------------------------------
# Add Tests
@@ -74,6 +70,7 @@ IF (WIN32 AND MSVC)
TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib")
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES FOLDER test/fortran)
ADD_TEST (NAME testhdf5_fortran COMMAND $<TARGET_FILE:testhdf5_fortran>)
@@ -96,6 +93,7 @@ IF (WIN32 AND MSVC)
TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib")
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran)
ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $<TARGET_FILE:testhdf5_fortran_1_8>)
@@ -120,6 +118,7 @@ IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003)
TARGET_LINK_LIBRARIES (fortranlib_test_F03 "ws2_32.lib")
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran)
+ SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES FOLDER test/fortran)
ADD_TEST (NAME fortranlib_test_F03 COMMAND $<TARGET_FILE:fortranlib_test_F03>)
ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003)
@@ -137,6 +136,7 @@ IF (WIN32 AND MSVC)
TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib")
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (fflush1 PROPERTIES FOLDER test/fortran)
ADD_TEST (NAME fflush1 COMMAND $<TARGET_FILE:fflush1>)
@@ -153,6 +153,7 @@ IF (WIN32 AND MSVC)
TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib")
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (fflush2 PROPERTIES FOLDER test/fortran)
ADD_TEST (NAME fflush2 COMMAND $<TARGET_FILE:fflush2>)
SET_TESTS_PROPERTIES(fflush2 PROPERTIES DEPENDS fflush1)
diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt
index c71f679..ef2aa4e 100644
--- a/fortran/testpar/CMakeLists.txt
+++ b/fortran/testpar/CMakeLists.txt
@@ -22,10 +22,12 @@ TARGET_LINK_LIBRARIES (parallel_test
${HDF5_F90_TEST_LIB_TARGET}
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
+ ${MPI_Fortran_LIBRARIES}
)
IF (WIN32 AND MSVC)
TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib")
ENDIF (WIN32 AND MSVC)
SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (parallel_test PROPERTIES FOLDER test/fortran)
ADD_TEST (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:parallel_test>)
diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt
index f396523..d06f58f 100644
--- a/hl/c++/examples/CMakeLists.txt
+++ b/hl/c++/examples/CMakeLists.txt
@@ -18,6 +18,7 @@ TARGET_LINK_LIBRARIES (
${HDF5_HL_LIB_TARGET}
${HDF5_LIB_TARGET}
)
+SET_TARGET_PROPERTIES (ptExampleFL PROPERTIES FOLDER examples/hl/cpp)
ADD_EXECUTABLE (ptExampleVL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleVL.cpp)
TARGET_NAMING (ptExampleVL ${LIB_TYPE})
@@ -27,6 +28,7 @@ TARGET_LINK_LIBRARIES (
${HDF5_HL_LIB_TARGET}
${HDF5_LIB_TARGET}
)
+SET_TARGET_PROPERTIES (ptExampleVL PROPERTIES FOLDER examples/hl/cpp)
IF (BUILD_TESTING)
ADD_TEST (NAME cpp_hl_ex_ptExampleFL COMMAND $<TARGET_FILE:ptExampleFL>)
diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
index 1e765e9..cf9742a 100644
--- a/hl/c++/src/CMakeLists.txt
+++ b/hl/c++/src/CMakeLists.txt
@@ -18,6 +18,7 @@ TARGET_LINK_LIBRARIES (
)
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt
index 7fc3418..02357cf 100644
--- a/hl/c++/test/CMakeLists.txt
+++ b/hl/c++/test/CMakeLists.txt
@@ -26,6 +26,7 @@ IF (BUILD_TESTING)
${HDF5_HL_LIB_TARGET}
${HDF5_HL_CPP_LIB_TARGET}
)
+ SET_TARGET_PROPERTIES (hl_ptableTest PROPERTIES FOLDER test/hl/cpp)
ADD_TEST (NAME hl_ptableTest COMMAND $<TARGET_FILE:hl_ptableTest>)
ENDIF (BUILD_TESTING)
diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt
index f60ae9e..6e4f589 100644
--- a/hl/examples/CMakeLists.txt
+++ b/hl/examples/CMakeLists.txt
@@ -45,6 +45,7 @@ FOREACH (example ${examples})
ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c)
TARGET_NAMING (hl_ex_${example} ${LIB_TYPE})
TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl)
IF (BUILD_TESTING)
ADD_TEST (NAME hl_ex_${example} COMMAND $<TARGET_FILE:hl_ex_${example}>)
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index 7b97bd3..318b122 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -25,6 +25,7 @@ FOREACH (example ${examples})
${HDF5_LIB_TARGET}
)
SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
+ SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran)
IF (BUILD_TESTING)
ADD_TEST (NAME hl_f90_ex_${example} COMMAND $<TARGET_FILE:hl_f90_ex_${example}>)
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index c8c602b..1f37def 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -30,6 +30,7 @@ ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF
TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran)
#-----------------------------------------------------------------------------
# Fortran Modules
@@ -65,6 +66,7 @@ SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fort
TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index 470aab9..d37ade6 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -26,6 +26,7 @@ TARGET_NAMING (hl_f90_tstds ${LIB_TYPE})
TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstds "")
TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran)
ADD_TEST (NAME hl_f90_tstds COMMAND $<TARGET_FILE:hl_f90_tstds>)
@@ -35,6 +36,7 @@ TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE})
TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstlite "")
TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran)
ADD_TEST (NAME hl_f90_tstlite COMMAND $<TARGET_FILE:hl_f90_tstlite>)
@@ -44,6 +46,7 @@ TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE})
TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstimage "")
TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran)
ADD_TEST (NAME hl_f90_tstimage COMMAND $<TARGET_FILE:hl_f90_tstimage>)
@@ -53,5 +56,6 @@ TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE})
TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tsttable "")
TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran)
+SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran)
ADD_TEST (NAME hl_f90_tsttable COMMAND $<TARGET_FILE:hl_f90_tsttable>)
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
index c60dda1..feab727 100644
--- a/hl/src/CMakeLists.txt
+++ b/hl/src/CMakeLists.txt
@@ -37,6 +37,7 @@ ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS})
TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt
index 3104008..eb5d058 100644
--- a/hl/test/CMakeLists.txt
+++ b/hl/test/CMakeLists.txt
@@ -28,6 +28,7 @@ MACRO (HL_ADD_TEST hl_name files)
${HDF5_LIB_TARGET}
${HDF5_TEST_LIB_TARGET}
)
+ SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl)
ADD_TEST (NAME hl_${hl_name} COMMAND $<TARGET_FILE:hl_${hl_name}>)
@@ -92,4 +93,5 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
${HDF5_LIB_TARGET}
${HDF5_TEST_LIB_TARGET}
)
+ SET_TARGET_PROPERTIES (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt
index e2b605d..5aba978 100644
--- a/hl/tools/CMakeLists.txt
+++ b/hl/tools/CMakeLists.txt
@@ -20,6 +20,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5)
ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS})
TARGET_NAMING (gif2h5 ${LIB_TYPE})
TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl)
#-- Add h52gif program
SET (hdf2gif_SRCS
@@ -29,6 +30,7 @@ SET (hdf2gif_SRCS
ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS})
TARGET_NAMING (h52gif ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl)
# --------------------------------------------------------------------
# This executable can generate the actual test files - Currently not
@@ -39,6 +41,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c)
TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl)
# ADD_TEST (NAME hl_h52gifgentest COMMAND $<TARGET_FILE:hl_h52gifgentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt
index 95ffd30..ec7e69a 100644
--- a/perform/CMakeLists.txt
+++ b/perform/CMakeLists.txt
@@ -19,6 +19,7 @@ SET (h5perf_serial_SRCS
ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS})
TARGET_NAMING (h5perf_serial ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform)
IF (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf_serial_alone
@@ -33,6 +34,7 @@ IF (HDF5_BUILD_PERFORM_STANDALONE)
)
TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform)
ENDIF (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for chunk
@@ -42,6 +44,7 @@ SET (chunk_SRCS
ADD_EXECUTABLE(chunk ${chunk_SRCS})
TARGET_NAMING (chunk ${LIB_TYPE})
TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform)
#-- Adding test for iopipe
SET (iopipe_SRCS
@@ -50,6 +53,7 @@ SET (iopipe_SRCS
ADD_EXECUTABLE (iopipe ${iopipe_SRCS})
TARGET_NAMING (iopipe ${LIB_TYPE})
TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform)
#-- Adding test for overhead
SET (overhead_SRCS
@@ -58,6 +62,7 @@ SET (overhead_SRCS
ADD_EXECUTABLE (overhead ${overhead_SRCS})
TARGET_NAMING (overhead ${LIB_TYPE})
TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform)
#-- Adding test for perf_meta
SET (perf_meta_SRCS
@@ -66,6 +71,7 @@ SET (perf_meta_SRCS
ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS})
TARGET_NAMING (perf_meta ${LIB_TYPE})
TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform)
#-- Adding test for zip_perf
SET (zip_perf_SRCS
@@ -74,6 +80,7 @@ SET (zip_perf_SRCS
ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS})
TARGET_NAMING (zip_perf ${LIB_TYPE})
TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform)
IF (H5_HAVE_PARALLEL)
#-- Adding test for h5perf
@@ -85,6 +92,7 @@ IF (H5_HAVE_PARALLEL)
ADD_EXECUTABLE (h5perf ${h5perf_SRCS})
TARGET_NAMING (h5perf ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform)
IF (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf
@@ -99,6 +107,7 @@ IF (H5_HAVE_PARALLEL)
)
TARGET_NAMING (h5perf_alone ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform)
ENDIF (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for benchpar
@@ -108,6 +117,7 @@ IF (H5_HAVE_PARALLEL)
ADD_EXECUTABLE (benchpar ${benchpar_SRCS})
TARGET_NAMING (benchpar ${LIB_TYPE})
TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform)
#-- Adding test for mpi-perf
IF (NOT WIN32)
@@ -117,6 +127,7 @@ IF (H5_HAVE_PARALLEL)
ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS})
TARGET_NAMING (mpi-perf ${LIB_TYPE})
TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform)
ENDIF (NOT WIN32)
ENDIF (H5_HAVE_PARALLEL)
diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt
index 359d645..f05bd31 100644
--- a/release_docs/CMake.txt
+++ b/release_docs/CMake.txt
@@ -154,6 +154,12 @@ Notes: This short instruction is written for users who want to quickly build
cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 9 2008" \
-DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF ..
+ 2.3 On Windows, if you are using a VS Express version you must be sure that the
+ following two options are correctly set/unset:
+
+ HDF5_NO_PACKAGES:BOOL=ON
+ HDF5_USE_FOLDERS:BOOL=OFF
+
3. Build HDF5
On Windows, you can build HDF5 using either the Visual Studio Environment
@@ -239,7 +245,7 @@ Notes: This short instruction is written for users who want to quickly build
"output directory", which is where the program will be installed. These
options are case-sensitive, so be sure to type them in upper case.
-
+
========================================================================
All options for HDF5 C/C++ Libraries with CMake
========================================================================
@@ -286,7 +292,8 @@ OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF)
OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF)
OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF)
OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF)
-OPTION (DHDF5_NO_PACKAGES "Do not include CPack Packaging" OFF)
+OPTION (HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF)
+OPTION (HDF5_USE_FOLDERS "Do not include CPack Packaging" OFF)
************************************************************************
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 50d426d..fbc8c96 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -631,6 +631,7 @@ ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS}
TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS})
SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 54e699c..8f256e6 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -30,6 +30,7 @@ IF (MINGW)
ENDIF (MINGW)
TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE})
+SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test)
# --------------------------------------------------------------------
# Copy all the HDF5 files from the test directory into the source directory
@@ -150,6 +151,7 @@ SET (testhdf5_SRCS
ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS})
TARGET_NAMING (testhdf5 ${LIB_TYPE})
TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test)
# Remove any output file left over from previous test run
ADD_TEST (
@@ -184,6 +186,7 @@ MACRO (ADD_H5_TEST file)
ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} ${LIB_TYPE})
TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test)
ADD_TEST (NAME ${file} COMMAND $<TARGET_FILE:${file}>)
ENDMACRO (ADD_H5_TEST file)
@@ -303,6 +306,7 @@ SET (H5_TESTS
FOREACH (test ${H5_TESTS})
ADD_H5_TEST(${test})
+# SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS h5test-clear-objects PASS_REGULAR_EXPRESSION "^All(.*)tests.passed.")
SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS h5test-clear-objects)
ENDFOREACH (test ${H5_TESTS})
@@ -318,6 +322,7 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1)
ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c)
TARGET_NAMING (cache ${LIB_TYPE})
TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test)
ADD_TEST (
NAME h5test-clear-cache-objects
COMMAND ${CMAKE_COMMAND}
@@ -331,6 +336,7 @@ SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects)
ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c)
TARGET_NAMING (cache_api ${LIB_TYPE})
TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test)
ADD_TEST (
NAME h5test-clear-cache_api-objects
@@ -351,6 +357,7 @@ ADD_EXECUTABLE (ttsafe
)
TARGET_NAMING (ttsafe ${LIB_TYPE})
TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test)
ADD_TEST (
NAME h5test-clear-ttsafe-objects
@@ -369,6 +376,7 @@ IF (HDF5_ENABLE_DEPRECATED_SYMBOLS)
ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c)
TARGET_NAMING (err_compat ${LIB_TYPE})
TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test)
ADD_TEST (
NAME h5test-clear-err_compat-objects
@@ -394,6 +402,7 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS)
ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c)
TARGET_NAMING (error_test ${LIB_TYPE})
TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test)
ADD_TEST (
NAME h5test-clear-error_test-objects
@@ -418,11 +427,14 @@ SET_TESTS_PROPERTIES(error_test PROPERTIES DEPENDS h5test-clear-error_test-objec
ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c)
TARGET_NAMING (links_env ${LIB_TYPE})
TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test)
ADD_TEST (
NAME h5test-clear-links_env-objects
COMMAND ${CMAKE_COMMAND}
- -E remove
+ -E remove
+ links_env.txt
+ links_env.txt.err
extlinks_env0.h5
extlinks_env1.h5
tmp/extlinks_env1.h5
@@ -574,6 +586,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c)
TARGET_NAMING (${genfile} ${LIB_TYPE})
TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test)
ENDMACRO (ADD_H5_GENERATOR genfile)
# generator executables
@@ -597,10 +610,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
)
FOREACH (gen ${H5_GENERATORS})
- ADD_EXECUTABLE (${gen} ${HDF5_TEST_SOURCE_DIR}/${gen}.c)
- TARGET_NAMING (${gen} ${LIB_TYPE})
- TARGET_LINK_LIBRARIES (${gen} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ ADD_H5_GENERATOR (${gen})
ENDFOREACH (gen ${H5_GENERATORS})
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
-
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index d0ba668..20eab29 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -22,14 +22,16 @@ SET (testphdf5_SRCS
#-- Adding test for testhdf5
ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS})
TARGET_NAMING (testphdf5 ${LIB_TYPE})
-TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
+SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par)
ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:testphdf5>)
MACRO (ADD_H5P_TEST file)
ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c)
TARGET_NAMING (${file} ${LIB_TYPE})
- TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
+ SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par)
ADD_TEST (NAME TEST_PAR_${file} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $<TARGET_FILE:${file}>)
ENDMACRO (ADD_H5P_TEST file)
@@ -97,4 +99,3 @@ IF (HDF5_TEST_VFD)
ENDFOREACH (vfd ${VFD_LIST})
ENDIF (HDF5_TEST_VFD)
-
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index 11cebca..849c5c6 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -13,6 +13,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c)
TARGET_NAMING (h5copy ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES h5copy)
@@ -27,6 +28,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c)
TARGET_NAMING (h5copygentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt
index cb5fa5f..106ff30 100644
--- a/tools/h5diff/CMakeLists.txt
+++ b/tools/h5diff/CMakeLists.txt
@@ -16,6 +16,7 @@ ADD_EXECUTABLE (h5diff
)
TARGET_NAMING (h5diff ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES h5diff)
@@ -26,6 +27,7 @@ IF (H5_HAVE_PARALLEL)
)
TARGET_NAMING (ph5diff ${LIB_TYPE})
TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools)
ENDIF (H5_HAVE_PARALLEL)
##############################################################################
@@ -42,6 +44,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
TARGET_NAMING (h5diffgentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
@@ -401,6 +404,8 @@ IF (BUILD_TESTING)
-D "TEST_OUTPUT=P_${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.txt"
+# -D "TEST_APPEND=EXIT CODE: [0-9]"
+# -D "TEST_REF_FILTER=EXIT CODE: 0"
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF5_RESOURCES_DIR}/prunTest.cmake"
)
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 9623118..733cbc1 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -13,6 +13,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c)
TARGET_NAMING (h5dump ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES h5dump)
@@ -30,6 +31,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c)
TARGET_NAMING (h5dumpgentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt
index abd0b7d..39ddcc2 100644
--- a/tools/h5import/CMakeLists.txt
+++ b/tools/h5import/CMakeLists.txt
@@ -13,6 +13,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c)
TARGET_NAMING (h5import ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES h5import)
@@ -29,6 +30,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c)
TARGET_NAMING (h5importtest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools)
SET (HDF5_REFERENCE_CONF_FILES
binfp64.conf
diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt
index 9925e2a..74a2797 100644
--- a/tools/h5jam/CMakeLists.txt
+++ b/tools/h5jam/CMakeLists.txt
@@ -13,18 +13,22 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c)
TARGET_NAMING (h5jam ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools)
ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c)
TARGET_NAMING (getub ${LIB_TYPE})
TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools)
ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c)
TARGET_NAMING (tellub ${LIB_TYPE})
TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c)
TARGET_NAMING (h5unjam ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES
h5jam
@@ -47,6 +51,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c)
TARGET_NAMING (h5jamgentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt
index 2cd11cd..e528e66 100644
--- a/tools/h5ls/CMakeLists.txt
+++ b/tools/h5ls/CMakeLists.txt
@@ -13,6 +13,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c)
TARGET_NAMING (h5ls ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES
h5ls
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index 7fbf834..aa54c9f 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -23,6 +23,7 @@ SET (REPACK_COMMON_SRCS
ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c)
TARGET_NAMING (h5repack ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES h5repack)
@@ -39,10 +40,12 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE})
TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c)
TARGET_NAMING (h5repacktest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools)
IF (HDF5_TEST_VFD)
SET (VFD_LIST
diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt
index a4b06a6..de80e9e 100644
--- a/tools/h5stat/CMakeLists.txt
+++ b/tools/h5stat/CMakeLists.txt
@@ -13,6 +13,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c)
TARGET_NAMING (h5stat ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES h5stat)
@@ -30,6 +31,7 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
TARGET_NAMING (h5stat_gentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt
index 1e8afa1..213d14d 100644
--- a/tools/lib/CMakeLists.txt
+++ b/tools/lib/CMakeLists.txt
@@ -40,6 +40,7 @@ H5_SET_LIB_OPTIONS (
HDF5_TOOLS_LIB_NAME_RELEASE
HDF5_TOOLS_LIB_NAME_DEBUG
)
+SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES FOLDER libraries/tools)
##############################################################################
##############################################################################
diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt
index 3e9fe69..4f27490 100644
--- a/tools/misc/CMakeLists.txt
+++ b/tools/misc/CMakeLists.txt
@@ -14,14 +14,17 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test)
ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c)
TARGET_NAMING (h5debug ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c)
TARGET_NAMING (h5repart ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools)
ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c)
TARGET_NAMING (h5mkgrp ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools)
SET (H5_DEP_EXECUTABLES
h5debug
@@ -43,12 +46,14 @@ IF (BUILD_TESTING)
ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c)
TARGET_NAMING (h5repart_gentest ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools)
#ADD_TEST (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c)
TARGET_NAMING (h5repart_test ${LIB_TYPE})
TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools)
# --------------------------------------------------------------------
# Copy all the HDF5 files from the test directory into the source directory