CMake: Filter out project patch version == '0'

This commit is contained in:
Alexander Akulich 2023-11-03 21:22:24 +03:00
parent dbfe8887a9
commit 80a4ad5293

View file

@ -22,7 +22,11 @@ else()
message(FATAL_ERROR "Couldn't parse version from src/game/version.h")
endif()
project(DDNet VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
if(VERSION_PATCH STREQUAL "0")
project(DDNet VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
else()
project(DDNet VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
endif()
set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
set(ORIGINAL_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})