Unverified Commit d9d33b5b authored by David Boucher's avatar David Boucher Committed by GitHub
Browse files

fix(cmake.sh): Compilation on Debian works better.

parent 7651f3ab
......@@ -60,7 +60,7 @@ First of all, check if you have these packages installed (Note that packages nam
If they are not installed, please intall them.
If you are on Centos 7 distribution, follow these steps:
$> git clone https://github.com/centreon/centreon-clib.git
$> cd centreon-clib && ./cmake.sh
$> cd build
......@@ -68,20 +68,18 @@ If you are on Centos 7 distribution, follow these steps:
If you are on an other distribution, then follow the steps bellow.
Once the sources of Centreon Clib extracted, create the *./build/*
directory and launch the CMake command. This will look for required
dependencies and print a summary of the compilation parameters if
everything went fine.
Once the sources of Centreon Clib extracted, create the *build/*
directory and from that directory launch the CMake command as proposed below:
$> cd centreon-clib
$> mkdir build && cd build
$> cmake -DWITH_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_PREFIX_LIB=/usr/lib64 -DWITH_TESTING=On ..
$> cmake -DWITH_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DWITH_PREFIX_LIB=/usr/lib64 -DWITH_TESTING=On ..
...
Now launch the compilation using the *make* command and then install the
software by running *make install* as priviledged user.
$> make
$> make
...
$> make install
......
......@@ -44,11 +44,17 @@ if [ -r /etc/centos-release ] ; then
done
elif [ -r /etc/issue ] ; then
maj=$(cat /etc/issue | awk '{print $1}')
version=$(cat /etc/issue | awk '{print $3}')
v=$(cmake --version)
if [[ $v =~ "version 3" ]] ; then
cmake='cmake'
elif [ $maj = "Debian" ] ; then
if dpkg -l --no-pager cmake ; then
if [ $version = "9" ] ; then
dpkg="dpkg"
else
dpkg="dpkg --no-pager"
fi
if $dpkg -l --no-pager cmake ; then
echo "Bad version of cmake..."
exit 1
else
......@@ -62,10 +68,12 @@ elif [ -r /etc/issue ] ; then
fi
pkgs=(
gcc
g++
ninja-build
pkg-config
)
for i in "${pkgs[@]}"; do
if ! dpkg -l --no-pager $i | grep "^ii" ; then
if ! $dpkg -l --no-pager $i | grep "^ii" ; then
if [ $my_id -eq 0 ] ; then
apt install -y $i
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment