diff options
author | Allen Winter <allen.winter@kdab.com> | 2021-02-06 08:45:33 -0500 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2021-04-11 12:58:56 -0400 |
commit | 7f3186ef7bef208543f09fd1b2b6fef97d070a69 (patch) | |
tree | c0e0fee312297bbbc5b5585c61c621048ad1a64a /scripts | |
parent | 0f5b92f0879fb0b4fda68bdc4c40ffbd0d1f6103 (diff) | |
download | libical-git-7f3186ef7bef208543f09fd1b2b6fef97d070a69.tar.gz |
scripts/buildtests.sh - improve CMake version calculation
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/buildtests.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/buildtests.sh b/scripts/buildtests.sh index 3167779a..dff3bcdb 100755 --- a/scripts/buildtests.sh +++ b/scripts/buildtests.sh @@ -528,6 +528,18 @@ then # read the min required CMake version from the top-level CMake file minCMakeVers=`grep -i cmake_minimum_required $TOP/CMakeLists.txt | grep VERSION | sed 's/^.*VERSION\s*//i' | cut -d. -f1-2 | sed 's/\s*).*$//'` # adjust PATH + X=`echo $minCMakeVers | cut -d. -f1` + Y=`echo $minCMakeVers | cut -d. -f2` + if ( test -z $X -o -z $Y ) + then + echo "Bad CMake version encountered in the $TOP/CMakeLists.txt" + exit 1 + fi + Z=`echo $minCMakeVers | cut -d. -f3` + if ( test -z $Z ) + then + minCMakeVers="$minCMakeVers.0" + fi export PATH=/usr/local/opt/cmake-$minCMakeVers/bin:$PATH # check the version if ( test `cmake --version | head -1 | grep -c $minCMakeVers` -ne 1 ) |