Senzin
15-04-2013 03:26:38
Environment:
MyGUI 3.2.0
Ogre SDK 1.8.1
VS 2010
CMake 2.8.9
Initial configure (cmake-gui):
I'm using the Ogre SDK. When I first configure CMake, it says it found freetype, Ogre and Doxygen. SVN_EXECUTABLE is not found. OGRE_BUILD and OGRE_SOURCE are empty.
Precompiled headers:
When I run NMake on this, it fails immediately on MyGUI_Button.cpp saying it cannot open precompiled header "MyGUI_Precompiled.pch". A solution on the forums is to run NMake with /i to ignore errors. This results in NMake eventually making its way to the "precompiled" headers and compiling them.
Boost:
When I run NMake again without ignoring errors, it gets to about 30% and then fails on MyGUI_OgreDataManager.cpp, saying it cannot open file "boost/thread/tss.hpp". The Compilation Instructions say to manually set BOOST_ROOT if Ogre was built with Boost. I add a BOOST_ROOT entry to the configuration and point it to the boost folder inside the Ogre SDK folder (path\OgreSDK_vc10_v1-8-1\boost). But when I generate, CMake gives a warning that the manually-specified variable was not used by the project. Sure enough, NMake still fails at the same place.
On a whim, I download the Ogre 1.8.1 source (note that I did NOT compile Ogre from source). I point OGRE_SOURCE to the folder and hit configure. Three new entries appear in the CMake configuration: BOOST_ROOT, Boost_DIR, and Boost_LIB_DIAGNOSTIC_DEFINITIONS. I once again point BOOST_ROOT to the boost folder inside the Ogre SDK (path\OgreSDK_vc10_v1-8-1\boost), configure and generate. There are lots of warnings of type C4193 and C4275. However, the next error is NOT related to Boost.
Error RC1103: invalid option, /fp:fast
/fp:fast is definitely an option in Visual Studio under Code Generation, so I don't know what this is about. If I turn off Demos and Tools in the CMake config, compilation goes to completion and the lib and dll files are created.
Visual Studio 2010:
So I decide to make a new build directory and I tell CMake to create a Visual Studio 10 project instead of NMake. I again have failed builds, but not related to precompiled headers. Once I employ the Boost solution above, the builds go fine, along with the Demos and Tools.
Conclusions:
So I just wanted to tell my little story here in the hopes that others trying to compile MyGUI might have an easier time. I also hope the creators of MyGUI might be able to tweak the CMake settings and the Compilation Instructions to avoid these problems in the future.
Also, it might be a good idea to simply make an SDK with working libs and dlls of MyGUI 3.2.0 for Ogre 1.8.1. Over the years, I've found there is no better way than building libraries from source yourself to guarantee the introduction of subtle errors and doubt.
MyGUI 3.2.0
Ogre SDK 1.8.1
VS 2010
CMake 2.8.9
Initial configure (cmake-gui):
I'm using the Ogre SDK. When I first configure CMake, it says it found freetype, Ogre and Doxygen. SVN_EXECUTABLE is not found. OGRE_BUILD and OGRE_SOURCE are empty.
Precompiled headers:
When I run NMake on this, it fails immediately on MyGUI_Button.cpp saying it cannot open precompiled header "MyGUI_Precompiled.pch". A solution on the forums is to run NMake with /i to ignore errors. This results in NMake eventually making its way to the "precompiled" headers and compiling them.
Boost:
When I run NMake again without ignoring errors, it gets to about 30% and then fails on MyGUI_OgreDataManager.cpp, saying it cannot open file "boost/thread/tss.hpp". The Compilation Instructions say to manually set BOOST_ROOT if Ogre was built with Boost. I add a BOOST_ROOT entry to the configuration and point it to the boost folder inside the Ogre SDK folder (path\OgreSDK_vc10_v1-8-1\boost). But when I generate, CMake gives a warning that the manually-specified variable was not used by the project. Sure enough, NMake still fails at the same place.
On a whim, I download the Ogre 1.8.1 source (note that I did NOT compile Ogre from source). I point OGRE_SOURCE to the folder and hit configure. Three new entries appear in the CMake configuration: BOOST_ROOT, Boost_DIR, and Boost_LIB_DIAGNOSTIC_DEFINITIONS. I once again point BOOST_ROOT to the boost folder inside the Ogre SDK (path\OgreSDK_vc10_v1-8-1\boost), configure and generate. There are lots of warnings of type C4193 and C4275. However, the next error is NOT related to Boost.
Error RC1103: invalid option, /fp:fast
/fp:fast is definitely an option in Visual Studio under Code Generation, so I don't know what this is about. If I turn off Demos and Tools in the CMake config, compilation goes to completion and the lib and dll files are created.
Visual Studio 2010:
So I decide to make a new build directory and I tell CMake to create a Visual Studio 10 project instead of NMake. I again have failed builds, but not related to precompiled headers. Once I employ the Boost solution above, the builds go fine, along with the Demos and Tools.
Conclusions:
So I just wanted to tell my little story here in the hopes that others trying to compile MyGUI might have an easier time. I also hope the creators of MyGUI might be able to tweak the CMake settings and the Compilation Instructions to avoid these problems in the future.
Also, it might be a good idea to simply make an SDK with working libs and dlls of MyGUI 3.2.0 for Ogre 1.8.1. Over the years, I've found there is no better way than building libraries from source yourself to guarantee the introduction of subtle errors and doubt.