mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
715a6fe5eb
were added to provide a path name converter from e.g. cygwin paths to e.g. windows paths. This is necessary because the shell scripts may produce cygwin paths, but the code may have been compiled with Visual Studio. Similar issues arise with Mingw. At appropriate places, and if using Visual Studio or Mingw, I added calls to the path conversion code. Apparently I forgot to find all the places where this conversion was needed. So this pr does the following: 1. Push the calls to the converter to the various libXXX directories and out of libdispatch/dfile.c. 2. Add conversion calls to other parts of the code like oc2. I also turns out that conversion code in dapcvt.c had a bug when handling DAP Byte type under visual studio. Notes: 1. there may still be places I missed that need to do path conversion. 2. need to make sure that calls to e.g. H5open also use converted path.
59 lines
1.1 KiB
CMake
59 lines
1.1 KiB
CMake
# Visual Studio
|
|
VS=1
|
|
#VSSETUP=1
|
|
|
|
if test "x$VSSETUP" = x1 ; then
|
|
CFG="Debug"
|
|
else
|
|
CFG="Release"
|
|
fi
|
|
|
|
# Is netcdf-4 and/or DAP enabled?
|
|
NC4=1
|
|
DAP=1
|
|
|
|
if test "x$VS" != x ; then
|
|
FLAGS="-DCMAKE_PREFIX_PATH=c:/tools/nccmake"
|
|
fi
|
|
FLAGS="$FLAGS -DCMAKE_INSTALL_PREFIX=d:/ignore"
|
|
|
|
if test "x$DAP" = x ; then
|
|
FLAGS="$FLAGS -DENABLE_DAP=false"
|
|
else
|
|
FLAGS="$FLAGS -DENABLE_DAP=true"
|
|
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"
|
|
FLAGS="$FLAGS -DENABLE_DYNAMIC_LOADING=false"
|
|
|
|
rm -fr build
|
|
mkdir build
|
|
cd build
|
|
|
|
NCLIB=`pwd`
|
|
|
|
if test "x$VS" != x ; then
|
|
# Visual Studio
|
|
NCLIB="${NCLIB}/build/liblib/$CFG"
|
|
export PATH="${NCLIB}:${PATH}"
|
|
cmake $FLAGS ..
|
|
if test "x$VSSETUP" = x ; then
|
|
cmake --build . --config ${CFG}
|
|
cmake --build . --config ${CFG} --target RUN_TESTS
|
|
fi
|
|
else
|
|
# GCC
|
|
NCLIB="${NCLIB}/build/liblib"
|
|
G="-GUnix Makefiles"
|
|
cmake "${G}" $FLAGS ..
|
|
make all
|
|
make test
|
|
fi
|
|
exit
|