]> 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 b2e53eeececc900c3779e34726239bfe0fe58d6b..208b5733fad7f781ed9ea01ca33f921ffcfefc01 100644 (file)
@@ -42,14 +42,27 @@ elseif(MSVC)
        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
 
 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)
@@ -58,6 +71,9 @@ 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)
        # only tested on Android, probably works on Linux (is this needed anywhere else?)
@@ -75,11 +91,9 @@ if(OGL_ENABLED)
        set(OpenGL_GL_PREFERENCE "LEGACY")
        find_package(OpenGL REQUIRED)
 endif()
-check_symbol_exists(_IRR_LINUX_X11_XINPUT2_ "IrrCompileConfig.h" XINPUT2_ENABLED)
-if(XINPUT2_ENABLED)
-       find_library(XINPUT_LIBRARY Xi REQUIRED)
+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)
@@ -99,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
@@ -128,7 +145,6 @@ set(link_libs
        ${OPENGLES_LIBRARY}
        ${OPENGLES2_LIBRARIES}
        ${EGL_LIBRARY}
-       ${XINPUT_LIBRARY}
 
        "$<$<PLATFORM_ID:Android>:native_app_glue -landroid -llog>"
        ${COCOA_LIB}
@@ -136,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
@@ -164,7 +180,6 @@ add_library(IRROBJ OBJECT
        CSceneCollisionManager.cpp
        CSceneManager.cpp
        CMeshCache.cpp
-       CDefaultSceneNodeFactory.cpp
 )
 
 set(IRRDRVROBJ
@@ -185,6 +200,7 @@ set(IRRDRVROBJ
        CGLXManager.cpp
        CWGLManager.cpp
        CEGLManager.cpp
+       CSDLManager.cpp
        mt_opengl_loader.cpp
 )
 
@@ -200,7 +216,6 @@ set(IRRIMAGEOBJ
 )
 
 add_library(IRRVIDEOOBJ OBJECT
-       CVideoModeList.cpp
        CFPSCounter.cpp
        ${IRRDRVROBJ}
        ${IRRIMAGEOBJ}
@@ -214,23 +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
 )
 
 if(ANDROID)
@@ -253,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
@@ -314,7 +310,6 @@ endif()
 
 set_target_properties(IrrlichtMt PROPERTIES
        VERSION ${PROJECT_VERSION}
-       SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
 )
 
 if(WIN32)