2017-04-15 01:05:30 +08:00
|
|
|
# Visual Studio
|
2017-06-07 06:21:04 +08:00
|
|
|
VS=1
|
2017-07-14 00:40:07 +08:00
|
|
|
#VSSETUP=1
|
|
|
|
|
2017-07-16 03:03:35 +08:00
|
|
|
#export NCPATHDEBUG=1
|
|
|
|
|
2017-07-14 00:40:07 +08:00
|
|
|
if test "x$VSSETUP" = x1 ; then
|
|
|
|
CFG="Debug"
|
|
|
|
else
|
|
|
|
CFG="Release"
|
|
|
|
fi
|
2017-04-15 01:05:30 +08:00
|
|
|
|
2017-03-09 08:01:10 +08:00
|
|
|
# Is netcdf-4 and/or DAP enabled?
|
|
|
|
NC4=1
|
|
|
|
DAP=1
|
|
|
|
|
2017-04-15 01:05:30 +08:00
|
|
|
if test "x$VS" != x ; then
|
2017-03-09 08:01:10 +08:00
|
|
|
FLAGS="-DCMAKE_PREFIX_PATH=c:/tools/nccmake"
|
2017-04-15 01:05:30 +08:00
|
|
|
fi
|
2017-03-09 08:01:10 +08:00
|
|
|
FLAGS="$FLAGS -DCMAKE_INSTALL_PREFIX=d:/ignore"
|
|
|
|
|
|
|
|
if test "x$DAP" = x ; then
|
|
|
|
FLAGS="$FLAGS -DENABLE_DAP=false"
|
2017-04-04 11:39:44 +08:00
|
|
|
else
|
|
|
|
FLAGS="$FLAGS -DENABLE_DAP=true"
|
2017-03-09 08:01:10 +08:00
|
|
|
fi
|
|
|
|
if test "x$NC4" = x ; then
|
|
|
|
FLAGS="$FLAGS -DENABLE_NETCDF_4=false"
|
|
|
|
fi
|
|
|
|
FLAGS="$FLAGS -DENABLE_CONVERSION_WARNINGS=false"
|
|
|
|
FLAGS="$FLAGS -DENABLE_DAP_REMOTE_TESTS=true"
|
|
|
|
FLAGS="$FLAGS -DENABLE_TESTS=true"
|
|
|
|
FLAGS="$FLAGS -DENABLE_EXAMPLES=false"
|
|
|
|
#FLAGS="$FLAGS -DENABLE_HDF4=true"
|
2017-04-10 23:26:57 +08:00
|
|
|
FLAGS="$FLAGS -DENABLE_DYNAMIC_LOADING=false"
|
2017-03-09 08:01:10 +08:00
|
|
|
|
|
|
|
rm -fr build
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
|
2017-04-10 23:26:57 +08:00
|
|
|
NCLIB=`pwd`
|
|
|
|
|
2017-04-15 01:05:30 +08:00
|
|
|
if test "x$VS" != x ; then
|
|
|
|
# Visual Studio
|
|
|
|
NCLIB="${NCLIB}/build/liblib/$CFG"
|
|
|
|
export PATH="${NCLIB}:${PATH}"
|
|
|
|
cmake $FLAGS ..
|
2017-07-14 00:40:07 +08:00
|
|
|
if test "x$VSSETUP" = x ; then
|
2017-04-15 01:05:30 +08:00
|
|
|
cmake --build . --config ${CFG}
|
|
|
|
cmake --build . --config ${CFG} --target RUN_TESTS
|
2017-07-14 00:40:07 +08:00
|
|
|
fi
|
2017-04-15 01:05:30 +08:00
|
|
|
else
|
|
|
|
# GCC
|
|
|
|
NCLIB="${NCLIB}/build/liblib"
|
2017-04-10 23:26:57 +08:00
|
|
|
G="-GUnix Makefiles"
|
|
|
|
cmake "${G}" $FLAGS ..
|
|
|
|
make all
|
|
|
|
make test
|
2017-04-15 01:05:30 +08:00
|
|
|
fi
|
2017-04-10 23:26:57 +08:00
|
|
|
exit
|