Updated build script

This commit is contained in:
Ward Fisher 2012-11-27 18:49:19 +00:00
parent 7114d9021d
commit 87d71a9c15

View File

@ -1,35 +1,131 @@
#!/bin/bash #!/bin/bash
##### #####
# 32-bit # Function to check for error.
##### #####
CHECKERR () {
RDIR=/c/share/w32/static ERRCODE=$?
if [[ ! $TEST -eq 0 ]]; then
### echo "Error $ERRCODE caught. Exit."
# Static exit $ERRCODE
### fi
}
SHARED=OFF
#####
# # Function to do the building.
# Minimum #####
# DOBUILD () {
BTYPE="static"
BDIR="build_32_min_static" if [ x$SHARED = "xON" ]; then
NAME="4.2.x-No_DAP-No_HDF-static-snapshot" BTYPE="shared"
echo "Building $NAME" fi
mkdir $BDIR
cd $BDIR NAME="$VER-NC4$NC4-DAP$DAP-$BTYPE"
CMAKE_PREFIX_PATH=$RDIR cmake .. -DENABLE_NETCDF_4=OFF -DENABLE_DAP=OFF -DCPACK_PACKAGE_FILE_NAME=NetCDF-$NAME -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=$SHARED BDIR="build_$NAME"
cmake --build . echo "Building $NAME"
cmake --build . --target package
echo "Finished building $NAME" rm -rf $BDIR
mkdir $BDIR
# cd $BDIR
# NetCDF-4 CMAKE_PREFIX_PATH=$RESOURCE_DIR cmake .. -G"$CMAKEGEN" -DCPACK_PACKAGE_FILE_NAME=NetCDF-$NAME -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=$SHARED -DENABLE_DAP=$DAP -DENABLE_NETCDF_4=$NC4
# CHECKERR
# cmake --build .
# NetCDF-4, DAP CHECKERR
#
cmake --build . --target package
CHECKERR
mv -f *.zip *.dmg *.exe ../$INSTALLDIRS
cd ..
echo "Finished building $NAME"
}
#####
# Set up platform-specific variables
#####
unamestr=`uname`
VER="4.2.x-snapshot"
INSTALLDIRS="packages"
case $unamestr in
Darwin) echo "Configuring Darwin"
CMAKEGEN="Unix Makefiles"
;;
*) echo "Unknown platform: $unamestr"
exit 1
;;
esac
rm -rf $INSTALLDIRS
mkdir -p $INSTALLDIRS
#####
# 32-bit
#####
RESOURCE_DIR=/c/share/w32/static
PLTFRM="32"
###
# Static
###
SHARED=OFF
#
# Minimum
#
NC4="OFF"
DAP="OFF"
DOBUILD
#
# NetCDF-4
#
NC4="ON"
DAP="OFF"
DOBUILD
#
# NetCDF-4, DAP
#
NC4="ON"
DAP="ON"
DOBUILD
###
# Shared
###
SHARED=ON
#
# Minimum
#
NC4="OFF"
DAP="OFF"
DOBUILD
#
# NetCDF-4
#
NC4="ON"
DAP="OFF"
DOBUILD
#
# NetCDF-4, DAP
#
NC4="ON"
DAP="ON"
DOBUILD