How do I install KDE Marble as a library on OSX?

I was looking for KDE's

MarbleWidget

in-app use on OSX

. However, the instructions located here: http://marble.kde.org/sources.php seem to build marble.app

and install it. I have not been able to figure out how to get the included and installed libs in/usr/local.

Any ideas?

+3


source to share


2 answers


I can only give advice on the Linux version, but I think it looks like it.

The installation process should also create library files that you can use in your application. To copy them to the / usr / local folder, you can do the following:

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



Then you can do the following to set up the base application: http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

Basically you need to find the library files and copy and paste to fix the directory. Hope it helps.

+1


source


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

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

Then run make, make install.

There are instructions for copying the files where:

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

After that, you will need to do several things. The libmarblewidget.15.dylib file (which you copied to / usr / local / lib / marble) needs to be fixed so it knows where it is. The Qt page when deploying apps for OSX ( http://qt-project.org/doc/qt-4.8/deployment-mac.html ) has a more detailed guide on how to do this, but basically you just need to use install_name_tool. to inform the library he currently lives in. If you use otool to check its status, you 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 as it is not 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

      

After -id is the new identifier. The next argument is the file you are modifying, so you can 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 will also need to change the plugins after copying them to / usr / local / bin / marble so 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 which worked to fix libmarblewidget.15.dylib.

Everything should work. If you check these files with otool -L, they should now look for the correct location for the library. You should also get the Qt code to compile if you have INCLUDEPATH and LIBS permissions on your .pro file.

HOWEVER ... I am stuck at this point. I have some code to compile, but when I try to run it, the MarbleWidget I'm building doesn't look for a suitable place for plugins. I'm going to post a question about the plugin theme and see if I can help.

+1


source







All Articles