Well it compiles, but now the binary i got isn't viable, just sits open. Wonder what happened.
I tried the Xcode package, as is it needs some help finding the SDL libraries. Not sure what's going on there, but I take it the mac dev has a working one. Hopefully he will fix the one in the sourcecode
As to building an app bundle it actually turns out to be rather simple. Though you would have to add d2x-xl-mac folder back into your branch
I used otool to find out what librares are linked and where. Somehow the binary is already set to look for the libraries in the bundle. I have no idea how, but it's in the code somewhere.
The only problem is that SDL.framework is set to be found using @rpath which i don't agree with one bit. It would require a compiler flag at build time to defign which directories are in the rpath list. And is totally unnecessary. All the other libraries use @executable_path which looks for the libraries relative to the executable (OSX understands this). So i'd make SDL.framework do the exact same.
here basic script so you know what needs to be done
Code: Select all
mv ./d2x-xl_782b1d4 ./d2x-xl.app/Contents/MacOS/d2x-xl
cp ../d2x-xl-mac/Resources/d2.icns ./d2x-xl.app/Contents/Resources
cp ../d2x-xl-mac/Resources/d2doc.icns ./d2x-xl.app/Contents/Resources
cp ../d2x-xl-mac/Resources/Info.plist ./d2x-xl.app/Contents
cp ../d2x-xl-mac/Resources/InfoPlist.strings ./d2x-xl.app/Contents/Resources/English.lproj
echo 'APPLD2XL' > ./d2x-xl.app/Contents/PkgInfo
cp -R /Library/Frameworks/SDL.framework ./d2x-xl.app/Contents/Frameworks
cp -R /Library/Frameworks/SDL_image.framework ./d2x-xl.app/Contents/Frameworks
cp -R /Library/Frameworks/SDL_mixer.framework ./d2x-xl.app/Contents/Frameworks
cp -R /Library/Frameworks/SDL_net.framework ./d2x-xl.app/Contents/Frameworks
install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL ./d2x-xl.app/Contents/MacOS/d2x-xl
This is all providing we can get the binary to work again...
Perhaps you can set it to copy the SDL frameworks wherever cmake finds it.
Also d2x-xl-782b1d4 from cmake appears to have that random number attached to it afterward. Is it always this or do we have to come up with a smarter mv command?
One more thing, If I'm using gcc from macports to build I would have to use a program called dylibbundler to add the opemmp dylib and other gcc stuff into the bundle. This would have to be done outside of cmake i think.
[EDIT] Turns out the framework files in the source code are empty, Why bother having empty libraries in the source code? Perhaps Diedel doesn't realize that these "files" are actually directories with an extension and not the libraries itself. Just like the App bundles are not the executable themselves.