cmake: pass VERSION to project() + don't use SDL_VERSION

This commit is contained in:
Anonymous Maarten 2023-01-09 14:11:54 +01:00 committed by Anonymous Maarten
parent 3aa456dead
commit 9cf34908a1
5 changed files with 25 additions and 35 deletions

View file

@ -25,10 +25,7 @@ not_ok () {
failed=1
}
major=$(sed -ne 's/^set(SDL_MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
minor=$(sed -ne 's/^set(SDL_MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
micro=$(sed -ne 's/^set(SDL_MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
version="${major}.${minor}.${micro}"
version=$(sed -Ene 's/^project\(SDL[0-9]+ LANGUAGES C CXX VERSION "([0-9.]*)"\)$/\1/p' CMakeLists.txt)
if [ "$ref_version" = "$version" ]; then
ok "CMakeLists.txt $version"