]> git.lizzy.rs Git - irrlicht.git/blobdiff - source/Irrlicht/CMakeLists.txt
Avoid reskinning joints for animated meshes twice for each frame.
[irrlicht.git] / source / Irrlicht / CMakeLists.txt
index 6e716afd5aeb63be82816c0b82ecd5259dcacaeb..208b5733fad7f781ed9ea01ca33f921ffcfefc01 100644 (file)
@@ -18,10 +18,42 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
        set(CMAKE_CXX_FLAGS_DEBUG "-g")
 
        add_compile_options(-Wall -pipe -fno-exceptions -fno-rtti)
+
+       # Enable SSE for floating point math on 32-bit x86 by default
+       # reasoning see minetest issue #11810 and https://gcc.gnu.org/wiki/FloatingPointMath
+       if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+               include(CheckCXXSourceCompiles)
+               check_cxx_source_compiles("#ifndef __i686__\n#error\n#endif\nint main(){}" IS_I686)
+               if(IS_I686)
+                       message(STATUS "Detected Intel x86: using SSE instead of x87 FPU")
+                       add_compile_options(-mfpmath=sse -msse)
+               endif()
+       endif()
+
 elseif(MSVC)
        string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " msvcrt.lib") # ???? fuck off
 
        add_compile_options(/GR- /Zl)
+
+       # Enable SSE for floating point math on 32-bit x86 by default
+       # reasoning see minetest issue #11810 and https://gcc.gnu.org/wiki/FloatingPointMath
+       if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+               add_compile_options(/arch:SSE)
+       endif()
+endif()
+
+# Sanity-check version
+
+include(CheckCXXSourceCompiles)
+set(CMAKE_REQUIRED_INCLUDES ${PROJECT_SOURCE_DIR}/include)
+unset(REVISION_SANITY_CHECK CACHE)
+check_cxx_source_compiles("#include <IrrCompileConfig.h>\n\
+#if IRRLICHT_VERSION_MT_REVISION != ${IRRLICHTMT_REVISION}\n\
+#error\n\
+#endif\n\
+int main() {}" REVISION_SANITY_CHECK)
+if(NOT REVISION_SANITY_CHECK)
+       message(FATAL_ERROR "IrrlichtMt revision number mismatches between CMake and headers.")
 endif()
 
 # Required libs
@@ -30,13 +62,17 @@ find_package(ZLIB REQUIRED)
 find_package(JPEG REQUIRED)
 find_package(PNG REQUIRED)
 
-# To configure the features available in this Irrlicht build please edit
-# include/IrrCompileConfig.h and re-run CMake from a clean state
+# To configure the features available in this Irrlicht build please edit include/IrrCompileConfig.h.
 include(CheckSymbolExists)
 set(CMAKE_REQUIRED_INCLUDES ${PROJECT_SOURCE_DIR}/include)
 unset(OGLES1_ENABLED CACHE)
 unset(OGLES2_ENABLED CACHE)
 unset(OGL_ENABLED CACHE)
+unset(XINPUT2_ENABLED CACHE)
+unset(SDL_ENABLED CACHE)
+
+# tell cmake about the dependency
+set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_REQUIRED_INCLUDES}/IrrCompileConfig.h)
 
 check_symbol_exists(_IRR_COMPILE_WITH_OGLES1_ "IrrCompileConfig.h" OGLES1_ENABLED)
 if(OGLES1_ENABLED)
@@ -55,6 +91,14 @@ if(OGL_ENABLED)
        set(OpenGL_GL_PREFERENCE "LEGACY")
        find_package(OpenGL REQUIRED)
 endif()
+if(UNIX AND NOT ANDROID AND NOT APPLE)
+       check_symbol_exists(_IRR_LINUX_X11_XINPUT2_ "IrrCompileConfig.h" XINPUT2_ENABLED)
+endif()
+check_symbol_exists(_IRR_COMPILE_WITH_SDL_DEVICE_ "IrrCompileConfig.h" SDL_ENABLED)
+if(SDL_ENABLED)
+       find_package(SDL2 CONFIG REQUIRED)
+       message(STATUS "Found SDL2: ${SDL2_LIBRARIES}")
+endif()
 
 # Platform-specific libs
 
@@ -69,6 +113,9 @@ elseif(APPLE)
 else()
        # Unix probably
        find_package(X11 REQUIRED)
