-
-
Notifications
You must be signed in to change notification settings - Fork 258
/
USING_CMake_Examples.txt
94 lines (74 loc) · 4.88 KB
/
USING_CMake_Examples.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
************************************************************************
* Build and Test HDF5 Examples with CMake *
************************************************************************
Notes: This short instruction is written for users who want to quickly
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.
More information about using CMake can be found at the KitWare
site, www.cmake.org.
CMake uses the command line and these instructions use the script
method of the ctest command.
========================================================================
I. Preconditions
========================================================================
1. We suggest you obtain the latest CMake for your platform from the Kitware
web site. The HDF5 2.0.x product requires a minimum CMake version
of 3.18. If you are using VS2022, the minimum CMake version is 3.21.
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). You can obtain pre-built binaries
from The HDF Group's website at www.hdfgroup.org.
========================================================================
II. Building HDF5 Examples with CMake
========================================================================
Files in the HDF5 install directory:
HDF5Examples folder
CTestScript.cmake
HDF5_Examples.cmake
HDF5_Examples_options.cmake
Default installation process:
Create a directory to run the examples, i.e. \test_hdf5.
Copy HDF5Examples folder to this directory.
Copy CTestScript.cmake to this directory.
Copy HDF5_Examples.cmake to this directory.
Copy HDF5_Examples_options.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 for the platform.
It can be changed with the INSTALLDIR script option.
(Note: Windows has issues with spaces and paths -The path will need to
be set correctly.)
The default ctest configuration is defined as "Release". It can be changed
with the CTEST_CONFIGURATION_TYPE script option. Note that this must
be the same as the value used with the -C command line option.
On Windows, you can set the CTEST_VSVERS script option to either
64_VS2022 or 64_VS2019. Alternately, you can set the script
CTEST_CMAKE_GENERATOR option to "Visual Studio 16 2019" or "Visual Studio 17 2022",
and the CMAKE_GENERATOR_ARCHITECTURE script option to "x64".
The default build configuration is defined to build and use static libraries.
Shared libraries and other options can be changed by editing the
HDF5_Examples_options.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 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 206.
========================================================================
III. Defaults in the HDF5_Examples_options.cmake file
========================================================================
#### DEFAULT: ###
#### BUILD_SHARED_LIBS:BOOL=OFF ###
#### H5EX_BUILD_C:BOOL=ON ###
#### H5EX_BUILD_HL:BOOL=OFF ###
#### H5EX_BUILD_CXX:BOOL=OFF ###
#### H5EX_BUILD_FORTRAN:BOOL=OFF ###
#### H5EX_BUILD_JAVA:BOOL=OFF ###
#### H5EX_BUILD_FILTERS:BOOL=OFF ###
#### H5EX_BUILD_TESTING:BOOL=OFF ###
#### H5EX_ENABLE_PARALLEL:BOOL=OFF ###