]> git.lizzy.rs Git - minetest.git/commitdiff
Check minimum Irrlicht version before build
authorsfan5 <sfan5@live.de>
Thu, 21 Jul 2022 18:58:04 +0000 (20:58 +0200)
committersfan5 <sfan5@live.de>
Sat, 23 Jul 2022 20:27:19 +0000 (22:27 +0200)
CMakeLists.txt

index 09e3dcccd1f1481a1b54fd9c7e67adb36f1c3d96..9bec15c1b039df251e75d0a6c79cb88c76aa74be 100644 (file)
@@ -117,8 +117,20 @@ else()
        endif()
 endif()
 
-if(TARGET IrrlichtMt::IrrlichtMt)
+if(BUILD_CLIENT AND TARGET IrrlichtMt::IrrlichtMt)
+       # retrieve version somehow
+       if(NOT IrrlichtMt_VERSION)
+               get_target_property(IrrlichtMt_VERSION IrrlichtMt VERSION)
+       endif()
        message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}")
+
+       set(TARGET_VER_S 1.9.0mt7)
+       string(REPLACE "mt" "." TARGET_VER ${TARGET_VER_S})
+       if(IrrlichtMt_VERSION VERSION_LESS ${TARGET_VER})
+               message(FATAL_ERROR "At least IrrlichtMt ${TARGET_VER_S} is required to build")
+       elseif(NOT DEVELOPMENT_BUILD AND IrrlichtMt_VERSION VERSION_GREATER ${TARGET_VER})
+               message(FATAL_ERROR "IrrlichtMt ${TARGET_VER_S} is required to build")
+       endif()
 endif()