Difference between revisions of "MG/Mac Compiling"

From MegaGlest
Jump to navigation Jump to search
(some updates, saving so they aren't lost. bit revarmp on existing page)
Line 2: Line 2:
  
 
==Prerequisites==
 
==Prerequisites==
*[http://developer.apple.com/technologies/xcode.html XCode]
+
* [http://developer.apple.com/technologies/xcode.html XCode]
*[http://www.cmake.org/cmake/resources/software.html CMake]
+
* [http://www.cmake.org/cmake/resources/software.html CMake]
*Retrieve the build dependencies / 3rd party libraries and extract the contents of the archive in your library directory ~/Library/Frameworks
+
* Various 3rd party build dependencies
 +
 
 +
== Dependencies ==
 +
 
 +
Dependencies can be installed in two ways:
 +
* Retrieve the build dependencies / 3rd party libraries and extract the contents of the archive in your library directory ~/Library/Frameworks
 +
or
 +
* Install them using a 3rd party package manager like [https://www.macports.org/ |MacPorts] or [www.finkproject.org/ |Fink].
 +
 
 +
In this example I show how to install the packages with MacPorts which will handle the install of dependencies, and there is a lot of them. Full dependency lists are available on [[MG/Linux Compiling|Linux Compiling]] or [[MG/FreeBSD Compiling|FreeBSD Compiling]] if you would like to install them manually.
 +
 
 +
 
 +
sudo port install git cmake VLC-devel fribidi ftgl glew wxWidgets-2.8 wxgtk-2.8
 +
 
 +
== Preparing to compile ==
 +
However you choose to compile you will need to use [[MG/Getting_The_Code|''Git to check out'']] the MegaGlest source code ready for building.
  
 
==Compiling==
 
==Compiling==
*Install and use [[MG/Getting_The_Code|''Git to check out'']] the MegaGlest source code.
+
This can be done in two ways: Using an XCode project or gnumake
 +
 
 +
=== XCode project ===
 +
/!\ This method is currently known to have problems and unlikely to succeed without considerable debugging.
 +
 
 
*Generate the XCode project
 
*Generate the XCode project
 
  cmake -GXcode
 
  cmake -GXcode
Line 15: Line 34:
 
  cpack -C CPackConfig.cmake
 
  cpack -C CPackConfig.cmake
 
*You should have a megaglest-#.dmg file in your current directory. You can install this and play it.
 
*You should have a megaglest-#.dmg file in your current directory. You can install this and play it.
 +
 +
=== GNU Make ===
 +
 +
 +
== Problems building ==
 +
If you encounter problems with wxWidgets executable being undiscoverable you may need to set the path in CMakeLists.txt yourself
 +
  
 
==See Also==
 
==See Also==

Revision as of 04:08, 7 December 2014

This page explains how to compile MegaGlest on a Mac computer.

Prerequisites

Dependencies

Dependencies can be installed in two ways:

  • Retrieve the build dependencies / 3rd party libraries and extract the contents of the archive in your library directory ~/Library/Frameworks

or

  • Install them using a 3rd party package manager like |MacPorts or [www.finkproject.org/ |Fink].

In this example I show how to install the packages with MacPorts which will handle the install of dependencies, and there is a lot of them. Full dependency lists are available on Linux Compiling or FreeBSD Compiling if you would like to install them manually.


sudo port install git cmake VLC-devel fribidi ftgl glew wxWidgets-2.8 wxgtk-2.8

Preparing to compile

However you choose to compile you will need to use Git to check out the MegaGlest source code ready for building.

Compiling

This can be done in two ways: Using an XCode project or gnumake

XCode project

/!\ This method is currently known to have problems and unlikely to succeed without considerable debugging.

  • Generate the XCode project
cmake -GXcode
  • Build everything for release
xcodebuild -configuration release
  • Generate the installer
cpack -C CPackConfig.cmake
  • You should have a megaglest-#.dmg file in your current directory. You can install this and play it.

GNU Make

Problems building

If you encounter problems with wxWidgets executable being undiscoverable you may need to set the path in CMakeLists.txt yourself


See Also