Old Wiki:Build Server Source

From EVEmu Wiki
Jump to navigation Jump to search

Contents

Getting The Source Code

Prerequisities

You need a Git client in order to download the source. Windows users can download SmartGit, Linux users need to install the respective package (usually git).

If you prefer to use Git via CMD, here is a good tutorial on how to do it. Git-Linux Git-Windows

Downloading the source

NOTE: Use Git to pull down the source, I would recommend if you want to develop, create a Github account. Then you can fork from the main branch and develop from there.

Windows

Please load Smartgit and follow the on screen instructions to pull down the source from github.

Linux

You can use the gui from Linux or CMD

Type following to the terminal:




  • mkdir ~/path/to/evemu/source
  • cd ~/path/to/evemu/source Changes the current working directory to your newly created directory
  • git initSets up the necessary Git files
  • Initialized empty Git repository in /path/to/evemu/source/.git/
  • touch README
  • git clone https://github.com/evemuproject/evemu_apocrypha.git



Compiling with CMake

Foreword

EVEmu can be built using CMake: a tool designed to ease the whole process of compiling on various platforms. You can find further information about it on the homepage; here we'll concentrate only to how to use it to build EVEmu.

Getting the dependencies

Of course you'll need current EVEmu source. If you haven't downloaded it yet, [wiki:apocrypha/GettingTheSourceCode do it now].

Windows

Install : CMake, Git and Visual Studio.BR Extract : zlib, mysql-noinstall somewhere convenient, but not in your git repository.BR Move : Content of extracted files to C:\evemu\zlib and C:\evemu\mysql respectably.BR WARNING : Don't move zlib-1.2.5 into C:\evemu\zlib. Only the contents of zlib-1.2.5. Same with MySql.

Linux

* cmake
* git
* make
* g++
* zlib, zlib-dev
* libmysqlclient, libmysqlclient-dev

Just search your distro's repository for similarly named packages and install them.

Running CMake

WARNING: Do NOT use SPACES in any part of your path to the EVEmu source code or any of its dependencies (libraries like boost, mysql, zlib, etc). Any spaces in the path will cause MASSIVE errors when you go to compile the software in your compiler. YOU HAVE BEEN WARNED!!!

Windows

Create directory C:\evemu\build.

Go to the directory where you have installed CMake, there should be subdirectory bin. Go in there and run cmake-gui.exe. In the new window in the upper part click Browse source and pick C:\evemu\source, then click Browse build and pick C:\evemu\build. After that click Configure in the lower part. Another dialog pops up, asking you to choose compilers and a generator. Choose Visual Studio 9 2008 and Use default native compilers and press Finish.

CMake starts configuring your build, but it'll fail, because you haven't set several CMake variables yet. For each of the rows below, click the button Add Entry in the upper part, fill in the corresponding editboxes and click OK:

* Name: CMAKE_SYSTEM_INCLUDE_PATH Type: PATH Value: C:\evemu\mysql\include;C:\evemu\zlib
* Name: CMAKE_SYSTEM_LIBRARY_PATH Type: PATH Value: C:\evemu\mysql\lib\opt

Now click Configure again and it should be fine. After configuration is done, click Generate and close the window.

Linux

Type:

  • mkdir path/to/evemu/build
  • cd path/to/evemu/build
  • cmake path/to/evemu/source


If you want to configure the build manually, add -i flag:

  • cmake -i path/to/evemu/source


This is particularly useful e.g. when you want to build a Debug binary.

Compilation

Windows

Browse to C:\evemu\build, there should be file evemu.sln. Double-click it and Visual Studio opens up. You can set it to two modes, 'Debug' or 'Release'. Either work, but the size of the exe file is bigger on debug but slightly more stable. In the left part, right-click Solution evemu and click Build solution. Compilation should start.

Linux

Type:

  • cd path/to/evemu/build
  • make


If you want to make use of a multicore CPU, specify number of cores with -j option. For example, if you had quad-core CPU, you'd type:

  • make -j4

Debugging

These instructions will help you surmount the common problems when setting up your system to debug EVEmu server code.

Windows

1. Open the evemu project in Visual Studio.
2. To do FULL Rebuilds of entire project, select ALL_BUILD at the top of the list in Solution Explorer, then either hit Ctrl+Alt+F7 key or click Build -> Rebuild Solution from the menu bar.
3. To compile sub-projects by themselves, such as eve-server, then select that sub-project in Solution Explorer, then hit F7 for a Build or Ctrl+Alt+F7 for a Rebuild or access either from the Build menu on the menu bar.
4. To set the project for Debugging, find the drop down box on the toolbar that is either going to have Release or Debug inside.  If it says Debug you are good to go, just to a FULL rebuild of the whole project.  If it says Release, click on it then select Debug, then do a FULL rebuild of the whole project.
5. To RUN eve-server after you have built it under Debug, follow these steps:
 * Right-click on eve-server in the Solution Explorer and select Properties
 * Expand Configuration Properties and click Debugging
 * Put the text Debug in the field called Working Directory, then click the OK button
 * Now, navigate to your server project source root directory, then drill down to this sub-folder: build\src\eve-server
 * Make a new folder called etc and put your eve-server.xml file in that new etc folder
 * Back in Visual Studio, right click on eve-server again in the Solution Explorer and select Set as StartUp Project, the eve-server tree label will now be bold to indicate this change
 * You can now hit F5 to execute the debug build .exe or click Debug -> Start Debugging from the menu bar.

Linux

to be written