diff --git a/components/core/tools/scripts/lib_install/centos-stream-9/install-all.sh b/components/core/tools/scripts/lib_install/centos-stream-9/install-all.sh index c50fb81cc7..a44de8130c 100755 --- a/components/core/tools/scripts/lib_install/centos-stream-9/install-all.sh +++ b/components/core/tools/scripts/lib_install/centos-stream-9/install-all.sh @@ -10,3 +10,6 @@ script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" "${script_dir}/install-prebuilt-packages.sh" "${script_dir}/install-packages-from-source.sh" + +# TODO: https://github.com/y-scope/clp/issues/795 +"${script_dir}/../check-cmake-version.sh" diff --git a/components/core/tools/scripts/lib_install/check-cmake-version.sh b/components/core/tools/scripts/lib_install/check-cmake-version.sh new file mode 100755 index 0000000000..d942b9ce98 --- /dev/null +++ b/components/core/tools/scripts/lib_install/check-cmake-version.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Exit on any error +set -e + +# Error on undefined variable +set -u + +# Get the installed cmake version string +cmake_version=$(cmake -E capabilities | jq --raw-output ".version.string") +cmake_major_version=$(cmake -E capabilities | jq --raw-output ".version.major") + +# Check if version is 4.0 or higher +if [[ "$cmake_major_version" -ge "4" ]]; then + echo "CMake version $cmake_version is currently unsupported (>= 4.0)." + exit 1 +fi diff --git a/components/core/tools/scripts/lib_install/macos/install-all.sh b/components/core/tools/scripts/lib_install/macos/install-all.sh index b7f16d1f30..b1d3605dca 100755 --- a/components/core/tools/scripts/lib_install/macos/install-all.sh +++ b/components/core/tools/scripts/lib_install/macos/install-all.sh @@ -7,9 +7,17 @@ set -e set -u brew update + +# Install CMake v3.31.6 as ANTLR and yaml-cpp do not yet support CMake v4+. +# See also: https://github.com/y-scope/clp/issues/795 +cmake_formula_path=/tmp/cmake.rb +curl --fail --location --show-error \ + https://raw.githubusercontent.com/Homebrew/homebrew-core/b4e46db74e74a8c1650b38b1da222284ce1ec5ce/Formula/c/cmake.rb \ + --output "${cmake_formula_path}" +brew install --formula "${cmake_formula_path}" + brew install \ boost \ - cmake \ coreutils \ fmt \ gcc \ @@ -32,3 +40,7 @@ brew install \ if ! command -v pkg-config ; then brew install pkg-config fi + +# TODO: https://github.com/y-scope/clp/issues/795 +script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +"${script_dir}/../check-cmake-version.sh" diff --git a/components/core/tools/scripts/lib_install/ubuntu-focal/install-all.sh b/components/core/tools/scripts/lib_install/ubuntu-focal/install-all.sh index e338a30d76..a44de8130c 100755 --- a/components/core/tools/scripts/lib_install/ubuntu-focal/install-all.sh +++ b/components/core/tools/scripts/lib_install/ubuntu-focal/install-all.sh @@ -8,5 +8,8 @@ set -u script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -"$script_dir"/install-prebuilt-packages.sh -"$script_dir"/install-packages-from-source.sh +"${script_dir}/install-prebuilt-packages.sh" +"${script_dir}/install-packages-from-source.sh" + +# TODO: https://github.com/y-scope/clp/issues/795 +"${script_dir}/../check-cmake-version.sh" diff --git a/components/core/tools/scripts/lib_install/ubuntu-jammy/install-all.sh b/components/core/tools/scripts/lib_install/ubuntu-jammy/install-all.sh index e338a30d76..a44de8130c 100755 --- a/components/core/tools/scripts/lib_install/ubuntu-jammy/install-all.sh +++ b/components/core/tools/scripts/lib_install/ubuntu-jammy/install-all.sh @@ -8,5 +8,8 @@ set -u script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -"$script_dir"/install-prebuilt-packages.sh -"$script_dir"/install-packages-from-source.sh +"${script_dir}/install-prebuilt-packages.sh" +"${script_dir}/install-packages-from-source.sh" + +# TODO: https://github.com/y-scope/clp/issues/795 +"${script_dir}/../check-cmake-version.sh"