************************************************************************
* Build and Install HDF5 Filter Libraries  and tools with CMake        *
************************************************************************

                     Table of Contents

Section I:    Preconditions
Section II:   Quick Step Building HDF5 Filters with CMake Script Mode
Section III:  Quick Step Building HDF5 Filters with CMake Command Mode
Section IV:   Further considerations
Section V:    Options for building HDF5 Filters with CMake command line
Section VI:   CMake option defaults for HDF5 Filters

************************************************************************


========================================================================
I. Preconditions
========================================================================
Obtaining HDF5 Filter source code
   1. Create a directory for your development; for example, "myhdfstuff".

   2. Obtain compressed (*.tar or *.zip) HDF5 Filter source from
         https://portal.hdfgroup.org/display/support/Building+HDF5+filters+with+CMake
      and put it in "myhdfstuff".
      Uncompress the file. There should be a hdf5_plugins-1.10."X" folder.

CMake version
   1. We suggest you obtain the latest CMake from the Kitware web site.
      The HDF5 Filters 1.10."X" product requires a minimum CMake version 3.12,
      where "X" is the current HDF5 release version. If you are using
      VS2019, the minimum version is 3.15.

Note:
   To change the install prefix from the platform defaults initialize
   the CMake variable, CMAKE_INSTALL_PREFIX. Users of build scripts
   will use the INSTALLDIR option.


========================================================================
II. Quick Step Building HDF5 Filters with CMake Script Mode
========================================================================
This short set of instructions is written for users who want to quickly
build the HDF5 Filter libraries.  This procedure will use the default
settings in the config/cmake/cacheinit.cmake file.
HDF Group recommends using the ctest script mode to build HDF5.

The following files referenced below are available at the HDF web site:
     https://portal.hdfgroup.org/display/support/Building+HDF5+filters+with+CMake

Single compressed file with all the files needed, including source:
    CMake-hdf5_plugins-1.10.X.zip or CMake-hdf5_plugins-1.10.X.tar.gz

Individual files included in the above mentioned compressed files
-----------------------------------------------
CMake build script:
    CTestScript.cmake

External compression libraries are in the source libs folder.

Configuration files:
    HDF5PLconfig.cmake
    HDFoptions.cmake

Build scripts for windows or linux
-----------------------------------------------

