summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31e914c76..67a35fda9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,29 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# This is done here so that relative search paths are more reasonable
find_package(Irrlicht)
+if(BUILD_CLIENT AND NOT IRRLICHT_FOUND)
+ message(FATAL_ERROR "Irrlicht is required to build the client, but it was not found.")
+elseif(IRRLICHT_INCLUDE_DIR STREQUAL "")
+ message(FATAL_ERROR "Irrlicht headers are required to build the server, but none found.")
+endif()
+
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_INCLUDES ${IRRLICHT_INCLUDE_DIR})
+unset(HAS_FORKED_IRRLICHT CACHE)
+check_symbol_exists(IRRLICHT_VERSION_MT "IrrCompileConfig.h" HAS_FORKED_IRRLICHT)
+if(NOT HAS_FORKED_IRRLICHT)
+ string(CONCAT EXPLANATION_MSG
+ "Irrlicht found, but it is not Minetest's Irrlicht fork. "
+ "The Minetest team has forked Irrlicht to make their own customizations. "
+ "It can be found here: https://github.com/minetest/irrlicht")
+ if(BUILD_CLIENT)
+ message(FATAL_ERROR "${EXPLANATION_MSG}\n"
+ "Building the client with upstream Irrlicht is no longer possible.")
+ else()
+ message(WARNING "${EXPLANATION_MSG}\n"
+ "The server can still be built with upstream Irrlicht but this is DISCOURAGED.")
+ endif()
+endif()
# Installation