# CMakeLists.txt for Irrlicht in STK if(NOT SERVER_ONLY) find_package(PNG REQUIRED) find_package(JPEG REQUIRED) find_package(ZLIB REQUIRED) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/" "${JPEG_INCLUDE_DIR}" "${PNG_INCLUDE_DIRS}" "${ZLIB_INCLUDE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../src") if(NOT USE_GLES2) find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) endif() else() include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/" "${CMAKE_CURRENT_SOURCE_DIR}/../../src") find_package(ZLIB REQUIRED) include_directories("${ZLIB_INCLUDE_DIR}") add_definitions(-DNO_IRR_COMPILE_WITH_LIBPNG_) add_definitions(-DNO_IRR_COMPILE_WITH_LIBJPEG_) add_definitions(-DNO_IRR_COMPILE_WITH_BMP_LOADER_) add_definitions(-DNO_IRR_COMPILE_WITH_PNG_LOADER_) add_definitions(-DNO_IRR_COMPILE_WITH_JPG_LOADER_) add_definitions(-DNO_IRR_COMPILE_WITH_BMP_WRITER_) add_definitions(-DNO_IRR_COMPILE_WITH_PNG_WRITER_) add_definitions(-DNO_IRR_COMPILE_WITH_JPG_WRITER_) add_definitions(-DNO_IRR_COMPILE_WITH_OPENGL_) add_definitions(-DNO_IRR_COMPILE_WITH_X11_) add_definitions(-DNO_IRR_COMPILE_WITH_WAYLAND_DEVICE_) add_definitions(-DNO_IRR_COMPILE_WITH_SDL_DEVICE_) endif() if(APPLE AND NOT IOS) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/source/Irrlicht/MacOSX" "${CMAKE_CURRENT_SOURCE_DIR}/source/Irrlicht") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -F/Library/Frameworks") endif() add_definitions(-DNDEBUG=1 -DIRRLICHT_EXPORTS=1 -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES) if(UNIX OR MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") endif() if(WIN32) add_definitions(-D_IRR_STATIC_LIB_) add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Shut up about unsafe stuff else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pipe -fstrict-aliasing") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pipe -fstrict-aliasing") endif() if(USE_GLES2) if (NOT IOS) add_definitions(-D_IRR_COMPILE_WITH_OGLES2_) endif() add_definitions(-DNO_IRR_COMPILE_WITH_OPENGL_) endif() if(CYGWIN) add_definitions(-DNO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) endif() set(IRRLICHT_SOURCES source/Irrlicht/CAnimatedMeshSceneNode.cpp source/Irrlicht/CAttributes.cpp source/Irrlicht/CBillboardSceneNode.cpp source/Irrlicht/CBoneSceneNode.cpp source/Irrlicht/CCameraSceneNode.cpp source/Irrlicht/CColorConverter.cpp source/Irrlicht/CCubeSceneNode.cpp source/Irrlicht/CDefaultGUIElementFactory.cpp source/Irrlicht/CDefaultSceneNodeAnimatorFactory.cpp source/Irrlicht/CDefaultSceneNodeFactory.cpp source/Irrlicht/CDummyTransformationSceneNode.cpp source/Irrlicht/CEmptySceneNode.cpp source/Irrlicht/CFileList.cpp source/Irrlicht/CFileSystem.cpp source/Irrlicht/CFPSCounter.cpp source/Irrlicht/CGeometryCreator.cpp source/Irrlicht/CGUIButton.cpp source/Irrlicht/CGUICheckBox.cpp source/Irrlicht/CGUIColorSelectDialog.cpp source/Irrlicht/CGUIComboBox.cpp source/Irrlicht/CGUIContextMenu.cpp source/Irrlicht/CGUIEditBox.cpp source/Irrlicht/CGUIEnvironment.cpp source/Irrlicht/CGUIFileOpenDialog.cpp source/Irrlicht/CGUIFont.cpp source/Irrlicht/CGUIImage.cpp source/Irrlicht/CGUIImageList.cpp source/Irrlicht/CGUIInOutFader.cpp source/Irrlicht/CGUIListBox.cpp source/Irrlicht/CGUIMenu.cpp source/Irrlicht/CGUIMeshViewer.cpp source/Irrlicht/CGUIMessageBox.cpp source/Irrlicht/CGUIModalScreen.cpp source/Irrlicht/CGUIScrollBar.cpp source/Irrlicht/CGUISkin.cpp source/Irrlicht/CGUISpinBox.cpp source/Irrlicht/CGUISpriteBank.cpp source/Irrlicht/CGUIStaticText.cpp source/Irrlicht/CGUITabControl.cpp source/Irrlicht/CGUITable.cpp source/Irrlicht/CGUIToolBar.cpp source/Irrlicht/CGUITreeView.cpp source/Irrlicht/CGUIWindow.cpp source/Irrlicht/CImage.cpp source/Irrlicht/CImageLoaderBMP.cpp source/Irrlicht/CImageLoaderJPG.cpp source/Irrlicht/CImageLoaderPNG.cpp source/Irrlicht/CImageLoaderSVG.cpp source/Irrlicht/CImageWriterBMP.cpp source/Irrlicht/CImageWriterJPG.cpp source/Irrlicht/CImageWriterPNG.cpp source/Irrlicht/CIrrDeviceSDL.cpp source/Irrlicht/CIrrDeviceServer.cpp source/Irrlicht/CIrrDeviceStub.cpp source/Irrlicht/CLightSceneNode.cpp source/Irrlicht/CLimitReadFile.cpp source/Irrlicht/CLogger.cpp source/Irrlicht/CMemoryFile.cpp source/Irrlicht/CMeshCache.cpp source/Irrlicht/CMeshManipulator.cpp source/Irrlicht/CMeshSceneNode.cpp source/Irrlicht/CMetaTriangleSelector.cpp source/Irrlicht/CMountPointReader.cpp source/Irrlicht/CNullDriver.cpp source/Irrlicht/COctreeSceneNode.cpp source/Irrlicht/COctreeTriangleSelector.cpp source/Irrlicht/COGLES2Driver.cpp source/Irrlicht/COGLES2ExtensionHandler.cpp source/Irrlicht/COGLES2FixedPipelineRenderer.cpp source/Irrlicht/COGLES2MaterialRenderer.cpp source/Irrlicht/COGLES2NormalMapRenderer.cpp source/Irrlicht/COGLES2ParallaxMapRenderer.cpp source/Irrlicht/COGLES2Renderer2D.cpp source/Irrlicht/COGLES2Texture.cpp source/Irrlicht/COpenGLDriver.cpp source/Irrlicht/COpenGLExtensionHandler.cpp source/Irrlicht/COpenGLParallaxMapRenderer.cpp source/Irrlicht/COpenGLShaderMaterialRenderer.cpp source/Irrlicht/COpenGLSLMaterialRenderer.cpp source/Irrlicht/COpenGLTexture.cpp source/Irrlicht/COSOperator.cpp source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.cpp source/Irrlicht/CParticleAttractionAffector.cpp source/Irrlicht/CParticleBoxEmitter.cpp source/Irrlicht/CParticleCylinderEmitter.cpp source/Irrlicht/CParticleFadeOutAffector.cpp source/Irrlicht/CParticleGravityAffector.cpp source/Irrlicht/CParticleMeshEmitter.cpp source/Irrlicht/CParticlePointEmitter.cpp source/Irrlicht/CParticleRingEmitter.cpp source/Irrlicht/CParticleRotationAffector.cpp source/Irrlicht/CParticleScaleAffector.cpp source/Irrlicht/CParticleSphereEmitter.cpp source/Irrlicht/CParticleSystemSceneNode.cpp source/Irrlicht/CReadFile.cpp source/Irrlicht/CSceneCollisionManager.cpp source/Irrlicht/CSceneManager.cpp source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp source/Irrlicht/CSceneNodeAnimatorDelete.cpp source/Irrlicht/CSceneNodeAnimatorFlyCircle.cpp source/Irrlicht/CSceneNodeAnimatorFlyStraight.cpp source/Irrlicht/CSceneNodeAnimatorFollowSpline.cpp source/Irrlicht/CSceneNodeAnimatorRotation.cpp source/Irrlicht/CSceneNodeAnimatorTexture.cpp source/Irrlicht/CSkinnedMesh.cpp source/Irrlicht/CSkyBoxSceneNode.cpp source/Irrlicht/CSkyDomeSceneNode.cpp source/Irrlicht/CSphereSceneNode.cpp source/Irrlicht/CTarReader.cpp source/Irrlicht/CTerrainSceneNode.cpp source/Irrlicht/CTerrainTriangleSelector.cpp source/Irrlicht/CTextSceneNode.cpp source/Irrlicht/CTriangleBBSelector.cpp source/Irrlicht/CTriangleSelector.cpp source/Irrlicht/CVideoModeList.cpp source/Irrlicht/CWaterSurfaceSceneNode.cpp source/Irrlicht/CWriteFile.cpp source/Irrlicht/CXMLReader.cpp source/Irrlicht/CXMLWriter.cpp source/Irrlicht/CZBuffer.cpp source/Irrlicht/CZipReader.cpp source/Irrlicht/Irrlicht.cpp source/Irrlicht/irrXML.cpp source/Irrlicht/os.cpp source/Irrlicht/COpenGLNormalMapRenderer.cpp source/Irrlicht/CAnimatedMeshSceneNode.h source/Irrlicht/CAttributeImpl.h source/Irrlicht/CAttributes.h source/Irrlicht/CBillboardSceneNode.h source/Irrlicht/CBlit.h source/Irrlicht/CBoneSceneNode.h source/Irrlicht/CCameraSceneNode.h source/Irrlicht/CColorConverter.h source/Irrlicht/CCubeSceneNode.h source/Irrlicht/CDefaultGUIElementFactory.h source/Irrlicht/CDefaultSceneNodeAnimatorFactory.h source/Irrlicht/CDefaultSceneNodeFactory.h source/Irrlicht/CDummyTransformationSceneNode.h source/Irrlicht/CEmptySceneNode.h source/Irrlicht/CFileList.h source/Irrlicht/CFileSystem.h source/Irrlicht/CFPSCounter.h source/Irrlicht/CGeometryCreator.h source/Irrlicht/CGUIButton.h source/Irrlicht/CGUICheckBox.h source/Irrlicht/CGUIColorSelectDialog.h source/Irrlicht/CGUIComboBox.h source/Irrlicht/CGUIContextMenu.h source/Irrlicht/CGUIEditBox.h source/Irrlicht/CGUIEnvironment.h source/Irrlicht/CGUIFileOpenDialog.h source/Irrlicht/CGUIFont.h source/Irrlicht/CGUIImage.h source/Irrlicht/CGUIImageList.h source/Irrlicht/CGUIInOutFader.h source/Irrlicht/CGUIListBox.h source/Irrlicht/CGUIMenu.h source/Irrlicht/CGUIMeshViewer.h source/Irrlicht/CGUIMessageBox.h source/Irrlicht/CGUIModalScreen.h source/Irrlicht/CGUIScrollBar.h source/Irrlicht/CGUISkin.h source/Irrlicht/CGUISpinBox.h source/Irrlicht/CGUISpriteBank.h source/Irrlicht/CGUIStaticText.h source/Irrlicht/CGUITabControl.h source/Irrlicht/CGUITable.h source/Irrlicht/CGUIToolBar.h source/Irrlicht/CGUITreeView.h source/Irrlicht/CGUIWindow.h source/Irrlicht/CImage.h source/Irrlicht/CImageLoaderBMP.h source/Irrlicht/CImageLoaderJPG.h source/Irrlicht/CImageLoaderPNG.h source/Irrlicht/CImageLoaderSVG.h source/Irrlicht/CImageWriterBMP.h source/Irrlicht/CImageWriterJPG.h source/Irrlicht/CImageWriterPNG.h source/Irrlicht/CIrrDeviceSDL.h source/Irrlicht/CIrrDeviceServer.h source/Irrlicht/CIrrDeviceStub.h source/Irrlicht/CLightSceneNode.h source/Irrlicht/CLimitReadFile.h source/Irrlicht/CLogger.h source/Irrlicht/CMemoryFile.h source/Irrlicht/CMeshCache.h source/Irrlicht/CMeshManipulator.h source/Irrlicht/CMeshSceneNode.h source/Irrlicht/CMetaTriangleSelector.h source/Irrlicht/CMountPointReader.h source/Irrlicht/CNullDriver.h source/Irrlicht/COctreeSceneNode.h source/Irrlicht/COctreeTriangleSelector.h source/Irrlicht/COGLES2Driver.h source/Irrlicht/COGLES2ExtensionHandler.h source/Irrlicht/COGLES2FixedPipelineRenderer.h source/Irrlicht/COGLES2MaterialRenderer.h source/Irrlicht/COGLES2NormalMapRenderer.h source/Irrlicht/COGLES2ParallaxMapRenderer.h source/Irrlicht/COGLES2Renderer2D.h source/Irrlicht/COGLES2Texture.h source/Irrlicht/COpenGLDriver.h source/Irrlicht/COpenGLExtensionHandler.h source/Irrlicht/COpenGLMaterialRenderer.h source/Irrlicht/COpenGLParallaxMapRenderer.h source/Irrlicht/COpenGLShaderMaterialRenderer.h source/Irrlicht/COpenGLSLMaterialRenderer.h source/Irrlicht/COpenGLTexture.h source/Irrlicht/COSOperator.h source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h source/Irrlicht/CParticleAttractionAffector.h source/Irrlicht/CParticleBoxEmitter.h source/Irrlicht/CParticleCylinderEmitter.h source/Irrlicht/CParticleFadeOutAffector.h source/Irrlicht/CParticleGravityAffector.h source/Irrlicht/CParticleMeshEmitter.h source/Irrlicht/CParticlePointEmitter.h source/Irrlicht/CParticleRingEmitter.h source/Irrlicht/CParticleRotationAffector.h source/Irrlicht/CParticleScaleAffector.h source/Irrlicht/CParticleSphereEmitter.h source/Irrlicht/CParticleSystemSceneNode.h source/Irrlicht/CReadFile.h source/Irrlicht/CSceneCollisionManager.h source/Irrlicht/CSceneManager.h source/Irrlicht/CSceneNodeAnimatorCameraFPS.h source/Irrlicht/CSceneNodeAnimatorCameraMaya.h source/Irrlicht/CSceneNodeAnimatorCollisionResponse.h source/Irrlicht/CSceneNodeAnimatorDelete.h source/Irrlicht/CSceneNodeAnimatorFlyCircle.h source/Irrlicht/CSceneNodeAnimatorFlyStraight.h source/Irrlicht/CSceneNodeAnimatorFollowSpline.h source/Irrlicht/CSceneNodeAnimatorRotation.h source/Irrlicht/CSceneNodeAnimatorTexture.h source/Irrlicht/CSkinnedMesh.h source/Irrlicht/CSkyBoxSceneNode.h source/Irrlicht/CSkyDomeSceneNode.h source/Irrlicht/CSphereSceneNode.h source/Irrlicht/CTarReader.h source/Irrlicht/CTerrainSceneNode.h source/Irrlicht/CTerrainTriangleSelector.h source/Irrlicht/CTextSceneNode.h source/Irrlicht/CTimer.h source/Irrlicht/CTriangleBBSelector.h source/Irrlicht/CTriangleSelector.h source/Irrlicht/CVideoModeList.h source/Irrlicht/CWaterSurfaceSceneNode.h source/Irrlicht/CWriteFile.h source/Irrlicht/CXMLReader.h source/Irrlicht/CXMLReaderImpl.h source/Irrlicht/CXMLWriter.h source/Irrlicht/CZBuffer.h source/Irrlicht/CZipReader.h source/Irrlicht/dmfsupport.h source/Irrlicht/gles2-ext.h source/Irrlicht/glext.h source/Irrlicht/glxext.h source/Irrlicht/IAttribute.h source/Irrlicht/IImagePresenter.h source/Irrlicht/ISceneNodeAnimatorFinishing.h source/Irrlicht/ITriangleRenderer.h source/Irrlicht/IZBuffer.h source/Irrlicht/MacOSX/AppDelegate.h source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h source/Irrlicht/MacOSX/OSXClipboard.h source/Irrlicht/Octree.h source/Irrlicht/os.h source/Irrlicht/resource.h source/Irrlicht/S2DVertex.h source/Irrlicht/S4DVertex.h source/Irrlicht/SoftwareDriver2_compile_config.h source/Irrlicht/SoftwareDriver2_helper.h source/Irrlicht/wglext.h source/Irrlicht/COpenGLNormalMapRenderer.h include/aabbox3d.h include/CDynamicMeshBuffer.h include/CIndexBuffer.h include/CMeshBuffer.h include/coreutil.h include/CVertexBuffer.h include/dimension2d.h include/driverChoice.h include/EAttributes.h include/ECullingTypes.h include/EDebugSceneTypes.h include/EDeviceTypes.h include/EDriverFeatures.h include/EDriverTypes.h include/EGUIAlignment.h include/EGUIElementTypes.h include/EHardwareBufferFlags.h include/EMaterialFlags.h include/EMaterialTypes.h include/EMeshWriterEnums.h include/EMessageBoxFlags.h include/EPrimitiveTypes.h include/ESceneNodeAnimatorTypes.h include/ESceneNodeTypes.h include/EShaderTypes.h include/ETerrainElements.h include/EVertexAttributes.h include/fast_atof.h include/heapsort.h include/IAnimatedMesh.h include/IAnimatedMeshSceneNode.h include/IAttributeExchangingObject.h include/IAttributes.h include/IBillboardSceneNode.h include/IBillboardTextSceneNode.h include/IBoneSceneNode.h include/ICameraSceneNode.h include/ICursorControl.h include/IDummyTransformationSceneNode.h include/IDynamicMeshBuffer.h include/IEventReceiver.h include/IFileArchive.h include/IFileList.h include/IFileSystem.h include/IGeometryCreator.h include/IGPUProgrammingServices.h include/IGUIButton.h include/IGUICheckBox.h include/IGUIColorSelectDialog.h include/IGUIComboBox.h include/IGUIContextMenu.h include/IGUIEditBox.h include/IGUIElementFactory.h include/IGUIElement.h include/IGUIEnvironment.h include/IGUIFileOpenDialog.h include/IGUIFontBitmap.h include/IGUIFont.h include/IGUIImage.h include/IGUIImageList.h include/IGUIInOutFader.h include/IGUIListBox.h include/IGUIMeshViewer.h include/IGUIScrollBar.h include/IGUISkin.h include/IGUISpinBox.h include/IGUISpriteBank.h include/IGUIStaticText.h include/IGUITabControl.h include/IGUITable.h include/IGUIToolbar.h include/IGUITreeView.h include/IGUIWindow.h include/IImage.h include/IImageLoader.h include/IImageWriter.h include/IIndexBuffer.h include/ILightManager.h include/ILightSceneNode.h include/ILogger.h include/IMaterialRenderer.h include/IMaterialRendererServices.h include/IMeshBuffer.h include/IMeshCache.h include/IMesh.h include/IMeshLoader.h include/IMeshManipulator.h include/IMeshSceneNode.h include/IMeshWriter.h include/IMetaTriangleSelector.h include/IOSOperator.h include/IParticleAffector.h include/IParticleAnimatedMeshSceneNodeEmitter.h include/IParticleAttractionAffector.h include/IParticleBoxEmitter.h include/IParticleCylinderEmitter.h include/IParticleEmitter.h include/IParticleFadeOutAffector.h include/IParticleGravityAffector.h include/IParticleMeshEmitter.h include/IParticleRingEmitter.h include/IParticleRotationAffector.h include/IParticleSphereEmitter.h include/IParticleSystemSceneNode.h include/IRandomizer.h include/IReadFile.h include/IReferenceCounted.h include/irrAllocator.h include/irrArray.h include/IrrCompileConfig.h include/IrrlichtDevice.h include/irrlicht.h include/irrList.h include/irrMap.h include/irrMath.h include/irrpack.h include/irrString.h include/irrTypes.h include/irrunpack.h include/irrXML.h include/ISceneCollisionManager.h include/ISceneLoader.h include/ISceneManager.h include/ISceneNodeAnimatorCameraFPS.h include/ISceneNodeAnimatorCameraMaya.h include/ISceneNodeAnimatorCollisionResponse.h include/ISceneNodeAnimatorFactory.h include/ISceneNodeAnimator.h include/ISceneNodeFactory.h include/ISceneNode.h include/ISceneUserDataSerializer.h include/IShaderConstantSetCallBack.h include/ISkinnedMesh.h include/ITerrainSceneNode.h include/ITextSceneNode.h include/ITexture.h include/ITimer.h include/ITriangleSelector.h include/IVertexBuffer.h include/IVideoDriver.h include/IVideoModeList.h include/IWriteFile.h include/IXMLReader.h include/IXMLWriter.h include/Keycodes.h include/line2d.h include/line3d.h include/matrix4.h include/path.h include/plane3d.h include/position2d.h include/quaternion.h include/rect.h include/S3DVertex.h include/SAnimatedMesh.h include/SceneParameters.h include/SColor.h include/SExposedVideoData.h include/SIrrCreationParameters.h include/SKeyMap.h include/SLight.h include/SMaterial.h include/SMaterialLayer.h include/SMeshBuffer.h include/SMeshBufferLightMap.h include/SMeshBufferTangents.h include/SMesh.h include/SParticle.h include/SSharedMeshBuffer.h include/SSkinMeshBuffer.h include/SVertexIndex.h include/SVertexManipulator.h include/SViewFrustum.h include/triangle3d.h include/vector2d.h include/vector3d.h ) if(IOS) set(IRRLICHT_SOURCES ${IRRLICHT_SOURCES} source/Irrlicht/CIrrDeviceiOS.mm source/Irrlicht/CIrrDeviceiOS.h) set_source_files_properties(source/Irrlicht/CIrrDeviceiOS.mm PROPERTIES COMPILE_FLAGS "-x objective-c++ -O3 -fno-rtti") set_source_files_properties(source/Irrlicht/CIrrDeviceiOS.mm PROPERTIES LANGUAGE C) endif() add_library(stkirrlicht STATIC ${IRRLICHT_SOURCES}) target_link_libraries(stkirrlicht ${ZLIB_LIBRARY}) if(NOT SERVER_ONLY) target_link_libraries(stkirrlicht ${PNG_LIBRARY} ${JPEG_LIBRARY}) endif() if(WIN32) target_link_libraries(stkirrlicht) endif()