To build HDF5 Filter libraries you will need to:

   1. Change to the development directory "myhdfstuff".

   2. Download the CMake-hdf5_plugins-1.10.X.zip(.tar.gz) file to "myhdfstuff".
      Uncompress the file.

   3. Change to the source directory "hdf5_plugins-1.10.x".
      CTestScript.cmake file should not be modified.

   4. Edit the platform configuration file, HDFoptions.cmake, if you want to change
      the default build environment.
      (See  https://portal.hdfgroup.org/display/support/How+to+Change+HDF5+CMake+Build+Options)

   5. From the "myhdfstuff" directory execute the CTest Script with the
      following options:

      On 32-bit Windows with Visual Studio 2019, execute:
         ctest -S HDF5PLconfig.cmake,BUILD_GENERATOR=VS2019 -C Release -VV -O hdf5.log
      On 64-bit Windows with Visual Studio 2019, execute:
         ctest -S HDF5PLconfig.cmake,BUILD_GENERATOR=VS201964 -C Release -VV -O hdf5.log
      On 32-bit Windows with Visual Studio 2017, execute:
         ctest -S HDF5PLconfig.cmake,BUILD_GENERATOR=VS2017 -C Release -VV -O hdf5.log
      On 64-bit Windows with Visual Studio 2017, execute:
         ctest -S HDF5PLconfig.cmake,BUILD_GENERATOR=VS201764 -C Release -VV -O hdf5.log
      On 32-bit Windows with Visual Studio 2015, execute:
         ctest -S HDF5PLconfig.cmake,BUILD_GENERATOR=VS2015 -C Release -VV -O hdf5.log
      On 64-bit Windows with Visual Studio 2015, execute:
         ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201564 -C Release -VV -O hdf5.log
      On Linux and Mac, execute:
         ctest -S HDF5PLconfig.cmake,BUILD_GENERATOR=Unix -C Release -VV -O hdf5.log
      The supplied build scripts are versions of the above.

      The command above will configure, build, test, and create an install
      package in the myhdfstuff folder. It will have the format:
          HDF5_Plugins-1.10.NN-<platform>.<zip or tar.gz>

          On Unix, <platform> will be "Linux". A similar .sh file will also be created.
          On Windows, <platform> will be "win64" or "win32". If you have an
          installer on your system, you will also see a similar file that ends
          in either .exe (NSIS) or .msi (WiX).

      Notes on the command line options.
          The -S option uses the script version of ctest.

          The value for the -C option (as shown above, "-C Release") must
          match the setting for CTEST_CONFIGURATION_TYPE in the platform
          configuration file.

          The -VV option is for most verbose; use -V for less verbose.

          The "-O hdf5.log" option saves the output to a log file hdf5.log.

   6. To install, "X" is the current release version

      On Windows (with WiX installed), execute:
                HDF5_plugins-1.10."X"-win32.msi or HDF5_plugins-1.10."X"-win64.msi
      By default this program will install the hdf5 filter libraries into the
      "C:\Program Files" directory and will create the following
      directory structure:
         HDF_Group
         --HDF5
         ----1.10."X"
         ------lib
         --------plugins
         ------cmake

      On Linux, change to the install destination directory
      (create it if doesn't exist) and execute:
                <path-to>/myhdfstuff/HDF5_plugins-1.10."X"-Linux.sh
      After accepting the license, the script will prompt:
        By default the HDF5 filter libraries will be installed in:
        "<current directory>/HDF5-1.10."X"-Linux"
        Do you want to include the subdirectory HDF5-1.10."X"-Linux?
        Saying no will install in: "<current directory>" [Yn]:
      Note that the script will create the following directory structure
      relative to the install point:
         HDF_Group
         --HDF5
         ----1.10."X"
         ------lib
         --------plugins
         ------share

      On Mac you will find HDF5_plugins-1.10."X"-Darwin.dmg in the myhdfstuff folder. Click
      on the dmg file to proceed with installation. After accepting the license,
      there will be a folder with the following structure:
         HDF_Group
         --HDF5
         ----1.10."X"
         ------lib
         --------plugins
         ------share

      By default the installation will create or merge the lib and cmake
      folders in the <install destination directory>/HDF_Group/HDF5/1.10."X"
      The <install destination directory> depends on the build platform;
        Windows will set the default to:
          C:/Program Files/HDF_Group/HDF5/1.10."X"
        Linux will set the default to:
          "myhdfstuff/HDF_Group/HDF5/1.10."X"
      The default can be changed by adding ",INSTALLDIR=<my new dir>" to the
          "ctest -S HDF5config.cmake..." command. For example on linux:
         ctest -S HDF5config.cmake,INSTALLDIR=/usr/local/myhdf5,BUILD_GENERATOR=Unix -C Release -VV -O hdf5.log


========================================================================
III. Quick Step Building HDF5 Filters with CMake
========================================================================
Notes: This short set of instructions is written for users who want to
       quickly build just the HDF5 Filter libraries from the HDF5 fileter
       source code package using the CMake command line tools.
       Avoid the use of drive letters in paths on Windows.

   Go through these steps:

      1. Change to the development directory "myhdfstuff".

      2. Uncompress the HDF5 Filter source file

      3. Create a folder  "build" in the "myhdfstuff" directory.

      4. Change into the "build" folder.

      5. Configure the C filter libraries with one of the following commands:

         On Windows 32 bit
           cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_EXAMPLES:BOOL=ON ..\hdf5_plugins-1.10."X"

         On Windows 64 bit
           cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_EXAMPLES:BOOL=ON ..\hdf5_plugins-1.10."X"

         On Linux and Mac
           cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_EXAMPLES:BOOL=ON ../hdf5_plugins-1.10."X"

         where "X" is the current release version.

      6. Build the C library, tools and tests with this command:
           cmake --build . --config Release

      7. Test the C library and tools with this command:
           ctest . -C Release

      8. Create an install image with this command:
           cpack -C Release CPackConfig.cmake

      9. To install
         On Windows (with WiX installed), execute:
                HDF5_plugins-1.10."X"-win32.msi or HDF5_plugins-1.10."X"-win64.msi
         By default this program will install the hdf5 library into the
         "C:\Program Files" directory and will create the following
         directory structure:
            HDF_Group
            --HDF5
            ----1.10."X"
            ------lib
            --------plugins
            ------cmake

         On Linux, change to the install destination directory
         (create if doesn't exist) and execute:
                <path-to>/myhdfstuff/build/HDF5_plugins-1.10."X"-Linux.sh
         After accepting the license, the script will prompt:
           By default the HDF5 will be installed in:
           "<current directory>/HDF5_plugins-1.10."X"-Linux"
           Do you want to include the subdirectory HDF5_plugins-1.10."X"-Linux?
           Saying no will install in: "<current directory>" [Yn]:
         Note that the script will create the following directory structure
         relative to the install point:
            HDF_Group
            --HDF5
            ----1.10."X"
            ------lib
            --------plugins
            ------share

         On Mac you will find HDF5_plugins-1.10."X"-Darwin.dmg in the build folder. Click
         on the dmg file to proceed with installation. After accepting the license,
         there will be a folder with the following structure:
            HDF_Group
            --HDF5
            ----1.10."X"
            ------lib
            --------plugins
            ------share


========================================================================
IV. Further considerations
========================================================================

   1. We suggest you obtain the latest CMake for windows from the Kitware
      web site. The HDF5 1.10."X" product requires a minimum CMake version 3.12.

   2. If you are building on Apple Darwin platforms, you should add the
      following options:
          Compiler choice - use xcode by setting the ENV variables of CC and CXX
          Additional options:
            CMAKE_ANSI_CFLAGS:STRING=-fPIC
            CTEST_USE_LAUNCHERS:BOOL=ON
            CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

   5. Windows developers should install NSIS or WiX to create an install image with CPack.
      Visual Studio Express users will not be able to package HDF5 Filters into
      an install image executable.

   6. Developers can copy the config/cmake/cacheinit.cmake file and alter the
      the settings for the developers' environment. Then the only options needed
      on the command line are those options that are different. Example using HDF
      default cache file:
           cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 14 2015" \
               -DHDF5_MSVC_NAMING_CONVENTION:BOOL=OFF \
               -DCMAKE_BUILD_TYPE:STRING=Release ..

   7. CMake uses a toolchain of utilities to compile, link libraries and
      create archives, and other tasks to drive the build. The toolchain
      utilities available are determined by the languages enabled. In normal
      builds, CMake automatically determines the toolchain for host builds
      based on system introspection and defaults. In cross-compiling
      scenarios, a toolchain file may be specified with information about
      compiler and utility paths.
                Variables and Properties
      Several variables relate to the language components of a toolchain which
      are enabled. CMAKE_<LANG>_COMPILER is the full path to the compiler used
      for <LANG>. CMAKE_<LANG>_COMPILER_ID is the identifier used by CMake for
      the compiler and CMAKE_<LANG>_COMPILER_VERSION is the version of the compiler.

      The CMAKE_<LANG>_FLAGS variables and the configuration-specific equivalents
      contain flags that will be added to the compile command when compiling a
      file of a particular language.

      As the linker is invoked by the compiler driver, CMake needs a way to
      determine which compiler to use to invoke the linker. This is calculated
      by the LANGUAGE of source files in the target, and in the case of static
      libraries, the language of the dependent libraries. The choice CMake makes
      may be overridden with the LINKER_LANGUAGE target property.

      See the CMake help for more information on using toolchain files.

      To use a toolchain file with the supplied cmake scripts, see the
      HDFoptions.cmake file under the toolchain section.

Notes: CMake and HDF5

   1. Using CMake for building and using HDF5 is under active development.
      We have attempted to provide error-free files. The CMake specific
      files may change before the next release.

   2. CMake support for HDF5 development should be usable on any
      system where CMake is supported. Please send us any comments on
      how CMake support can be improved on any system. Visit the
      KitWare site for more information about CMake.

   3. Build and test results can be submitted to our CDash server:
      The CDash server for community submissions of hdf5 is at
          https://cdash.hdfgroup.org.

      Submitters are requested to register their name and contact info and
      maintain their test sites. After your first submission, login and go
      to your "My CDash" link and claim your site.

      We ask that all submissions include the configuration information and
      contact information in the CTest Notes Files upload step. See the
      current reports on CDash for examples.

      Please follow the convention that "NIGHTLY" submissions maintain the same
      configuration every time. "EXPERIMENTAL" submissions can be expected to
      be different for each submission.

   4. See the appendix at the bottom of this file for examples of using
      a ctest script for building and testing. Using a ctest script is
      preferred because of its flexibility.

Notes: CMake in General

   1. More information about using CMake can be found at the KitWare site at
         www.cmake.org.

   2. CMake uses the command line; however, the visual CMake tool is
      available for the configuration step. The steps are similar for
      all the operating systems supported by CMake.


========================================================================
V. Options for Building HDF5 Filter Libraries with the CMake Command Line
========================================================================

To build the HDF5 Filter Libraries with CMake, go through these five steps:

   1. Run CMake
   2. Configure the cache settings
   3. Build HDF5 Filters
   4. Test HDF5 Filters
   5. Package HDF5 Filters(create install image)

These five steps are described in detail below.

========================================================================

   1. Run CMake

      The visual CMake executable is named "cmake-gui.exe" on Windows and should be
      available in your Start menu. For Linux, UNIX, and Mac users the
      executable is named "cmake-gui" and can be found where CMake was
      installed.

      Specify the source and build directories.

      ***** Make the build and source directories different. ******

      For example on Windows, if the source is at c:\MyHDFstuff\hdf5pl,
      then use c:\MyHDFstuff\hdf5pl\build or c:\MyHDFstuff\build\hdf5pl as the
      build directory.

      RECOMMENDED:
        Users can perform the configuration step without using the visual
        cmake-gui program. We use the file cacheinit.cmake in the
        config/cmake source folder for our testing. This file enables all of the
        basic options and we turn specific options on or off for testing
        using the following command line within the build directory:

        cmake -C <sourcepath>/config/cmake/cacheinit.cmake -G "<generator>"  [-D<options>]  <sourcepath>

        Where <generator> is
            * MinGW Makefiles
            * NMake Makefiles
            * Unix Makefiles
            * Visual Studio 14 2015
            * Visual Studio 14 2015 Win64
            * Visual Studio 15 2017
            * Visual Studio 15 2017 Win64
            * Visual Studio 16 2019

        <options> is:
            * XXX_INCLUDE_DIR:PATH=<path to XXX includes directory>
            * XXX_LIBRARY:FILEPATH=<path to XXX/library file>
            * <HDF5OPTION>:BOOL=[ON | OFF]

        <cacheinit.cmake> is:
                # This is the CMakeCache file used by HDF Group for daily tests.
                ########################
                # EXTERNAL cache entries
                ########################
                set (USE_SHARED_LIBS ON CACHE BOOL "Use Shared Libraries" FORCE)
                set (BUILD_TESTING ON CACHE BOOL "Build h5blosc Unit Testing" FORCE)
                set (H5PL_BUILD_TESTING ON CACHE BOOL "Enable h5pl examples" FORCE)
                set (BUILD_EXAMPLES ON CACHE BOOL "Build h5pl Examples" FORCE)
                set (HDF_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
                set (HDF5_PACKAGE_NAME "hdf5" CACHE STRING "Name of HDF5 package" FORCE)
                set (H5PL_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE)
                set_property (CACHE H5PL_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ)
                set (H5PL_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/h5plugin.git" CACHE STRING "Use plugins from HDF repository" FORCE)
                set (H5PL_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (H5PL_TGZ_NAME "h5pl.tar.gz" CACHE STRING "Use plugins from compressed file" FORCE)
                set (PL_PACKAGE_NAME "pl" CACHE STRING "Name of plugins package" FORCE)
                set (H5PL_CPACK_ENABLE ON CACHE BOOL "Enable the CPACK include and components" FORCE)
                ############################# bitshuffle ################################################
                set (BSHUF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bitshuffle.git" CACHE STRING "Use BSHUF from HDF repository" FORCE)
                set (BSHUF_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (BSHUF_TGZ_NAME "bitshuffle.tar.gz" CACHE STRING "Use BSHUF from compressed file" FORCE)
                set (BSHUF_PACKAGE_NAME "bshuf" CACHE STRING "Name of BSHUF package" FORCE)
                ############################# blosc ################################################
                set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOSC from Github" FORCE)
                set (BLOSC_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (BLOSC_TGZ_NAME "c-blosc.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE)
                set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE)
                set (ZLIB_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/zlib.git" CACHE STRING "Use ZLIB from HDF repo" FORCE)
                set (ZLIB_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE)
                set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
                ############################# bzip2 ################################################
                set (BZ2_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/bzip2.git" CACHE STRING "Use BZ2 from HDF repository" FORCE)
                set (BZ2_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (BZ2_TGZ_NAME "BZ2.tar.gz" CACHE STRING "Use BZ2 from compressed file" FORCE)
                set (BZ2_PACKAGE_NAME "bz2" CACHE STRING "Name of BZ2 package" FORCE)
                ############################# fpzip ################################################
                set (FPZIP_GIT_URL "https://https://github.com/LLNL/fpzip" CACHE STRING "Use FPZIP from github repository" FORCE)
                set (FPZIP_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (FPZIP_TGZ_NAME "fpzip.tar.gz" CACHE STRING "Use FPZIP from compressed file" FORCE)
                set (FPZIP_PACKAGE_NAME "fpzip" CACHE STRING "Name of FPZIP package" FORCE)
                ############################# jpeg ################################################
                set (JPEG_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/jpeg.git" CACHE STRING "Use JPEG from HDF repository" FORCE)
                set (JPEG_GIT_BRANCH "jpeg9c" CACHE STRING "" FORCE)
                #set (JPEG_TGZ_NAME "JPEG9c.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE)
                set (JPEG_TGZ_NAME "JPEG.tar.gz" CACHE STRING "Use JPEG from compressed file" FORCE)
                set (JPEG_PACKAGE_NAME "jpeg" CACHE STRING "Name of JPEG package" FORCE)
                ############################# lz4 ################################################
                set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the plugin" FORCE)
                set (LZ4_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lz4.git" CACHE STRING "Use LZ4 from HDF repository" FORCE)
                set (LZ4_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (LZ4_TGZ_NAME "lz4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE)
                set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE)
                ############################# lzf ################################################
                set (LZF_GIT_URL "https://git@bitbucket.hdfgroup.org/scm/test/lzf.git" CACHE STRING "Use LZF from HDF repository" FORCE)
                set (LZF_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (LZF_TGZ_NAME "lzf.tar.gz" CACHE STRING "Use LZF from compressed file" FORCE)
                set (LZF_PACKAGE_NAME "lzf" CACHE STRING "Name of LZF package" FORCE)
                ############################# mafisc ################################################
                #set (BUILD_MAFISC_LIBRARY_SOURCE OFF CACHE BOOL "build the mafisc library within the plugin" FORCE)
                #set (MAFISC_PACKAGE_NAME "mafisc" CACHE STRING "Name of MAFISC package" FORCE)
                ############################# sz ################################################
                set (SZF_GIT_URL "https://github.com/disheng222/SZ" CACHE STRING "Use SZ filter from github repository" FORCE)
                set (SZF_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (SZF_TGZ_NAME "szf.tar.gz" CACHE STRING "Use SZ filter from compressed file" FORCE)
                set (SZF_PACKAGE_NAME "szf" CACHE STRING "Name of SZ filter package" FORCE)
                ############################# zfp ################################################
                set (ZFP_GIT_URL "https://github.com/LLNL/zfp.git" CACHE STRING "Use ZFP from Github" FORCE)
                set (ZFP_GIT_BRANCH "master" CACHE STRING "" FORCE)
                set (ZFP_TGZ_NAME "zfp.tar.gz" CACHE STRING "Use ZFP from compressed file" FORCE)
                set (ZFP_PACKAGE_NAME "zfp" CACHE STRING "Name of ZFP package" FORCE)


   2. Configure the cache settings

      2.1  Visual CMake users, click the Configure button. If this is the first time you are
           running cmake-gui in this directory, you will be prompted for the
           generator you wish to use (for example on Windows, Visual Studio 14).
           CMake will read in the CMakeLists.txt files from the source directory and
           display options for the HDF5 filter project. After the first configure you
           can adjust the cache settings and/or specify the locations of other programs.

           Any conflicts or new values will be highlighted by the configure
           process in red. Once you are happy with all the settings and there are no
           more values in red, click the Generate button to produce the appropriate
           build files.

           On Windows, if you are using a Visual Studio generator, the solution and
           project files will be created in the build folder.

           On linux, if you are using the Unix Makefiles generator, the Makefiles will
           be created in the build folder.

      2.2  Preferred command line example on Windows in c:\MyHDFstuff\hdf5pl\build directory:

               cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 14 2015" \
               -DHDF5_MSVC_NAMING_CONVENTION:BOOL=OFF \
               -DCMAKE_BUILD_TYPE:STRING=Release ..

      2.3  On Windows, if you are using a Visual Studio Express version you must
           be sure that the following two options are correctly set/unset:

           HDF_NO_PACKAGES:BOOL=ON
           HDF_USE_FOLDERS:BOOL=OFF

   3. Build HDF5 Filters

      On Windows, you can build HDF5 using either the Visual Studio Environment
      or the command line. The command line can be used on all platforms;
      Windows, linux, Unix, and Mac.

      To build from the command line, navigate to your build directory and
      execute the following:

              cmake --build . --config {Debug | Release}

      NOTE: "--config {Debug | Release}" may be optional on your platform. We
            recommend choosing either Debug or Release on Windows.

      3.1  If you wish to use the Visual Studio environment, open the solution
           file in your build directory. Be sure to select either Debug or
           Release and build the solution.

      3.2.1  The external libraries (zlib, szip and plugins) can be configured
           to allow building the libraries by downloading from a GIT repository.
           The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following
           configuration option:
               -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="GIT"

           The options to control the GIT URL (config/cmake/cacheinit.cmake file) are:
               ZLIB_GIT_URL:STRING="http://${git_url}/zlib"
               SZIP_GIT_URL:STRING="http://${git_url}/szip"
               PLUGIN_GIT_URL:STRING="http://${git_url}/plugin"
           ${git_url} should be changed to your location. Also define CMAKE_BUILD_TYPE
           to be the configuration type.

      3.2.2  Or the external libraries (zlib, szip and plugins) can be configured
           to allow building the libraries by using a compressed file.
           The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by
           adding the following configuration option:
               -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ"

           The options to control the TGZ URL (config/cmake/cacheinit.cmake
           file) are:
               ZLIB_TGZ_NAME:STRING="zlib_src.ext"
               SZIP_TGZ_NAME:STRING="szip_src.ext"
               LIBAEC_TGZ_NAME:STRING="libaec_src.ext"
               PLUGIN_TGZ_NAME:STRING="plugin_src.ext"
               TGZPATH:STRING="some_location"
            where "some_location/xxxx_src.ext" is the URL or full path to
            the compressed file and where ext is the type of the compression
            file such as .bz2, .tar, .tar.gz, .tgz, or .zip. Also define
            CMAKE_BUILD_TYPE to be the configuration type.

           NOTE: the USE_LIBAEC option will use the file named by LIBAEC_TGZ_NAME
            to build SZIP instead of the file named by SZIP_TGZ_NAME. This option
            is also used to account for the different headers and library names.

   4. Test HDF5 filters

      To test the build, navigate to your build directory and execute:

              ctest . -C {Debug | Release}

      NOTE: "-C {Debug | Release}" may be optional on your platform. We
            recommend choosing either Debug or Release to match the build
            step on Windows.

   5. Packaging HDF5 filters (create an install image)

      To package the build into a simple installer using WiX toolset or the NullSoft installer NSIS
      on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool.

      To package the build, navigate to your build directory and execute;

              cpack -C {Debug | Release} CPackConfig.cmake

      NOTE: See note 8 of this document for NSIS information.
            See note 9 of this document for WiX information.
            Also, if you are using a Visual Studio Express version or
            want to disable the packaging components, set HDF_NO_PACKAGES
            to ON (on the command line add -DHDF_NO_PACKAGES:BOOL=ON)

   6. The files that support building HDF5 filters with CMake are all the files in the
      config/cmake folder, the CMakeLists.txt files in each source folder, and
      CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing
      performed by The HDF Group. It should be altered for the user's
      installation and needs. The cacheinit.cmake file settings are used by
      The HDF Group for daily testing. It should be altered/ignored for the user's
      installation and needs.

   7. More information about using CMake can be found at the KitWare site,
         www.cmake.org.

   8. Nullsoft Scriptable Install System
      The Nullsoft Scriptable Install System (NSIS) is an open source installation
      system. It was created by the WinAmp authors to distribute that application,
      but it is now a general-purpose system which anyone might use. NSIS installers
      recognize /S for silent installation and /D=dir to specify the
      "output directory", which is where the program will be installed. These
      options are case-sensitive, so be sure to type them in upper case.

   9. WiX Toolset
      WiX--the Windows Installer XML toolset--lets developers create installers for
      Windows Installer, the Windows installation engine. See http://wixtoolset.org.


========================================================================
VI. CMake Option Defaults for HDF5 Filters
========================================================================

In the options listed below, there are three columns of information:
Option Name, Option Description, and Option Default.
The config/cmake/cacheinit.cmake file can override the following values.

---------------- General Build Options ---------------------
BUILD_SHARED_LIBS   "Build Shared Libraries"         ON
USE_SHARED_LIBS     "Use Shared Libraries"           ON
H5PL_BUILD_TESTING  "Build h5pl Unit Testing"        OFF
H5PL_CPACK_ENABLE   "Enable the CPACK include and components"     ON

---------------- HDF5 Filter Build Options ----------------
BUILD_TESTING                  "Build <filter> Unit Testing"      ON
BUILD_EXAMPLES                 "Build <filter> Examples"          ON
DISABLE_<filter>_ENCODER       "build the <filter> library without encoding"                 OFF

---------------- HDF5 Advanced Options ---------------------
HDF_DISABLE_COMPILER_WARNINGS  "Disable compiler warnings"                                    OFF
HDF_ENABLE_LARGE_FILE          "Enable support for large (64-bit) files on Linux."            ON
HDF_NO_PACKAGES                "Do not include CPack Packaging"                               OFF
HDF_PACK_EXAMPLES              "Package the HDF5 Library Examples Compressed File"            OFF
HDFPL_USE_FOLDERS              "Enable folder grouping of projects in IDEs."                  ON
HDF5_MSVC_NAMING_CONVENTION    "Use MSVC Naming conventions for Shared Libraries"             OFF

if (APPLE)
    <filter>_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF
    <filter>_PACK_MACOSX_FRAMEWORK   "Package the <filter> Library in a Frameworks"                 OFF
    <filter>_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE

---------------- External Library Options ---------------------
HDF_PACKAGE_EXTLIBS         "CPACK - include external libraries"                OFF
H5PL_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)"      "NO"
ENABLE_<filter>             "Enable Library Building for <filter> plugin"       ON
HDF_<filter>_USE_EXTERNAL   "Use External Library Building for <filter> plugin" 0

------ BLOSC ------
HDF_ENABLE_BLOSC_SUPPORT    "Enable blosc"                                   ON
HDF_ENABLE_Z_LIB_SUPPORT    "Enable Zlib Filters"                            OFF
ZLIB_USE_EXTERNAL           "Use External Library Building for ZLIB"         1
BLOSC_USE_EXTERNAL          "Use External Library Building for BLOSC"        1

------ BSHUF ------
BUILD_LZ4_LIBRARY_SOURCE    "build the lz4 library within the plugin"        ON
BUILD_BSHUF_LIBRARY_SOURCE  "build the bitshuffle library within the plugin" ON
LZ4_USE_EXTERNAL            "Use External Library Building for LZ4"          1
BSHUF_USE_EXTERNAL          "Use External Library Building for BSHUF"        1

------ BZIP2 ------
BZ2_USE_EXTERNAL            "Use External Library Building for BZ2"          1

------ JPEG ------
JPEG_USE_EXTERNAL           "Use External Library Building for JPEG"         1

------ LZ4 ------
BUILD_LZ4_LIBRARY_SOURCE    "build the lz4 library within the plugin"        ON
LZ4_USE_EXTERNAL            "Use External Library Building for LZ4"          1

------ LZF ------
LZF_USE_EXTERNAL            "Use External Library Building for LZF"          1

------ MAFISC ------
COND_MAIN_ENCODER           "Enable encoding"                ON
COND_MAIN_DECODER           "Enable decoding"                ON
COND_CHECK_CRC32            "Enable check crc32"             ON
COND_CHECK_CRC64            "Enable check crc64"             ON
COND_CHECK_SHA256           "Enable check sha256"            ON
COND_FILTER_LZ              "Enable lz filter"               ON
COND_ENCODER_LZ             "Enable lz encoder"              ON
COND_DECODER_LZ             "Enable lz decoder"              ON
COND_FILTER_LZMA1           "Enable lzma1 filter"            ON
COND_ENCODER_LZMA1          "Enable lzma1 encoder"           ON
COND_DECODER_LZMA1          "Enable lzma1 decoder"           ON
COND_ENCODER_LZMA2          "Enable lzma2 encoder"           ON
COND_DECODER_LZMA2          "Enable lzma2 decoder"           ON
COND_FILTER_DELTA           "Enable delta filter"            ON
COND_ENCODER_SIMPLE         "Enable delta encoder"           ON
COND_DECODER_DELTA          "Enable delta decoder"           ON
COND_FILTER_SIMPLE          "Enable simple filter"           ON
COND_ENCODER_SIMPLE         "Enable simple encoder"          ON
COND_DECODER_SIMPLE         "Enable simple decoder"          ON
BUILD_MAFISC_LIBRARY_SOURCE "build the mafisc library within the plugin"     ON
MAFISC_USE_EXTERNAL         "Use External Library Building for MAFISC"       1

------ SZF ------
BUILD_SZF_LIBRARY_SOURCE    "build the szf library within the plugin"        ON
SZF_USE_EXTERNAL            "Use External Library Building for SZF"          1

------ ZFP ------
COND_MAIN_ENCODER           "Enable encoding"                ON
COND_MAIN_DECODER           "Enable decoding"                ON
COND_CHECK_CRC32            "Enable check crc32"             ON
COND_CHECK_CRC64            "Enable check crc64"             ON
COND_CHECK_SHA256           "Enable check sha256"            ON
COND_FILTER_LZ              "Enable lz filter"               ON
COND_ENCODER_LZ             "Enable lz encoder"              ON
COND_DECODER_LZ             "Enable lz decoder"              ON
COND_FILTER_LZMA1           "Enable lzma1 filter"            ON
COND_ENCODER_LZMA1          "Enable lzma1 encoder"           ON
COND_DECODER_LZMA1          "Enable lzma1 decoder"           ON
COND_ENCODER_LZMA2          "Enable lzma2 encoder"           ON
COND_DECODER_LZMA2          "Enable lzma2 decoder"           ON
COND_FILTER_DELTA           "Enable delta filter"            ON
COND_ENCODER_SIMPLE         "Enable delta encoder"           ON
COND_DECODER_DELTA          "Enable delta decoder"           ON
COND_FILTER_SIMPLE          "Enable simple filter"           ON
COND_ENCODER_SIMPLE         "Enable simple encoder"          ON
COND_DECODER_SIMPLE         "Enable simple decoder"          ON
ZFP_USE_EXTERNAL            "Use External Library Building for ZFP"          0



========================================================================
For further assistance, send email to help@hdfgroup.org
========================================================================