+       if(XINPUT2_ENABLED AND NOT X11_Xi_FOUND)
+               message(FATAL_ERROR "XInput not found")
+       endif()
 endif()
 
 set(link_includes
@@ -78,6 +125,7 @@ set(link_includes
        "${ZLIB_INCLUDE_DIR}"
        "${JPEG_INCLUDE_DIR}"
        "${PNG_INCLUDE_DIR}"
+       "${SDL2_INCLUDE_DIRS}"
 
        ${OPENGL_INCLUDE_DIR}
        ${OPENGLES2_INCLUDE_DIR}
@@ -91,6 +139,7 @@ set(link_libs
        "${ZLIB_LIBRARY}"
        "${JPEG_LIBRARY}"
        "${PNG_LIBRARY}"
+       "${SDL2_LIBRARIES}"
 
        ${OPENGL_LIBRARIES}
        ${OPENGLES_LIBRARY}
@@ -103,7 +152,7 @@ set(link_libs
        "$<$<PLATFORM_ID:Windows>:gdi32>"
        "$<$<PLATFORM_ID:Windows>:winmm>"
        ${X11_X11_LIB}
-       ${X11_Xxf86vm_LIB}
+       ${X11_Xi_LIB}
 )
 
 # Source files
@@ -128,17 +177,15 @@ add_library(IRROBJ OBJECT
        CDummyTransformationSceneNode.cpp
        CEmptySceneNode.cpp
        CMeshManipulator.cpp
+       CSceneCollisionManager.cpp
        CSceneManager.cpp
        CMeshCache.cpp
-       CDefaultSceneNodeFactory.cpp
 )
 
 set(IRRDRVROBJ
        CNullDriver.cpp
        COpenGLCacheHandler.cpp
        COpenGLDriver.cpp
-       COpenGLNormalMapRenderer.cpp
-       COpenGLParallaxMapRenderer.cpp
        COpenGLShaderMaterialRenderer.cpp
        COpenGLSLMaterialRenderer.cpp
        COpenGLExtensionHandler.cpp
@@ -148,13 +195,12 @@ set(IRRDRVROBJ
        COGLES2ExtensionHandler.cpp
        COGLES2FixedPipelineRenderer.cpp
        COGLES2MaterialRenderer.cpp
-       COGLES2NormalMapRenderer.cpp
-       COGLES2ParallaxMapRenderer.cpp
        COGLES2Renderer2D.cpp
        CWebGL1Driver.cpp
        CGLXManager.cpp
        CWGLManager.cpp
        CEGLManager.cpp
+       CSDLManager.cpp
        mt_opengl_loader.cpp
 )
 
@@ -164,12 +210,12 @@ set(IRRIMAGEOBJ
        CImageLoaderBMP.cpp
        CImageLoaderJPG.cpp
        CImageLoaderPNG.cpp
+       CImageLoaderTGA.cpp
        CImageWriterJPG.cpp
        CImageWriterPNG.cpp
 )
 
 add_library(IRRVIDEOOBJ OBJECT
-       CVideoModeList.cpp
        CFPSCounter.cpp
        ${IRRDRVROBJ}
        ${IRRIMAGEOBJ}
@@ -183,24 +229,18 @@ add_library(IRRIOOBJ OBJECT
        CReadFile.cpp
        CWriteFile.cpp
        CZipReader.cpp
-       CMountPointReader.cpp
        CAttributes.cpp
 )
 
 add_library(IRROTHEROBJ OBJECT
        CIrrDeviceSDL.cpp
        CIrrDeviceLinux.cpp
-       CIrrDeviceConsole.cpp
        CIrrDeviceStub.cpp
        CIrrDeviceWin32.cpp
-       CIrrDeviceFB.cpp
        CLogger.cpp
        COSOperator.cpp
        Irrlicht.cpp
        os.cpp
-       leakHunter.cpp
-       CProfiler.cpp
-       utf8.cpp
 )
 
 if(ANDROID)
@@ -223,32 +263,18 @@ add_library(IRRGUIOBJ OBJECT
        CGUIButton.cpp
        CGUICheckBox.cpp
        CGUIComboBox.cpp
-       CGUIContextMenu.cpp
        CGUIEditBox.cpp
        CGUIEnvironment.cpp
        CGUIFileOpenDialog.cpp
        CGUIFont.cpp
        CGUIImage.cpp
-       CGUIInOutFader.cpp
        CGUIListBox.cpp
-       CGUIMenu.cpp
-       CGUIMeshViewer.cpp
-       CGUIMessageBox.cpp
-       CGUIModalScreen.cpp
        CGUIScrollBar.cpp
-       CGUISpinBox.cpp
        CGUISkin.cpp
        CGUIStaticText.cpp
        CGUITabControl.cpp
-       CGUITable.cpp
-       CGUIToolBar.cpp
-       CGUIWindow.cpp
-       CGUIColorSelectDialog.cpp
-       CDefaultGUIElementFactory.cpp
        CGUISpriteBank.cpp
        CGUIImageList.cpp
-       CGUITreeView.cpp
-       CGUIProfiler.cpp
 )
 
 # Library
@@ -284,7 +310,6 @@ endif()
 
 set_target_properties(IrrlichtMt PROPERTIES
        VERSION ${PROJECT_VERSION}
-       SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
 )
 
 if(WIN32)