Skip to content

Commit

Permalink
cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
laoshanxi committed Jul 8, 2021
1 parent 7bb2bce commit 8ee8076
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ if [ -f "/usr/bin/yum" ]; then
else
yum install git -y
fi
yum install -y make cmake cmake3 gcc-c++ libtool openldap-devel
if [[ -f "/usr/bin/cmake3" ]]; then
cp /usr/bin/cmake3 /usr/bin/cmake -f
fi
yum install -y make gcc-c++ libtool openldap-devel
yum install -y dos2unix wget which

#yum install -y boost169-devel boost169-static
Expand All @@ -57,7 +54,7 @@ elif [ -f "/usr/bin/apt" ]; then
#Ubuntu
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y dos2unix g++ git make zlib1g-dev cmake alien libldap2-dev
apt install -y dos2unix g++ git make zlib1g-dev alien libldap2-dev
#apt install -y libboost-all-dev libace-dev
#apt install -y libcpprest-dev liblog4cpp5-dev
apt install -y ruby ruby-dev rubygems
Expand All @@ -69,6 +66,7 @@ elif [ -f "/usr/bin/apt" ]; then
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
ruby -rnet/http -e "Net::HTTP.get URI('https://gem.fury.io')"
fi

# check libssl in case of openssl_update.sh not executed
if [[ -f "/usr/include/openssl/ssl.h" ]] || [[ -f "/usr/local/include/openssl/ssl.h" ]]; then
echo 'ssl installed'
Expand All @@ -80,6 +78,19 @@ else
fi
fi

# install cmake (depend on g++, make, openssl-devel)
# https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line
if [[ true ]]; then
version=3.20
build=5
$WGWT_A https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/
./bootstrap
make -j 6
make install
fi

#install fpm
gem install fpm

Expand Down Expand Up @@ -108,11 +119,7 @@ git clone --depth=1 -b 2.10.18 https://github.com/microsoft/cpprestsdk.git cppre
cd cpprestsdk
git submodule update --init
cd Release
CMAKE=/usr/bin/cmake
if [ -f "/usr/bin/cmake3" ]; then
CMAKE=/usr/bin/cmake3
fi
$CMAKE .. -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/usr/local -DBUILD_SHARED_LIBS=1 -DCMAKE_CXX_FLAGS="-Wno-error=cast-align -Wno-error=conversion -Wno-error=missing-field-initializers"
cmake .. -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/usr/local -DBUILD_SHARED_LIBS=1 -DCMAKE_CXX_FLAGS="-Wno-error=cast-align -Wno-error=conversion -Wno-error=missing-field-initializers"
make
make install
ls -al /usr/local/lib*/libcpprest.so
Expand Down

0 comments on commit 8ee8076

Please sign in to comment.