2014-04-26 05:27:37 +08:00
|
|
|
************************************************************************
|
|
|
|
* Build and Test HDF5 Examples with CMake *
|
|
|
|
************************************************************************
|
|
|
|
|
2015-08-28 05:46:50 +08:00
|
|
|
Notes: This short instruction is written for users who want to quickly
|
2014-04-26 05:27:37 +08:00
|
|
|
test the installation of HDF5 by using the CMake tools to build
|
|
|
|
and test the HDF5 Examples. The following instructions will show
|
|
|
|
the default usage and then present common changes for non-default
|
|
|
|
installations.
|
|
|
|
For more information, see the USING_HDF5_CMake.txt file.
|
2015-08-28 05:46:50 +08:00
|
|
|
|
|
|
|
More information about using CMake can be found at the KitWare
|
2014-04-26 05:27:37 +08:00
|
|
|
site, www.cmake.org.
|
2015-08-28 05:46:50 +08:00
|
|
|
|
2014-04-26 05:27:37 +08:00
|
|
|
CMake uses the command line and these instructions use the script
|
|
|
|
method of the ctest command.
|
|
|
|
|
|
|
|
|
|
|
|
========================================================================
|
2015-08-28 05:46:50 +08:00
|
|
|
I. Preconditions
|
2014-04-26 05:27:37 +08:00
|
|
|
========================================================================
|
|
|
|
|
|
|
|
1. We suggest you obtain the latest CMake for windows from the Kitware
|
2016-03-15 03:10:30 +08:00
|
|
|
web site. The HDF5 1.10.x product requires a minimum CMake version
|
2015-08-28 05:46:50 +08:00
|
|
|
of 3.1.0.
|
|
|
|
|
|
|
|
2. You have installed the HDF5 library built with CMake, by executing
|
|
|
|
the HDF Install Utility (the *.msi file in the binary package for
|
|
|
|
Windows or the *.sh on Linux). If you are using a Windows platform,
|
|
|
|
you can obtain a pre-built Windows binary from The HDF Group's website
|
2015-09-25 02:54:00 +08:00
|
|
|
at www.hdfgroup.org.
|
|
|
|
|
2014-04-26 05:27:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
========================================================================
|
|
|
|
II. Building HDF5 Examples with CMake
|
|
|
|
========================================================================
|
|
|
|
|
|
|
|
Files in the HDF5 install directory:
|
2015-09-25 02:54:00 +08:00
|
|
|
HDF5Examples folder
|
2015-10-21 23:44:41 +08:00
|
|
|
HDF5_Examples.cmake
|
2015-08-28 05:46:50 +08:00
|
|
|
|
2014-04-26 05:27:37 +08:00
|
|
|
Default installation process:
|
|
|
|
Create a directory to run the examples, i.e. \test_hdf5.
|
2015-09-25 02:54:00 +08:00
|
|
|
Copy HDF5Examples folder to this directory.
|
|
|
|
Copy HDF5_Examples.cmake to this directory.
|
|
|
|
The default source folder is defined as "HDF5Examples". It can be changed
|
|
|
|
with the CTEST_SOURCE_NAME script option.
|
|
|
|
The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@".
|
|
|
|
It can be changed with the INSTALLDIR script option.
|
|
|
|
The default ctest configuration is defined as "Release". It can be changed
|
2016-08-23 01:22:38 +08:00
|
|
|
with the CTEST_CONFIGURATION_TYPE script option. Note that this must
|
2015-09-25 02:54:00 +08:00
|
|
|
be the same as the value used with the -C command line option.
|
|
|
|
The default build configuration is defined to build and use static libraries.
|
2015-10-21 23:44:41 +08:00
|
|
|
Shared libraries can be used with the STATIC_LIBRARIES script option set to "NO".
|
2015-09-25 02:54:00 +08:00
|
|
|
Other options can be changed by editing the HDF5_Examples.cmake file.
|
|
|
|
|
|
|
|
If the defaults are okay, execute from this directory:
|
|
|
|
ctest -S HDF5_Examples.cmake -C Release -V -O test.log
|
|
|
|
If the defaults need change, execute from this directory:
|
|
|
|
ctest -S HDF5_Examples.cmake,CTEST_SOURCE_NAME=MyExamples,INSTALLDIR=MyLocation -C Release -V -O test.log
|
|
|
|
|
|
|
|
When executed, the ctest script will save the results to the log file, test.log, as
|
|
|
|
indicated by the ctest command. If you wish the to see more build and test information,
|
|
|
|
add "-VV" to the ctest command. The output should show;
|
|
|
|
100% tests passed, 0 tests failed out of 156.
|
2014-04-26 05:27:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
========================================================================
|
2015-10-21 23:44:41 +08:00
|
|
|
III. Other changes to the HDF5_Examples.cmake file
|
2014-04-26 05:27:37 +08:00
|
|
|
========================================================================
|
|
|
|
|
2015-10-21 23:44:41 +08:00
|
|
|
Line 45-48: uncomment to use a source tarball or zipfile;
|
2015-09-25 02:54:00 +08:00
|
|
|
Add script option "TAR_SOURCE=MySource.tar".
|
2014-11-07 04:29:11 +08:00
|
|
|
|