Trying to build MyGui using cmake

Problems building or running the engine, queries about how to use features etc.
Post Reply
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Trying to build MyGui using cmake

Post by Slicky »

Ogre Version: :1.12
Operating System: :Windows
Render System: :gles2

So I thought I'd get the latest MyGui from GitHub and fire up cmake and build away. Apparently it's not that easy. I know this is more of a MyGui question but maybe someone else has had this problem recently.

I have Ogre built from source (fairly easy and used cmake for Ogre's builds).

I think the MyGui directory prompts in cmake are not that clear. It seems a bit tricky to work out exactly what paths it is looking for. Anyway, I went down a rabbit hole of trying to fix the errors and gave up for now.

Any help appreciated.
Last edited by Slicky on Tue May 19, 2020 10:43 am, edited 2 times in total.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Trying to build MyGui using cmake

Post by paroj »

I patched mygui to use the new-style cmake config scripts, so it should be sufficient to set OGRE_DIR as discussed in https://ogrecave.github.io/ogre/api/latest/setup.html

as for any other variables, make sure that cmake ends up here:
https://github.com/MyGUI/mygui/blob/308 ... .cmake#L49

and complain at altren if it does not.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Re: Trying to build MyGui using cmake

Post by Slicky »

I'll take a look tomorrow. Thanks for the info.

I saw a pull request you did in 2018 I think it was for Ogre 1.11. Hopefully not much has changed but unfortunately if cmake doesn't work it becomes difficult to work out why. I tried hardcoding some paths in the scripts which then created other problems.

I'm fairly sure any new user wouldn't be able to get it to work out of the box. I am trying to get both windows and android to work but as far as scripts go they are probably not radically different.

Today I was wondering if MyGui was perhaps designed with the cmake script for a SDK only Ogre install then saw references to source directories.

Often with these things it is obvious or easy for the person who created it but for someone trying to use it and not knowing the design it is not so easy. If I did a cmake script I would add a lot of comment in the line help text to make it obvious what that input line was looking for.

So... hopefully not much changed since 1.11 but today was not easy. I'll try again.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Re: Trying to build MyGui using cmake

Post by Slicky »

At the top of ogreTargets-debug.cmake I see:

Code: Select all

#----------------------------------------------------------------
# Generated CMake target import file for configuration "Debug".
#----------------------------------------------------------------

# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)

# Import target "OgreMain" for configuration "Debug"
set_property(TARGET OgreMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(OgreMain PROPERTIES
  IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/lib/OgreMain_d.lib"
  IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/bin/OgreMain_d.dll"
However beneath my /build/lib directory there are directories for debug, release etc. The same applies to the /build/bin structure.

Is this an error in the Ogre script that doesn't add the build version to the path?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Trying to build MyGui using cmake

Post by paroj »

did you build the INSTALL target with Ogre to get the sdk?
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Re: Trying to build MyGui using cmake

Post by Slicky »

No I didn't apparently. I think I normally just build using the ALL_BUILD and then link and reference in my app to the library directories. This seems to have improved things. So the SDK directory is key in getting it to work.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 25

Re: Trying to build MyGui using cmake

Post by Slicky »

I got this to work. Using the SDK paths improved things.

MyGui only seems to support the OpenGL renderer.
Post Reply