[PATCH] Linux build with r2523

Archwyrm

07-12-2009 02:33:01

Hi, I have updated to the latest MyGUI and found a number of things amiss with building. Here follows a patch which addresses most of these issues. I'll explain why these changes are needed.

First off, you were finding dependencies before the options were defined, so the default value was not getting picked up. An additional improvement here would be to make each optional thing have the 'REQUIRED' flag so it is quite obvious when something is missing. For me, a Freetype header was not being found correctly because it wasn't in the assumed location and Freetype was not being searched for because the searching happended before the option got its default set. One might wonder why this is optional at all if the build breaks without FT2.

Next, the newest plugins don't build on Linux, so I have excluded them from building on Linux.

After successfully building and installing, none of the headers could be found. This was because the .pc file said they lived in /usr/include/MYGUI (taken from the project name) when they were actually getting installed in /usr/include/MyGUI (note the difference in case).

Next up, some other headers were missing as they weren't in the install manifest for some reason (could be more missing from there). OgrePlatform (and probably the other platform plugins too) did not have an install definition at all. That includes installing the library. I would probably also name this library differently. MyGUI.OgrePlatform is a bit odd (comes out as libMyGUI.OgrePlatform.a), maybe call it MyGUIOgrePlatform? Or MyGUI-OgrePlatform?

Finally, there are some non-binaries getting installed into bin (resources.cfg and settings.xml, IIRC). It would be good to prevent that. Eventually being able to install the tools like the LayoutEditor would be nice, and they would have to go somewhere or be handled differently, but there is not a good idea.

Anyway, keep up the good work. :)


Index: MyGUIEngine/MyGUIEngine.list
===================================================================
--- MyGUIEngine/MyGUIEngine.list (revision 2523)
+++ MyGUIEngine/MyGUIEngine.list (working copy)
@@ -1,4 +1,5 @@
set (HEADER_FILES
+ include/MyGUI_Allocator.h
include/MyGUI_DDItemInfo.h
include/MyGUI_IBItemInfo.h
include/MyGUI_MenuItemType.h
Index: MyGUIEngine/CMakeLists.txt
===================================================================
--- MyGUIEngine/CMakeLists.txt (revision 2523)
+++ MyGUIEngine/CMakeLists.txt (working copy)
@@ -37,5 +37,5 @@
# install MyGUIEngine
mygui_config_lib(${PROJECT_NAME})
install(FILES ${HEADER_FILES}
- DESTINATION include/MyGUI
+ DESTINATION include/MYGUI
)
Index: Plugins/CMakeLists.txt
===================================================================
--- Plugins/CMakeLists.txt (revision 2523)
+++ Plugins/CMakeLists.txt (working copy)
@@ -1,3 +1,9 @@
add_subdirectory(Plugin_StrangeButton)
-add_subdirectory(Plugin_HikariWidget)
-add_subdirectory(Plugin_AwesomiumWidget)
+
+if(WIN32)
+ add_subdirectory(Plugin_HikariWidget)
+endif(WIN32)
+
+if(WIN32 OR APPLE)
+ add_subdirectory(Plugin_AwesomiumWidget)
+endif(WIN32 OR APPLE)
Index: Platforms/Ogre/OgrePlatform/MyGUI.OgrePlatform.list
===================================================================
--- Platforms/Ogre/OgrePlatform/MyGUI.OgrePlatform.list (revision 2523)
+++ Platforms/Ogre/OgrePlatform/MyGUI.OgrePlatform.list (working copy)
@@ -1,4 +1,5 @@
set (HEADER_FILES
+ include/MyGUI_LastHeader.h
include/MyGUI_OgreDataManager.h
include/MyGUI_OgreDataStream.h
include/MyGUI_OgreDiagnostic.h
Index: Platforms/Ogre/OgrePlatform/CMakeLists.txt
===================================================================
--- Platforms/Ogre/OgrePlatform/CMakeLists.txt (revision 2523)
+++ Platforms/Ogre/OgrePlatform/CMakeLists.txt (working copy)
@@ -13,3 +13,8 @@

target_link_libraries(MyGUI.OgrePlatform ${OGRE_LIBRARIES})
link_directories(${OGRE_LIB_DIR})
+
+install(FILES ${HEADER_FILES}
+ DESTINATION include/MYGUI
+)
+mygui_install_target(MyGUI.OgrePlatform "")
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt (revision 2523)
+++ CMakeLists.txt (working copy)
@@ -81,8 +81,6 @@

# Add MyGUIEngine include path

-# Find dependencies
-include(Dependencies)
# definitions for samples
set(MYGUI_LIBRARIES MyGUIEngine)

@@ -138,6 +136,9 @@
3 - Win32 (Mouse) + OIS (Keyboard)"
)

+# Find dependencies
+include(Dependencies)
+
# global configs
include_directories(
${MYGUI_SOURCE_DIR}/MyGUIEngine/include

Altren

07-12-2009 11:44:20

Nice, thank you. I checked your changes and I will commit them today.
I have only one question - what was the reason for adding this file to MyGUI.OgrePlatform.list ?
--- Platforms/Ogre/OgrePlatform/MyGUI.OgrePlatform.list (revision 2523)
+++ Platforms/Ogre/OgrePlatform/MyGUI.OgrePlatform.list (working copy)
@@ -1,4 +1,5 @@
set (HEADER_FILES
+ include/MyGUI_LastHeader.h
include/MyGUI_OgreDataManager.h
include/MyGUI_OgreDataStream.h
include/MyGUI_OgreDiagnostic.h


[Edit] Commited. Thank you one more time. [/Edit]

Archwyrm

08-12-2009 00:40:49

Glad to help. :)

For the record, MyGUI_LastHeader.h is used by all the other Ogre platform includes, as I am sure you have seen by now.

By the way, I think it would be good if it were made more clear where you would like patches reported. For example, on SourceForge you have the patch tracker and Mantis (mostly unused), but it seems the patch tracker isn't being monitored since some time (this patch is still pending, apparently). Now, I know that you all watch the forum here quite carefully, but others would not. There is an option in SourceForge where you can set your "preferred support method" and it allows you to enter a URL (i.e.: pointing to this forum) and then you could disable the other things.

Then again, since MyGUI seems to be headed in a direction where it is not 'just' an Ogre plugin, maybe the forum here is not the best place for support and feedback. It is something to think about anyway. :)