Marble/MacCompiling: Difference between revisions
GeorgeWhite (talk | contribs) mNo edit summary |
GeorgeWhite (talk | contribs) mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 28: | Line 28: | ||
== Compilation == | == Compilation == | ||
=== marble-qt (without KF5) === | === '''marble-qt (without KF5)''' === | ||
Following [https://marble.kde.org/sources.php this guide], retrieve the source code by tarball or from the anonymous <code>git</code> repository. | Following [https://marble.kde.org/sources.php this guide], retrieve the source code by tarball or from the anonymous <code>git</code> repository. | ||
Line 86: | Line 86: | ||
{{warning | If you are contemplating contributing to Marble, be aware that some changes to the Xcode project in Xcode '''may not affect''' the Marble project, like creating or adding a file. Manual changes to some CMakeLists.txt files may be needed: the conversion from CMake script to Xcode project is not bilateral. }} | {{warning | If you are contemplating contributing to Marble, be aware that some changes to the Xcode project in Xcode '''may not affect''' the Marble project, like creating or adding a file. Manual changes to some CMakeLists.txt files may be needed: the conversion from CMake script to Xcode project is not bilateral. }} | ||
{{warning | Changes to the CMakeList.txt files ''' | {{warning | Changes to the CMakeList.txt files '''may need the Xcode project to be regenerated'''! }} | ||
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]]. | 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]]. |
Latest revision as of 09:12, 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.
- 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.
Using GNU make to compile Marble (recommended)
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.
You can then use GNU Make to compile Marble, then install the bundle and libraries to the prefix:
$ make install
Speeding up compilation
You may choose to use more than one thread (specified by -jX
, where X
is the amount of threads to use in compilation). For example, to use the same amount of threads as the number of logical CPU cores on your computer, and assumes you use bash
or another sh
-based shell:
$ make install -j$(sysctl -n hw.ncpu)
With fish
as your shell:
$ make install -j(sysctl -n hw.ncpu)
Using Xcode and xcodebuild to compile Marble
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
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.