From 91c9313c87bfec8b44e5adb91b06aba9f343dd53 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 18 Feb 2021 14:50:47 +0100 Subject: Switch Irrlicht dependency to our own fork -> https://github.com/minetest/irrlicht --- CMakeLists.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'CMakeLists.txt') 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 -- cgit v1.2.3