Jump to content

Compiling with Xcode (OpenXcom): Difference between revisions

From UFOpaedia
SupSuper (talk | contribs)
Created page with "To successfully build an OpenXcom OSX bundle you will need the relevant Xcode project files provided in the ''xcode'' folder as well as all the relevant dependencies installed..."
 
Undo revision 126426 by Hobbes (talk)
Tags: Removed redirect Undo
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
To successfully build an OpenXcom OSX bundle you will need the relevant Xcode project files provided in the ''xcode'' folder as well as all the relevant dependencies installed in ''/usr/local/''.
To successfully build an OpenXcom OSX bundle you will need to ensure all the relevant dependencies installed in /usr/local/.
 


== Dependencies ==
== Dependencies ==


The dependencies you require are the following:
To successfully build an OpenXcom OSX bundle you will need to ensure s all the relevant dependencies installed in /usr/local/.
* SDL (libsdl1.2)
 
* SDL_mixer (libsdl-mixer1.2)
The dependencies you require are following:
* SDL_gfx (libsdl-gfx1.2), version 2.0.22 or later
<ul>
* SDL_image (libsdl-image1.2)
<li> cmake, version 3.12.0 or later </li>
* yaml-cpp, version 0.5 or later  
<li> SDL (libsdl1.2) </li>
<li> SDL_mixer (libsdl-mixer1.2) </li>
<li> SDL_gfx (libsdl-gfx1.2), version 2.0.22 or later </li>
<li> SDL_image (libsdl-image1.2) </li>
<li> yaml-cpp, version 0.5 or later </li>
</ul>
 
We recommend using [https://brew.sh Homebrew] to facilitate this.  With a working brew utility installed, run the following:
<pre>
$ brew install cmake yaml-cpp sdl sdl_gfx sdl_image sdl_mixer
</pre>
This should install all of these necessary dependencies to their appropriate place under /usr/local.


If you want to save yourself the trouble - don't do it manually, use [http://mxcl.github.com/homebrew/ Homebrew package manager] instead.
== Building ==


== Instructions ==
<ol>
<li>In the root of the repository, generate the Makefile with cmake (Release is also a valid build type):
<pre>
cmake . -DCMAKE_BUILD_TYPE="Debug" -G Xcode
</pre>
</li>


# This guide assumes you listened to the previous recommendation and had your dependencies installed with brew terminal command, like this:<br /><pre>$ brew install yaml-cpp sdl sdl_gfx sdl_mixer sdl_image</pre>
<li>Open the <code>OpenXcom.xcodeproj</code> in Xcode. </li>
# Now, open the ''OpenXcom.xcodeproj'' file and add the source folder to the project:<br />Right-Click on the OpenXcom project icon in the left pane, select ''Add Files to "OpenXcom"'', traverse the folder tree up one level and select the ''src'' folder to be added. Just make sure you choose ''Create groups for any added folders'' option when adding this to your build target.
<li>Copy your vanilla game assets (UFO/TFTD) into the <code>bin/</code> directory.  </li>
# Click on the OpenXcom target in the middle pane and select the ''Build Phases'' tab. Look down at ''Copy Bundle Resources'' container and delete all the files irrelevant to our build, namely:
<li>Build with cmd-B.  </li>
#* OpenXcom.2010.vcxproj
<li>Your artifact will be named <code>openxcom.app</code> in the build target directory (Debug or Release) from the root of the repository. </li>
#* CMakeLists.txt
</ol>
#* Makefile.simple
== Additional Help ==
#* OpenXcom.rc
#* OpenXcom.2010.sln
#* OpenXcom.2010.vcxproj.user
#* OpenXcom.2010.vcxproj.filters
#* Makefile.gcc-pch
# Push the ''Build'' button and cross your fingers ;)
# Find your newly created bundle in ''./DerivedData/OpenXcom/Build/Products/Release'' folder and copy it to some place you feel comfortable keeping your games in.
# Don't forget to copy all the relevant original game data files you possess into the relevant ''data'' folder within the bundle (see [[Installing (OpenXcom)|Installing]]), or otherwise the game won’t start. If asked by OSX what to do with the files and folders already present there, select ''Merge''.
# Enjoy!


Should you require any further assistance regarding the OSX build - feel free to ask around on the [http://openxcom.org/forum/ official forums] or contact me directly on [http://github.com/luciderous GitHub].
Should you require any further assistance regarding the OSX build - feel free to ask around on the official forums - https://openxcom.org/forum/ or contact us directly on GitHub - [http://github.com/rcreasey @rcreasey]


[[Category:OpenXcom]]
[[Category:OpenXcom]]

Latest revision as of 14:57, 10 March 2026

To successfully build an OpenXcom OSX bundle you will need to ensure all the relevant dependencies installed in /usr/local/.


Dependencies

To successfully build an OpenXcom OSX bundle you will need to ensure s all the relevant dependencies installed in /usr/local/.

The dependencies you require are following:

  • cmake, version 3.12.0 or later
  • SDL (libsdl1.2)
  • SDL_mixer (libsdl-mixer1.2)
  • SDL_gfx (libsdl-gfx1.2), version 2.0.22 or later
  • SDL_image (libsdl-image1.2)
  • yaml-cpp, version 0.5 or later

We recommend using Homebrew to facilitate this. With a working brew utility installed, run the following:

$ brew install cmake yaml-cpp sdl sdl_gfx sdl_image sdl_mixer

This should install all of these necessary dependencies to their appropriate place under /usr/local.

Building

  1. In the root of the repository, generate the Makefile with cmake (Release is also a valid build type):
    cmake . -DCMAKE_BUILD_TYPE="Debug" -G Xcode
    
  2. Open the OpenXcom.xcodeproj in Xcode.
  3. Copy your vanilla game assets (UFO/TFTD) into the bin/ directory.
  4. Build with cmd-B.
  5. Your artifact will be named openxcom.app in the build target directory (Debug or Release) from the root of the repository.

Additional Help

Should you require any further assistance regarding the OSX build - feel free to ask around on the official forums - https://openxcom.org/forum/ or contact us directly on GitHub - @rcreasey