Marble/MacCompiling: Difference between revisions

From KDE Community Wiki
mNo edit summary
mNo edit summary
Line 64: Line 64:
</pre>
</pre>


{{info | You can then specify that you wish to only build and run the Marble.app bundle's target in Xcode by selecting it from right-clicking on the <code>▶</code> (right-pointing triangle – 'run') button, and selecting it from the contextual menu. }}
{{info | You can then specify that you wish to only build and run the Marble.app bundle's target in Xcode by selecting it from the contextual menu appearing on right-clicking the <code>▶</code> (right-pointing triangle – 'run') button. }}


or use xcodebuild:
or use xcodebuild:

Revision as of 08:29, 6 January 2017

Marble can be built for macOS (originally Mac OS X) platforms. Currently, as of 4th January 2017, however, there are no current or supported official binaries available. Patches are available that support building portable Marble app bundles and the DMG packaging for macOS are available on Phabricator; they have not yet been imported in to the main repository.

Prerequisites

Installing Marble requires the following libraries and utilities available on your system:

  • Xcode, a suitable version for your operating system, along with its command-line tools, if your Xcode package (as in most recent builds for 10.7 and up) does not include them.

Note

A paid 'developer' subscription is unnecessary to compile Marble.


Note

You will need to accept the Xcode license agreement before you compile Marble on macOS. A license text is available, as well as the choice to accept it, from the following command, once Xcode has been installed:
sudo xcodebuild -license
Administrator privileges are necessary for xcodebuild to install the symbolic links pointing to these command line utilities.


  • CMake, a version greater than 3.0, as specified in the main CMakeLists.txt file; this can be obtained as from either a binary from the project's website, the recommended method, or from a package manager, such as Homebrew, MacPorts, or Fink.
  • A Qt 4 or 5 SDK. A version from their website is preferred, and is required if you want to end up with a portable app bundle; package maintainers do not typically support the use of their libraries to create an app bundle, and often do not have working deploy utilities.

marble-kde

If you wish to compile the KDE version, marble-kde, then you will need extra KDE libraries installed on your computer:

  • KDE Foundation 5 (KF5).

Compilation

marble-qt (without KF5)

Following this guide, retrieve the source code by tarball or from the anonymous git repository.

Create a new build directory inside the new clone, then change to it, and run CMake in it, like so:

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=release -DWITH_KF5=FALSE -DCMAKE_INSTALL_PREFIX=<a user defined prefix> ..

<a user defined prefix> is replaced with your chosen prefix folder.

Note

What's wrong with using /Applications as CMAKE_INSTALL_PREFIX? To avoid the installation of libraries, which are automatically included in the application bundle, into your Applications folder, use another folder, and transfer the application from there.


You can then use GNU Make to compile Marble, then install the bundle and libraries to the prefix:

$ make
$ make install

Alternatively, you can use CMake to create an Xcode project for Marble:

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=release -DWITH_KF5=FALSE -DCMAKE_INSTALL_PREFIX=<a user defined prefix> -G 'Xcode' ..

Then, either open the Xcode project:

$ open Marble.xcodeproj

Information

You can then specify that you wish to only build and run the Marble.app bundle's target in Xcode by selecting it from the contextual menu appearing on right-clicking the (right-pointing triangle – 'run') button.


or use xcodebuild:

$ xcodebuild -project Marble -target Marble.app

This application, however, is not portable: if you would like to create a system library independent app bundle, and a distributable disk image, see Marble/MacPackaging.