2021-08-26 19:50:05 +08:00
|
|
|
#!/bin/bash
|
2021-08-01 14:37:01 +08:00
|
|
|
|
2021-08-26 19:50:05 +08:00
|
|
|
cmd=${1}
|
|
|
|
package=netcdfcxx_legacy
|
|
|
|
address=/opt/stow
|
2021-08-02 22:13:24 +08:00
|
|
|
targetdir=/usr/local
|
2021-08-01 14:37:01 +08:00
|
|
|
|
2021-08-26 19:50:05 +08:00
|
|
|
if [[ ${cmd} == "configure" && ! -d "build/" ]]; then
|
|
|
|
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
|
|
|
|
elif [[ ${cmd} == "configure" ]]; then
|
|
|
|
cd build && rm -rf * && cmake .. -DCMAKE_INSTALL_PREFIX=${address}/${package} -DCMAKE_BUILD_TYPE=Release
|
|
|
|
elif [[ ${cmd} == "build" ]]; then
|
2021-08-01 14:37:01 +08:00
|
|
|
cd build && make
|
2021-08-26 19:50:05 +08:00
|
|
|
elif [[ ${cmd} == "install" ]]; then
|
2021-08-01 14:37:01 +08:00
|
|
|
cd build && sudo make install
|
2021-08-26 19:50:05 +08:00
|
|
|
sudo stow --dir=${address} --target=${targetdir} ${package}
|
2021-08-01 14:37:01 +08:00
|
|
|
fi
|