summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-07-21 20:58:04 +0200
committersfan5 <sfan5@live.de>2022-07-23 22:27:19 +0200
commit7e78c0171ea2fec3594656a6abe44695b4252ba1 (patch)
tree62d04b300c577aa2d22179c913b08c5976f9c6ee
parent175e13257653b07df247422cebd3a6da5f29dc51 (diff)
downloadminetest-7e78c0171ea2fec3594656a6abe44695b4252ba1.tar.gz
minetest-7e78c0171ea2fec3594656a6abe44695b4252ba1.tar.bz2
minetest-7e78c0171ea2fec3594656a6abe44695b4252ba1.zip
Check minimum Irrlicht version before build
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09e3dcccd..9bec15c1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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()