
COMPILING (Linux)
=================

Note: this section deals with compiling the Linux binary.
For information on compiling for Windows and macOS, see below.


Dependencies:

1. C++ compiler (GNU's G++) and associated tools
   packages: g++ binutils

2. CMake
   package: cmake

3. FLTK 1.3 or 1.4

   Downloaded by CMake by default. Add `-DUSE_SYSTEM_FLTK=ON` to the CMake
   command-line to use the system installed FLTK.

   website: http://www.fltk.org/

   If using system FLTK:
   package: libfltk1.3-dev

   You may also need: libxft-dev
                      libxinerama-dev
                      libfontconfig-dev
                      libjpeg-dev
                      libpng-dev

4. libXpm
   package: libxpm-dev

5. OpenGL
   (recommended but not strictly necessary, see below)

6. zlib
   website: http://www.zlib.net/
   package: zlib1g-dev

7. XDG Utils
   (only needed for Linux, to install the desktop and icon files)
   package: xdg-utils

If you want or need to use system installed FLTK and Google Test instead of
CMake fetching them from GitHub, add the following parameters to the `cmake`
command line:

   -DUSE_SYSTEM_FLTK=ON -DUSE_SYSTEM_GOOGLE_TEST=ON


Assuming all the dependencies are met, then the following shell
commands will build the Eureka binary. (the '>' is just the prompt)

   > mkdir build
   > cd build
   > cmake ..
   > make

Some systems may need additional CFLAGS and/or LDFLAGS in order
to find the required libraries (especially FLTK).  For example,
the following is reported to work for Gentoo Linux:

   CFLAGS  += -I/usr/include/fltk-1
   LDFLAGS += -L/usr/lib64/fltk-1/


OpenGL is used to greatly speed up the 2D and 3D views, however
Eureka still supports software-only rendering as a compile-time
option.  You will need to edit the Makefile and disable OpenGL
support -- look for the line containing NO_OPENGL and uncomment
that line, and remove all GL libraries from the build.



INSTALLING (Linux)
==================

First make sure the Eureka binary was compiled successfully.

Then become root (via the 'sudo' or 'su' command) and enter the
following shell command:

   > make install

That will install the eureka binary, definition files for various
games and source ports, and the desktop and icon files.



COMPILING (macOS)
=================

Use CMake. You can download and install CMake from their website, or use a
third-party package manager such as Homebrew. Easiest to use is the graphical
interface version of CMake (CMake GUI).

Unlike on Linux, on Mac it's strongly advised to let CMake fetch FLTK from
GitHub; do not set USE_SYSTEM_FLTK to ON. This is needed because of some late
bug fixes on macOS FLTK.

The generated Xcode project or Makefile will ultimately produce an "Eureka Doom
Editor" graphical application. If you generated a Makefile, there's no "make
install" stage. Simply open the produced app.



DISTRIBUTING (macOS)
====================

To distribute a signed app of Eureka, you need to generate an Xcode project
first -- signing and notarizing the app is currently not supported from the
Makefile. You can also distribute the app generated by Makefile as-is, but users
will be warned that the app isn't signed, and prompted to move it to Trash
(unless they access the app from the right-click menu in Finder).



COMPILING (Windows)
===================

Use CMake, same as on macOS. Similarly, the FLTK project shall be downloaded and
built by CMake itself.



SETTING UP Eureka
=================

Eureka requires an IWAD file from one of the supported games, for
example "doom2.wad".  Eureka will look for IWADs when it starts up,
but if it cannot find any then the 'Manage Wads' dialog will open
and you can browse for an IWAD file there, which will be remembered
for next time.

Places where Eureka looks for IWADs:

  1. The "iwads" directory in Eureka's home directory.  In Linux
     this will be "~/.config/eureka/iwads" (or "$XDG_CONFIG_HOME/eureka/iwads").
     It is created automatically the first time Eureka is run (though there
     is no harm in creating it yourself).

  2. (a) In Linux: /usr/share/games/doom
     (b) In Windows: C:\DOOM and C:\DOOM2

  3. If you run Eureka from the command line and have the DOOMWADDIR
     or DOOMWADPATH environment variables set, then Eureka should find
     it the specified directory.

  4. If running from the command line, Eureka will look in the current
     directory for the IWAD.

  5. You can specify the IWAD file directly with the --iwad option.
