wareck 2 years ago
parent
commit
366223d662
1 changed files with 41 additions and 1 deletions
  1. 41 1
      options/build_gerbera.sh

+ 41 - 1
options/build_gerbera.sh

@@ -58,7 +58,7 @@ function version {
 echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
 echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }';
 }
 }
 
 
-function cmake_ {
+function cmake_old {
 echo -e "$(tput setaf 10)\nInstall cmake:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nInstall cmake:$(tput sgr0)"
 if [ -x "$(command -v cmake)" ];then flag=1; else flag=0;fi
 if [ -x "$(command -v cmake)" ];then flag=1; else flag=0;fi
 case $flag in
 case $flag in
@@ -87,6 +87,46 @@ case $flag in
 esac
 esac
 }
 }
 
 
+function cmake_ {
+echo -e "$(tput setaf 10)\nInstall cmake:$(tput sgr0)"
+if [ -x "$(command -v cmake)" ];then flag=1; else flag=0;fi
+case $flag in
+0)
+	wget -c https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz
+	tar xvfz cmake-3.25.2.tar.gz
+	cd cmake-3.25.2
+	./bootstrap
+	make
+	sudo make install
+	cd ..
+	rm -r -f cmake-3.25.2
+	rm cmake-3.25.2.tar.gz
+        ;;
+1)
+        cmake_v="$(cmake --version | grep "version" | awk '{print $3}')"
+        echo "cmake version : $cmake_v"
+        sleep 2
+        if ! [ $(version $cmake_v) -ge $(version "3.18") ]
+        then
+        echo -e "cmake need update =>:"
+	wget -c https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz
+        tar xvfz cmake-3.25.2.tar.gz
+        cd cmake-3.25.2
+        ./bootstrap
+        make
+        sudo make install
+        cd ..
+        rm -r -f cmake-3.25.2
+        rm cmake-3.25.2.tar.gz
+        else
+        echo -e "cmake version ok."
+        sleep 2
+        fi
+        ;;
+*)      echo "Error";;
+esac
+}
+
 function build_ {
 function build_ {
 echo -e "$(tput setaf 10)\nBuild Gerbera:$(tput sgr0)"
 echo -e "$(tput setaf 10)\nBuild Gerbera:$(tput sgr0)"