Compile ZDoom on Mac OS X
Compiling ZDoom on Mac OS X may seem like a daunting task, but it's actually pretty similar to the process for Linux.
- A Mac computer with an Intel or PowerPC processor.
- Mac OS X 10.4 Tiger and above
- Latest version of Xcode, available here (requires free registration)
- Make sure you install GCC 4.2 and the Mac OS X 10.4u SDK, which should both be included in the Xcode package.
- CMake 2.4 or later
- FMOD Ex v4.26.36
- libSDL 1.2.14
After configuring and installing everything, you'll need a copy of the ZDoom source code. It is recommended that you use a recent version from the Subversion Repository to compile, but you may use an older version's source from the ZDoom Downloads Page if desirable.
To obtain the latest version from the SVN, use the following command:
svn checkout http://mancubus.net/svn/hosted/zdoom/zdoom/trunk
A directory trunk will be generated containing the latest source code. In the future, the code may become out-of-date compared to newer code available in the SVN. To update to the latest code at any time, use the following command from inside the trunk directory:
Configuring with CMake
When you run the CMake application, you will be greeted with a window asking for a source code path and a build directory. The directions for CMake on Linux apply here, except with a GUI.
After you click Configure, you will end up having to tell CMake where the FMOD library is located. This should be "/Developer/FMOD Programmers API Mac/api/libfmodex.dylib". In addition set CMAKE_BUILD_TYPE to "Release". As of this writing you will also want to remove -O3 from CMAKE_CXX_FLAGS_RELEASE, set CMAKE_OSX_ARCHITECTURES to "i386" or "ppc" depending on your processor, and check the option for NO_ASM (you may need to switch to advanced view to see these options).
After this, click "Configure" one more time and you should be good. When you click "Generate", select the Unix Makefiles option.
If you are usingto compile ZDoom, use the following command line to create the makefiles:
cmake -DCMAKE_BUILD_TYPE=Release \ -DFMOD_LIBRARY="/Developer/FMOD Programmers API Mac/api/lib/libfmodex.dylib" \ -DFMOD_INCLUDE_DIR="/Developer/FMOD Programmers API Mac/api/inc/" \ -DNO_ASM=true
Open a terminal and cd to the trunk directory. Type "make" to compile. Assuming everything was done correctly you should have a working ZDoom binary.
Alright, so now you have a zdoom executable sitting in your Debug/Release folder. You will need to place the following files in the same directory as the compiled program:
- One or more IWADs
Assuming nothing went wrong, open Terminal, navigate to the build directory and type ./zdoom to start ZDoom!