Question

I've been looking at using KDE's MarbleWidget in an application on OSX. However, the instructions located here: http://marble.kde.org/sources.php only seem to build marble.app and install it. I haven't been able to figure out how to get includes and libs installed under /usr/local.

Any ideas?

Was it helpful?

Solution

I can only give advice on Linux version, but I imagine it's similar.

The installation process should also create the library files which you can use in your own application. To copy them to the folder /usr/local, you can follow something like this:

http://code.google.com/p/tonatiuh/wiki/InstallingMarbleForLinux

Then you can follow the following to setup a basic application: http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

Basically you have to locate the library files and copy & paste to correct directory. Hope that helps.

OTHER TIPS

edit You should initially follow the cmake instructions at: http://techbase.kde.org/Projects/Marble/MacCompiling

You might need to modify CMakeLists.txt: make sure both lines that set CMAKE_OSX_ARCHITECTURES. I had to do this, anyway: setting this variable to something sensible for your OSX platform works too, but it seems like cmake is smart enough to guess the appropriate architecture by default. And passing -DCMAKE_OSX_ARCHITECTURES on the command line didn't seem to work.

Then run make, make install.

There are instructions here on which files need to be copied where:

https://code.google.com/p/tonatiuh/wiki/InstallingMarbleForMac

You'll need to do a few things after that. The file libmarblewidget.15.dylib (which you'll have copied to /usr/local/lib/marble) needs to be fixed so that it knows where it is. The Qt page on deploying applications for OSX (http://qt-project.org/doc/qt-4.8/deployment-mac.html) has a more extensive guide on how to do this, but basically you just have to use install_name_tool to tell the library where it now lives. If you use otool to check its status, you'll get something like:

    kagutsuchi$ otool -L /usr/local/lib/libmarblewidget.15.dylib
    /usr/local/lib/marble/libmarblewidget.15.dylib:
        /marble/build/dir/src/lib/marble/libmarblewidget.15.dylib (compatibility version 15.0.0, current version 0.15.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtCore.framework/Versions/4/QtCore (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtDBus.framework/Versions/4/QtDBus (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtGui.framework/Versions/4/QtGui (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtXml.framework/Versions/4/QtXml (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtSvg.framework/Versions/4/QtSvg (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtScript.framework/Versions/4/QtScript (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtWebKit.framework/Versions/4/QtWebKit (compatibility version 4.8.0, current version 4.8.0)
        /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/lib/QtDeclarative.framework/Versions/4/QtDeclarative (compatibility version 4.8.0, current version 4.8.0)
        /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 635.15.0)

The second line (/marble/build/dir/src/lib/marble/libmarblewidget.15.dylib ...) is a problem, because this isn't the current location of the library. You can change it with:

    kagutsuchi$ sudo install_name_tool -id /usr/local/lib/marble/libmarblewidget.15.dylib /usr/local/lib/marble/libmarblewidget.15.dylib

The argument after -id is the new identifier. The next argument is the file you're modifying, so you could also do:

    kagutsuchi$ cd /usr/local/lib/marble
    kagutsuchi$ sudo install_name_tool -id /usr/local/lib/marble/libmarblewidget.15.dylib libmarblewidget.15.dylib

You'll also need to modify the plugins once you've copied them over to /usr/local/bin/marble so that they know where to look for libmarblewidget.15.dylib, again with install_name_tool:

    kagutsuchi$ cd /usr/local/lib/marble
    kagutsuchi$ for sofile in `ls *.so`; do sudo install_name_tool -change /marble/build/dir/src/marble/build/src/lib/libmarblewidget.15.dylib /usr/local/lib/marble/libmarblewidget.15.dylib $sofile; done

You should be able to use the same value for /marble/build/dir that worked for fixing libmarblewidget.15.dylib.

This should all work. If you check these files with otool -L they should now be looking in the right place for the library. You should also be able to get your Qt code to compile, providing you've got the right INCLUDEPATH and LIBS stuff in your .pro file.

HOWEVER... I'm stuck at this point. I've got my code to compile, but when I try to get it to run the MarbleWidget I create isn't looking in the right place for the plugins. I'm going to post a question on the plugin subject and see if I can get some help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top