summaryrefslogtreecommitdiffstats
path: root/bin/cmakehdf5
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cmakehdf5')
-rwxr-xr-xbin/cmakehdf567
1 files changed, 58 insertions, 9 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index 1f0fb7c..715d6d7 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -23,6 +23,7 @@ makelog="#${progname}_2build.log"
testlog="#${progname}_3test.log"
packlog="#${progname}_4pack.log"
installlog="#${progname}_5install.log"
+config_summary=libhdf5.settings
exit_code=0
# This command should be in the source directory's bin/
@@ -51,6 +52,7 @@ build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables zlib filter default off
+shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON # enables shared lib; default on
#=============
@@ -80,16 +82,14 @@ Usage: $progname [<options>]
enable or disable c++ API. Default is off.
--enable-hl | --disable-hl:
enable or disable high level API. Default is on.
+ --enable-shared | --disable-shared:
+ enable or disable shared lib. Default is on.
--enable-tools | --disable-tools:
enable or disable building tools. Default is on.
--enable-testing | --disable-testing:
enable or disable building tests. Default is on.
- --with-zlib=INC,LIB | --without-zlib:
+ --with-zlib | --without-zlib:
Use zlib library for external deflate I/O filter. Default is on.
- INC and LIB are the include and lib directories.
- --with-szlib=INC,LIB| --without-szlib:
- Use szip library for external szip library I/O filter. Default is off.
- INC and LIB are the include and lib directories.
--help: shows details help page
EOF
}
@@ -125,6 +125,40 @@ STEP()
}
+# Install the generated installation image file. Different platform uses
+# different image files.
+# Linux: HDF5-<version>-Linux.sh file
+# Mac OS X: Not implemented yet
+# Others: Not implemented yet
+INSTALL_HDF5()
+{
+ myos="`uname -s`"
+ case "$myos" in
+ Linux)
+ install_file=./HDF5-${version}-Linux.sh
+ $install_file --skip-license $*
+ ;;
+ Darwin) # Mac OSX DMG file
+ install_file=HDF5-${version}-Darwin.dmg
+ test -d hdf5 || mkdir hdf5
+ basename=`basename $install_file .dmg`
+ # mount the DMG file as /Volumes/$basename
+ # echo 'Y' as yes for license.
+ echo Y | hdiutil mount $install_file
+ # copy the contents to the install location
+ cp -R "/Volumes/$basename/HDF_Group" hdf5
+ # unmount the DMG file
+ hdiutil unmount /Volumes/$basename
+ ;;
+ *) # unknown/unsupported OS.
+ echo "INSTALL_HDF5: Error--unknown/unsupported OS($myos)"
+ return 1
+ ;;
+ esac
+ return 0
+}
+
+
#==========
# main
#==========
@@ -166,6 +200,12 @@ while [ $# -gt 0 ]; do
--disable-hl)
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=OFF
;;
+ --enable-shared)
+ shared_lib=-DBUILD_SHARED_LIBS:BOOL=ON
+ ;;
+ --disable-shared)
+ shared_lib=-DBUILD_SHARED_LIBS:BOOL=OFF
+ ;;
--enable-tools)
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON
;;
@@ -178,6 +218,12 @@ while [ $# -gt 0 ]; do
--disable-testing)
build_testing=-DBUILD_TESTING:BOOL=OFF
;;
+ --with-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
+ ;;
+ --without-zlib)
+ with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF
+ ;;
--help)
# print the detail help page and exit
HELP
@@ -212,20 +258,22 @@ if [ $? != 0 ]; then
echo $vers failed. Aborted.
exit 1
fi
-echo Running Cmake for HDF5-${version} ...
-
+echo Running Cmake for HDF5-${version} ...
# 4. Configure the C library, tools and tests with this command:
+# If successful, append the configure summary to the configure logfile.
STEP "Configure..." "cmake \
-C $cacheinit \
$build_cpp_lib \
$build_fortran \
$enable_f2003 \
$build_hl_lib \
+ $shared_lib \
$build_testing \
$build_tools \
$with_zlib \
$with_szlib \
- $srcdir" $configlog
+ $srcdir" $configlog &&\
+ cat $config_summary >> $configlog
# 5. Build the C library, tools and tests with this command:
STEP "Build the library, tools and tests, ..." "cmake --build . --config Release" $makelog
@@ -237,7 +285,8 @@ STEP "Test the library and tools..." "ctest . -C Release" $testlog
STEP "Create an install image..." "cpack -C Release CPackConfig.cmake" $packlog
# 8. Install with this command:
-STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
+#STEP "Install..." "./HDF5-${version}-Linux.sh --skip-license" $installlog
+STEP "Install..." "INSTALL_HDF5" $installlog
# save the last exit code
exit_code=$?