Skip to content

Commit

Permalink
etc: Update spdlog also when installed version does not match.
Browse files Browse the repository at this point in the history
  • Loading branch information
titan73 committed Dec 13, 2024
1 parent 05d867a commit f240797
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,19 @@ _installCommonDev() {

# spdlog
spdlogPrefix=${PREFIX:-"/usr/local"}
if [[ ! -d ${spdlogPrefix}/include/spdlog ]]; then
installed_version="none"
if [ -d ${spdlogPrefix}/include/spdlog ]; then
installed_version=`grep "#define SPDLOG_VER_" ${spdlogPrefix}/include/spdlog/version.h | sed 's/.*\s//' | tr '\n' '.' | sed 's/\.$//'`
fi
if [ ${installed_version} != ${spdlogVersion} ]; then
cd "${baseDir}"
git clone --depth=1 -b "v${spdlogVersion}" https://github.com/gabime/spdlog.git
cd spdlog
${cmakePrefix}/bin/cmake -DCMAKE_INSTALL_PREFIX="${spdlogPrefix}" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DSPDLOG_BUILD_EXAMPLE=OFF -B build .
${cmakePrefix}/bin/cmake --build build -j $(nproc) --target install
echo "spdlog ${spdlogVersion} installed (from ${installed_version})."
else
echo "spdlog already installed."
echo "spdlog ${spdlogVersion} already installed."
fi
CMAKE_PACKAGE_ROOT_ARGS+=" -D spdlog_ROOT=$(realpath $spdlogPrefix) "

Expand Down

0 comments on commit f240797

Please sign in to comment.