diff options
author | Tony Theodore <tonyt@logyst.com> | 2016-08-02 20:34:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-02 20:34:33 (GMT) |
commit | b7c7b43d2c81bd80fbda2a6b4a6a7696a47530f4 (patch) | |
tree | 879df0e978bc69297d1bdd201947977556255076 | |
parent | b5d6fd519ee36dbd3bf1c71666cf7e60d62138de (diff) | |
parent | 290d85bfed05711359acf0bee85b85d417afebf8 (diff) | |
download | mxe-b7c7b43d2c81bd80fbda2a6b4a6a7696a47530f4.zip mxe-b7c7b43d2c81bd80fbda2a6b4a6a7696a47530f4.tar.gz mxe-b7c7b43d2c81bd80fbda2a6b4a6a7696a47530f4.tar.bz2 |
Merge pull request #1447 from Quintus/cegui-0.8
Upgrade CEGUI to 0.8.7
-rw-r--r-- | src/cegui-1-fixes.patch | 85 | ||||
-rw-r--r-- | src/cegui-test.cpp | 41 | ||||
-rw-r--r-- | src/cegui.mk | 113 |
3 files changed, 174 insertions, 65 deletions
diff --git a/src/cegui-1-fixes.patch b/src/cegui-1-fixes.patch new file mode 100644 index 0000000..cda415d --- /dev/null +++ b/src/cegui-1-fixes.patch @@ -0,0 +1,85 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tony Theodore <tonyt@logyst.com> +Date: Wed, 3 Aug 2016 03:19:48 +1000 +Subject: [PATCH] cegui: separate shared and static builds + +minimal workaround till correctly implemented upstream: +https://bitbucket.org/cegui/cegui/issues/1132/libxml2-based-xml-parser-fails-to#comment-29553011 + +diff --git a/cmake/CEGUIMacros.cmake b/cmake/CEGUIMacros.cmake +index 1111111..2222222 100644 +--- a/cmake/CEGUIMacros.cmake ++++ b/cmake/CEGUIMacros.cmake +@@ -49,7 +49,9 @@ endmacro() + # Add libs to a target, and correctly handles static versions of libs built by the project + # + macro (cegui_target_link_libraries _TARGET_NAME) +- target_link_libraries(${_TARGET_NAME} ${ARGN}) ++ if (CEGUI_BUILD_SHARED_CONFIGURATION) ++ target_link_libraries(${_TARGET_NAME} ${ARGN}) ++ endif() + + get_target_property(_TARGET_EXISTS ${_TARGET_NAME}_Static TYPE) + if (_TARGET_EXISTS) +@@ -167,8 +169,10 @@ macro (cegui_add_dependency _TARGET_NAME _DEP_NAME) + ########################################################################### + # NON-STATIC VERSION OF TARGET + ########################################################################### +- if (${_DEP_NAME}_DEFINITIONS) +- set_property( TARGET ${_TARGET_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${${_DEP_NAME}_DEFINITIONS} ) ++ if (CEGUI_BUILD_SHARED_CONFIGURATION) ++ if (${_DEP_NAME}_DEFINITIONS) ++ set_property( TARGET ${_TARGET_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${${_DEP_NAME}_DEFINITIONS} ) ++ endif() + endif() + if (${_DEP_NAME}_COMPILE_FLAGS) + set_property( TARGET ${_TARGET_NAME} APPEND PROPERTY COMPILE_FLAGS ${${_DEP_NAME}_COMPILE_FLAGS} ) +@@ -252,10 +256,12 @@ macro (cegui_add_library_impl _LIB_NAME _IS_MODULE _SOURCE_FILES_VAR _HEADER_FIL + ########################################################################### + # SHARED LIBRARY SET UP + ########################################################################### +- add_library(${_LIB_NAME} ${_LIB_TYPE} ${${_SOURCE_FILES_VAR}} ${${_HEADER_FILES_VAR}}) +- set_target_properties(${_LIB_NAME} PROPERTIES DEFINE_SYMBOL ${_CEGUI_EXPORT_DEFINE}) ++ if (CEGUI_BUILD_SHARED_CONFIGURATION) ++ add_library(${_LIB_NAME} ${_LIB_TYPE} ${${_SOURCE_FILES_VAR}} ${${_HEADER_FILES_VAR}}) ++ set_target_properties(${_LIB_NAME} PROPERTIES DEFINE_SYMBOL ${_CEGUI_EXPORT_DEFINE}) ++ endif() + +- if (NOT CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES) ++ if (NOT(CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES) AND CEGUI_BUILD_SHARED_CONFIGURATION) + # Starting with CMake 2.8.12 LINK_INTERFACE_LIBRARIES was renamed to INTERFACE_LINK_LIBRARIES + if (${CMAKE_VERSION} VERSION_GREATER 2.8.12 OR ${CMAKE_VERSION} VERSION_EQUAL 2.8.12) + set_target_properties(${_LIB_NAME} PROPERTIES +@@ -289,7 +295,7 @@ macro (cegui_add_library_impl _LIB_NAME _IS_MODULE _SOURCE_FILES_VAR _HEADER_FIL + # Do not version modules, since we dlopen these directly and need to know + # the name is what we think it will be (and not rely on symlinks which will + # not be installed always, but usually only as part of *-dev packages). +- if (NOT ${_IS_MODULE} AND NOT ANDROID) ++ if (NOT ${_IS_MODULE} AND NOT ANDROID AND CEGUI_BUILD_SHARED_CONFIGURATION) + if (NOT APPLE OR CEGUI_APPLE_DYLIB_SET_VERSION_INFO) + set_target_properties(${_LIB_NAME} PROPERTIES + VERSION ${CEGUI_ABI_VERSION} +@@ -308,11 +314,13 @@ macro (cegui_add_library_impl _LIB_NAME _IS_MODULE _SOURCE_FILES_VAR _HEADER_FIL + set(_CEGUI_LIB_DEST ${CEGUI_LIB_INSTALL_DIR}) + endif() + +- install(TARGETS ${_LIB_NAME} +- RUNTIME DESTINATION bin COMPONENT cegui_bin +- LIBRARY DESTINATION ${_CEGUI_LIB_DEST} COMPONENT cegui_lib +- ARCHIVE DESTINATION ${CEGUI_LIB_INSTALL_DIR} COMPONENT cegui_devel +- ) ++ if (CEGUI_BUILD_SHARED_CONFIGURATION) ++ install(TARGETS ${_LIB_NAME} ++ RUNTIME DESTINATION bin COMPONENT cegui_bin ++ LIBRARY DESTINATION ${_CEGUI_LIB_DEST} COMPONENT cegui_lib ++ ARCHIVE DESTINATION ${CEGUI_LIB_INSTALL_DIR} COMPONENT cegui_devel ++ ) ++ endif() + + if (CEGUI_BUILD_STATIC_CONFIGURATION) + install(TARGETS ${_LIB_NAME}_Static diff --git a/src/cegui-test.cpp b/src/cegui-test.cpp index 88c2cf1..1249f81 100644 --- a/src/cegui-test.cpp +++ b/src/cegui-test.cpp @@ -8,9 +8,9 @@ * and makes CEGUI draw an "in-game" window into it. ************************************************/ -#include <GL/freeglut.h> #include <CEGUI/CEGUI.h> -#include <CEGUI/RendererModules/OpenGL/CEGUIOpenGLRenderer.h> +#include <CEGUI/RendererModules/OpenGL/GLRenderer.h> +#include <GL/freeglut.h> // We’re lazy using namespace CEGUI; @@ -34,21 +34,21 @@ int main(int argc, char* argv[]) // Tell CEGUI where to find its resources DefaultResourceProvider* p_provider = static_cast<DefaultResourceProvider*>(System::getSingleton().getResourceProvider()); - p_provider->setResourceGroupDirectory("schemes", "../share/CEGUI/schemes"); - p_provider->setResourceGroupDirectory("imagesets", "../share/CEGUI/imagesets"); - p_provider->setResourceGroupDirectory("fonts", "../share/CEGUI/fonts"); - p_provider->setResourceGroupDirectory("layouts", "../share/CEGUI/layouts"); - p_provider->setResourceGroupDirectory("looknfeels", "../share/CEGUI/looknfeel"); - p_provider->setResourceGroupDirectory("lua_scripts", "../share/CEGUI/lua_scripts"); - p_provider->setResourceGroupDirectory("schemas", "../share/CEGUI/xml_schemas"); - p_provider->setResourceGroupDirectory("animations", "../share/CEGUI/animations"); + p_provider->setResourceGroupDirectory("schemes", "../share/cegui-0/schemes"); + p_provider->setResourceGroupDirectory("imagesets", "../share/cegui-0/imagesets"); + p_provider->setResourceGroupDirectory("fonts", "../share/cegui-0/fonts"); + p_provider->setResourceGroupDirectory("layouts", "../share/cegui-0/layouts"); + p_provider->setResourceGroupDirectory("looknfeels", "../share/cegui-0/looknfeel"); + p_provider->setResourceGroupDirectory("lua_scripts", "../share/cegui-0/lua_scripts"); + p_provider->setResourceGroupDirectory("schemas", "../share/cegui-0/xml_schemas"); + p_provider->setResourceGroupDirectory("animations", "../share/cegui-0/animations"); // Map the resource request to our provider - Imageset::setDefaultResourceGroup("imagesets"); - Font::setDefaultResourceGroup("fonts"); Scheme::setDefaultResourceGroup("schemes"); - WidgetLookManager::setDefaultResourceGroup("looknfeels"); + ImageManager::setImagesetDefaultResourceGroup("imagesets"); + Font::setDefaultResourceGroup("fonts"); WindowManager::setDefaultResourceGroup("layouts"); + WidgetLookManager::setDefaultResourceGroup("looknfeels"); ScriptModule::setDefaultResourceGroup("lua_scripts"); AnimationManager::setDefaultResourceGroup("animations"); XMLParser* p_parser = System::getSingleton().getXMLParser(); @@ -57,18 +57,21 @@ int main(int argc, char* argv[]) p_parser->setProperty("SchemaDefaultResourceGroup", "schemas"); // Configure the default window layouting - SchemeManager::getSingleton().create("TaharezLook.scheme"); - System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow"); + SchemeManager::getSingleton().createFromFile("TaharezLook.scheme"); + + // Mouse cursor + CEGUI::GUIContext& gui_context = CEGUI::System::getSingleton().getDefaultGUIContext(); + gui_context.getMouseCursor().setDefaultImage("TaharezLook/MouseArrow"); // Create the hypothetical CEGUI root window Window* p_root_window = WindowManager::getSingleton().createWindow("DefaultWindow", "root"); - System::getSingleton().setGUISheet(p_root_window); + gui_context.setRootWindow(p_root_window); // Create an actual framed window we can look onto FrameWindow* p_frame_window = static_cast<FrameWindow*>(WindowManager::getSingleton().createWindow("TaharezLook/FrameWindow", "testWindow")); - p_root_window->addChildWindow(p_frame_window); + p_root_window->addChild(p_frame_window); p_frame_window->setPosition(UVector2(UDim(0.25f, 0), UDim(0.25f, 0))); - p_frame_window->setSize(UVector2(UDim(0.5f, 0), UDim(0.5f, 0))); + p_frame_window->setSize(USize(UDim(0.5f, 0), UDim(0.5f, 0))); p_frame_window->setText("Hello World!"); // Enter main loop @@ -90,7 +93,7 @@ void main_loop() glutMainLoopEvent(); // Process events glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear the window background to a single color glFlush(); - System::getSingleton().renderGUI(); // Tell CEGUI to render all its stuff + CEGUI::System::getSingleton().renderAllGUIContexts(); // Tell CEGUI to render all its stuff glutSwapBuffers(); // Put the auxiliary rendering buffer onto the screen and make the screen the new auxiliary buffer. } } diff --git a/src/cegui.mk b/src/cegui.mk index b7073aa..ef68853 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -3,12 +3,12 @@ PKG := cegui $(PKG)_IGNORE := -$(PKG)_VERSION := 0.7.9 -$(PKG)_CHECKSUM := 7c3b264def08b46de749c2acaba363e907479d924612436f3bd09da2e474bb8c -$(PKG)_SUBDIR := CEGUI-$($(PKG)_VERSION) -$(PKG)_FILE := CEGUI-$($(PKG)_VERSION).tar.gz -$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/crayzedsgui/CEGUI%20Mk-2/$($(PKG)_VERSION)/$($(PKG)_FILE)?download -$(PKG)_DEPS := gcc expat freeglut freeimage freetype libxml2 pcre xerces +$(PKG)_VERSION := 9726a2b505fb +$(PKG)_CHECKSUM := 14b3da7f1f89693192cd9afbf2126f4519508245ed156de893828e31ce676e9e +$(PKG)_SUBDIR := $(PKG)-$(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$(PKG)-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := https://bitbucket.org/$(PKG)/$(PKG)/get/$($(PKG)_VERSION).tar.bz2 +$(PKG)_DEPS := gcc expat freeglut freeimage freetype libxml2 pcre xerces devil glm glew define $(PKG)_UPDATE $(WGET) -q -O- 'https://bitbucket.org/cegui/cegui/downloads' | \ @@ -18,48 +18,69 @@ define $(PKG)_UPDATE tail -1 endef +# track dev branch v0-8 until next release +define $(PKG)_UPDATE + $(WGET) -q -O- 'https://bitbucket.org/cegui/cegui/commits/branch/v0-8' | \ + $(SED) -n 's,.*cegui/cegui/commits/\([^?]\{12\}\).*at=.*,\1,p' | \ + head -1 +endef + +# Use pkg-config to set FREEIMAGE_LIB and GLEW_STATIC to prevent "_imp__" errors +# freeimage and xerces don't have shared builds - disable with $(CMAKE_STATIC_BOOL) define $(PKG)_BUILD - cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ - --enable-freetype \ - --enable-pcre \ - --enable-xerces-c \ - --enable-libxml \ - --enable-expat \ - --disable-corona \ - --disable-devil \ - --enable-freeimage \ - --disable-silly \ - --enable-tga \ - --disable-tinyxml \ - --enable-stb \ - --enable-opengl-renderer \ - --disable-ogre-renderer \ - --disable-irrlicht-renderer \ - --disable-directfb-renderer \ - --enable-null-renderer \ - --disable-samples \ - --disable-lua-module \ - --disable-python-module \ - PKG_CONFIG='$(TARGET)-pkg-config' \ - CFLAGS="`$(TARGET)-pkg-config --cflags glut freeimage`" \ - CXXFLAGS="`$(TARGET)-pkg-config --cflags glut freeimage`" \ - LDFLAGS="`$(TARGET)-pkg-config --libs glut freeimage`" - $(MAKE) -C '$(1)' -j '$(JOBS)' - $(SED) -i 's/Cflags:\(.*\)/Cflags: \1 -DCEGUI_STATIC/' '$(1)/cegui/CEGUI.pc' - $(MAKE) -C '$(1)' -j '$(JOBS)' install + cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ + -DCEGUI_BUILD_SHARED_CONFIGURATION=$(CMAKE_SHARED_BOOL) \ + -DCEGUI_BUILD_STATIC_CONFIGURATION=$(CMAKE_STATIC_BOOL) \ + -DCEGUI_BUILD_STATIC_FACTORY_MODULE=$(CMAKE_STATIC_BOOL) \ + -DCEGUI_INSTALL_PKGCONFIG=ON \ + -DCEGUI_SAMPLES_ENABLED=OFF \ + -DCEGUI_BUILD_TESTS=OFF \ + -DCEGUI_BUILD_APPLICATION_TEMPLATES=OFF \ + -DCEGUI_BUILD_LUA_MODULE=OFF \ + -DCEGUI_BUILD_PYTHON_MODULES=OFF \ + -DCEGUI_BUILD_XMLPARSER_XERCES=$(CMAKE_STATIC_BOOL) \ + -DCEGUI_BUILD_XMLPARSER_LIBXML2=OFF \ + -DCEGUI_BUILD_XMLPARSER_EXPAT=ON \ + -DCEGUI_BUILD_XMLPARSER_TINYXML=OFF \ + -DCEGUI_BUILD_XMLPARSER_RAPIDXML=OFF \ + -DCEGUI_BUILD_IMAGECODEC_CORONA=OFF \ + -DCEGUI_BUILD_IMAGECODEC_DEVIL=OFF \ + -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=$(CMAKE_STATIC_BOOL) \ + -DCEGUI_BUILD_IMAGECODEC_PVR=OFF \ + -DCEGUI_BUILD_IMAGECODEC_SDL2=OFF \ + -DCEGUI_BUILD_IMAGECODEC_SILLY=OFF \ + -DCEGUI_BUILD_IMAGECODEC_STB=ON \ + -DCEGUI_BUILD_IMAGECODEC_TGA=ON \ + -DCEGUI_BUILD_RENDERER_DIRECT3D10=ON \ + -DCEGUI_BUILD_RENDERER_DIRECT3D11=OFF \ + -DCEGUI_BUILD_RENDERER_DIRECT3D9=ON \ + -DCEGUI_BUILD_RENDERER_DIRECTFB=OFF \ + -DCEGUI_BUILD_RENDERER_IRRLICHT=OFF \ + -DCEGUI_BUILD_RENDERER_NULL=ON \ + -DCEGUI_BUILD_RENDERER_OGRE=OFF \ + -DCEGUI_BUILD_RENDERER_OPENGL=ON \ + -DCEGUI_BUILD_RENDERER_OPENGL3=ON \ + -DCEGUI_BUILD_RENDERER_OPENGLES=OFF \ + -DCMAKE_CXX_FLAGS="`$(TARGET)-pkg-config --cflags glew freeimage`" \ + $(SOURCE_DIR) + + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' VERBOSE=1 + $(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1 + + # reconfigure pc files + # https://bitbucket.org/cegui/cegui/issues/1135/pkg-config-files-not-installed-when-using#comment-29605718 + $(SED) -i 's/Requires:\(.*\)/Requires: \1 gl glew glut/' '$(PREFIX)/$(TARGET)/lib/pkgconfig/CEGUI-0-OPENGL.pc' + $(if $(BUILD_STATIC),\ + $(SED) -i 's#\(-lCEGUI.*-0\>\)#\1_Static#g' '$(PREFIX)/$(TARGET)/lib/pkgconfig/CEGUI-0'*.pc + (echo 'Libs: -lCEGUIFreeImageImageCodec_Static \ + -lCEGUIXercesParser_Static \ + -lCEGUICoreWindowRendererSet_Static';\ + echo 'Requires.private: freeimage freetype2 libpcre xerces-c';\ + echo 'Cflags.private: -DCEGUI_STATIC';\ + ) >> '$(PREFIX)/$(TARGET)/lib/pkgconfig/CEGUI-0.pc') '$(TARGET)-g++' \ -W -Wall -ansi -pedantic \ - '$(TEST_FILE)' \ - `'$(TARGET)-pkg-config' --cflags --libs CEGUI-OPENGL glut freetype2 libpcre` \ - -lCEGUIFreeImageImageCodec -lCEGUIXercesParser -lCEGUIFalagardWRBase \ - `'$(TARGET)-pkg-config' --libs --cflags freeimage xerces-c` \ - -o '$(PREFIX)/$(TARGET)/bin/test-cegui.exe' + '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-cegui.exe' \ + `$(TARGET)-pkg-config --cflags --libs CEGUI-0-OPENGL` endef - -$(PKG)_BUILD_x86_64-w64-mingw32 = - -$(PKG)_BUILD_SHARED = |