Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
OS X Build
Author Message
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-13, 21:47   OS X Build

Working on OS X build. First iteration seems to be completed. It would be great if someone could review my changes. I wish I could make a pull request but I have to make a patch which you can get here: https://dl.dropbox.com/u/1777581/osx.patch
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-13, 21:58   

archive with prebuilt dependecies https://dl.dropbox.com/u/1777581/dependency.zip
 
     
Ivan 
VCMI programmer

Age: 26
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2012-11-14, 12:29   

CMakeLists.txt
- disabling video - I'd rather see this as option similar to DISABLE_ERM but I can do this later myself.

client/CMakeLists.txt
- rpath - why not use CMAKE_INSTALL_RPATH instead or link these libraries statically? Same goes to server rpath
- bundle creation:
- - should be placed in root cmakelist
- - if possible, done via CPack: http://www.vtk.org/Wiki/C..._.28OSX_only.29
In this way you also won't miss any vcmi data files (config and mods folders should go into package)

client/vcmi.icns file - why not generate it during bundle creation?

larger icons - OK but there is just too much blur.
Don't know if author is still here to render bigger one but at least you could use this one as base: http://vcmi.eu/logo.png
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-14, 14:05   

It is first iteration only. Video is disabled for now because I need to compile all ffmpeg libs fox OS X. So it's temporary. Just like video for x64 Windows version.

As for icons I just upscaled existing icon for now. We probably need a vector vcmi icon for the future.

As for bundle it is not a kind of installation package like (.deb, .msi or OSX's .dmg) so it should be built even by simple build command, not install or package commands. So I'm not sure that I can use CPack for it. Thought it is intended to build end-user install packages - .dmg for OSX in our case. Same for placing bundle creation in root CMakeList. I think only install and package commands that generate final .dmg should be located in it. Correct me if I'm wrong.
 
     
Warmonger 
VCMI programmer


Age: 28
Joined: 07 Jun 2008
Posts: 1545
Location: Warsaw, Poland
Posted: 2012-11-14, 14:15   

How about this one?

_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
Ivan 
VCMI programmer

Age: 26
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2012-11-14, 14:40   

Warmonger, I already linked to exactly same URL:
Quote:
... but at least you could use this one as base: http://vcmi.eu/logo.png

Quote:
We probably need a vector vcmi icon for the future.

There is no "true" vector icon. Dikamilo had psd that could be rendered to any size. I send PM to him but I don't know if he is still around or if he still have the icon.
If somebody will make vector one - that's great. But this site is not popular among artists.

Regarding bundle - the main reason why I asked for this is that client should not depend on AI, scripting libs or server - any of those can be compiled separately or even located on different system (in case of server).

And CPack has "bundle generator" - check my link. Don't know much about Mac OS but making client to depend on everything else is a bad idea.
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-14, 16:18   

Ok I will use icon you linked but it is 200x200 what is still far from 1024x1024 normally needed for OS X icon (1024 version is used as a big icon for Retina). Would be great if you could recover that source psd.

Regarding bundle. OS X way of installing such applications - you just drag and drop bundle to your /Applications folder and run. Because server is needed for client to work in single player - it should be located in bundle. It is really frustrating to have to copy something inside bundle for game to work. So it is absolutely normal to place everything that could be potentially needed into the bundle. Just like VCMI_server.exe is located in zip archive with Windows binaries. And please note that client does not actually depend on server. You can easily remove vcmiserver executable from bundle and it will work until you try to start a single player game. And considering that end-users will use this bundle I don't see any need for developers to compile a standalone non-bundle version of a client. It would be really annoying to run packaging after every change to test bundle.
 
     
Ivan 
VCMI programmer

Age: 26
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2012-11-14, 17:08   

In this case your bundle should go into root cmakelists - this is not bundle for client but for vcmi itself.
Anything global to vcmi should go into root cmakelists.
Anything specific to project should be in project cmakelists.

Quote:
Would be great if you could recover that source psd.

I did :)
source psd + rendered png's: https://dl.dropbox.com/u/22372764/vcmi/vcmi-icons.zip
I'll upload icons to svn a bit later.
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-14, 18:31   

Of course I could make an empty bundle for vcmiclient target and copy everything else to it in package step. But is very very inconvinient. When I'll start vcmiclient bundle from Xcode for debugging it will look for all resources, server executable and AI libs inside bundle. I can't specify DATA_DIR to /Users/stopiccot/h3 while debugging executable and return to ./../Data (relative path inside bundle) in runtime. So from some theoretical point of view it is more logical to do all copying at package step. But in real life you will end up copying files to their locations inside bundle by hand if you want to debug something. This will ruin all developing experience on OS X. Is cmake script prettiness worth of it?
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-14, 18:52   

Regarding CMAKE_INSTALL_RPATH it simply does not work for me. Because what I need is to get such thing in Xcode project - http://grab.by/hws0 so library install names containing @rpah (@rpah/SDL.framework/Versions/A/SDL) will expand correclty (@executable_path/../Frameworks/SDL.framework/Versions/A/SDL).
 
     
Ivan 
VCMI programmer

Age: 26
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2012-11-15, 14:42   

Quote:
When I'll start vcmiclient bundle from Xcode for debugging it will look for all resources, server executable and AI libs inside bundle.

Anything wrong with using server\libs from bundle?

Theoretically you can place all H3 data in ~/.vcmi directory instead of DATA_DIR and keep bundle as it - no need to manually move files.

Quote:
This will ruin all developing experience on OS X. Is cmake script prettiness worth of it?

In this case I agree.
But I think that you should check Mac-specfic generators in CPack - they can correctly copy files from cmake INSTALL command instead of manual cp's
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-15, 15:46   

Quote:
Theoretically you can place all H3 data in ~/.vcmi directory instead of DATA_DIR and keep bundle as it - no need to manually move files.


How I should distinguish developer case and look for game data in ~/.vcmi and look inside bundle for end-user? I see the only options to introduce something like PATH for DATA_DIR so it could be defined as: "../Data:~/.vcmi"
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-15, 16:15   

Quote:
ut I think that you should check Mac-specfic generators in CPack - they can correctly copy files from cmake INSTALL command instead of manual cp's

I'll look further if we could build .dmg with CPack. Still getting used to cmake :)
 
     
Ivan 
VCMI programmer

Age: 26
Joined: 08 May 2009
Posts: 1438
Location: Ukraine
Posted: 2012-11-15, 18:09   

Quote:
How I should distinguish developer case and look for game data in ~/.vcmi and look inside bundle for end-user?

VCMI always checks for both locations: data dir and user dir.
You may split data between these directories in any way you want. For example config and Mods directories can be copied from source to bundle during packaging and users will place all H3 data in ~/.vcmi (useful on Linux where DATA_DIR is owned by root)

Check config/filesystem.json to see where VCMI looks for resources
Check lib/Filesystem/CResourceLoader.cpp (method CResourceHandler::initialize ) to see code
 
     
stopiccot

Joined: 21 Oct 2012
Posts: 100
Posted: 2012-11-20, 11:52   

I've looked through CResourceLoader.cpp but still do not understand why instead of ability to define multiple folders for DATA_DIR constant we have this hardcode with userdir. Defining DATA_DIR to "../Data:~/.vcmi" would be a much more robust solution and BIN_DIR could leverage from this too. Defining BIN_DIR to ".:../../../" would be enought to eliminate copy step in vcmiclient target for OS X.
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.02 second. SQL queries: 12