aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-05-13 18:06:47 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-05-13 18:06:47 +0200
commitf3e741dad1311e0b4057b530386e246f921be52c (patch)
tree64581e3f0ddfa9d4740eed7b545fe3db87b8c126 /cmake/Modules
parent96a37aed31cfb9c131e46eda80bdbe3d2289a546 (diff)
parent69c70dd319532f7860f211f4a527a902b0386e49 (diff)
downloaddragonfireclient-f3e741dad1311e0b4057b530386e246f921be52c.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/FindIrrlicht.cmake49
-rw-r--r--cmake/Modules/FindOpenGLES2.cmake3
2 files changed, 36 insertions, 16 deletions
diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake
index 8296de685..058e93878 100644
--- a/cmake/Modules/FindIrrlicht.cmake
+++ b/cmake/Modules/FindIrrlicht.cmake
@@ -1,36 +1,57 @@
-mark_as_advanced(IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR IRRLICHT_DLL)
+mark_as_advanced(IRRLICHT_DLL)
# Find include directory and libraries
-if(TRUE)
+# find our fork first, then upstream (TODO: remove this?)
+foreach(libname IN ITEMS IrrlichtMt Irrlicht)
+ string(TOLOWER "${libname}" libname2)
+
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
- DOC "Path to the directory with Irrlicht includes"
+ DOC "Path to the directory with IrrlichtMt includes"
PATHS
- /usr/local/include/irrlicht
- /usr/include/irrlicht
- /system/develop/headers/irrlicht #Haiku
- PATH_SUFFIXES "include/irrlicht"
+ /usr/local/include/${libname2}
+ /usr/include/${libname2}
+ /system/develop/headers/${libname2} #Haiku
+ PATH_SUFFIXES "include/${libname2}"
)
- find_library(IRRLICHT_LIBRARY NAMES libIrrlicht Irrlicht
- DOC "Path to the Irrlicht library file"
+ find_library(IRRLICHT_LIBRARY NAMES lib${libname} ${libname}
+ DOC "Path to the IrrlichtMt library file"
PATHS
/usr/local/lib
/usr/lib
/system/develop/lib # Haiku
)
-endif()
-# Users will likely need to edit these
-mark_as_advanced(CLEAR IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR)
+ if(IRRLICHT_INCLUDE_DIR OR IRRLICHT_LIBRARY)
+ break()
+ endif()
+endforeach()
+
+# Handholding for users
+if(IRRLICHT_INCLUDE_DIR AND (NOT IS_DIRECTORY "${IRRLICHT_INCLUDE_DIR}" OR
+ NOT EXISTS "${IRRLICHT_INCLUDE_DIR}/irrlicht.h"))
+ message(WARNING "IRRLICHT_INCLUDE_DIR was set to ${IRRLICHT_INCLUDE_DIR} "
+ "but irrlicht.h does not exist inside. The path will not be used.")
+ unset(IRRLICHT_INCLUDE_DIR CACHE)
+endif()
+if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux" OR APPLE)
+ # (only on systems where we're sure how a valid library looks like)
+ if(IRRLICHT_LIBRARY AND (IS_DIRECTORY "${IRRLICHT_LIBRARY}" OR
+ NOT IRRLICHT_LIBRARY MATCHES "\\.(a|so|dylib|lib)([.0-9]+)?$"))
+ message(WARNING "IRRLICHT_LIBRARY was set to ${IRRLICHT_LIBRARY} "
+ "but is not a valid library file. The path will not be used.")
+ unset(IRRLICHT_LIBRARY CACHE)
+ endif()
+endif()
# On Windows, find the DLL for installation
if(WIN32)
# If VCPKG_APPLOCAL_DEPS is ON, dll's are automatically handled by VCPKG
if(NOT VCPKG_APPLOCAL_DEPS)
- find_file(IRRLICHT_DLL NAMES Irrlicht.dll
- DOC "Path of the Irrlicht dll (for installation)"
+ find_file(IRRLICHT_DLL NAMES IrrlichtMt.dll
+ DOC "Path of the IrrlichtMt dll (for installation)"
)
endif()
endif(WIN32)
diff --git a/cmake/Modules/FindOpenGLES2.cmake b/cmake/Modules/FindOpenGLES2.cmake
index a47126705..ce04191dd 100644
--- a/cmake/Modules/FindOpenGLES2.cmake
+++ b/cmake/Modules/FindOpenGLES2.cmake
@@ -42,7 +42,7 @@ else()
)
include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(OPENGLES2 DEFAULT_MSG OPENGLES2_LIBRARY OPENGLES2_INCLUDE_DIR)
+ find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARY OPENGLES2_INCLUDE_DIR)
find_path(EGL_INCLUDE_DIR EGL/egl.h
PATHS /usr/openwin/share/include
@@ -59,7 +59,6 @@ else()
/usr/lib
)
- include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR)
endif()