Since the tutorials haven't been updated yet. The follow are some pointers on compiling EQEmu with CMake. This assumes you already have an environment that could build EQEmu before the CMake change over. So, this information is to help people change over to the CMake system from the old way of doing it.
In addition to installing the other packages that tutorials tell you to, you'll need to install cmake. Ubuntu/Debian users will run:
Code:
sudo apt-get install cmake
after checking out the source from SVN, i like to copy the source to a build directory and in there I run:
cmake -i is to allow you to alter any build flags and enable/disable other EQEmu features (e.g. bots).
If you're on an AMD64 system you'll want to say "yes" to the advanced options. This is to allow you to disable the -O2 and -O3 optimizations that mess up the stringstream stuff that plague us. For example:
Code:
$ cmake -i
Would you like to see advanced options? [No]:yes
Please wait while cmake processes CMakeLists.txt files....
...bunch of stuff that doesn't need to change...
...then...
Variable Name: CMAKE_CXX_FLAGS_RELEASE
Description: Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).
Current Value: -O3 -DNDEBUG
New Value (Enter to keep current value):
On this one I change it to "-march=native -DNDEBUG". This sets the GCC CPU optimizations without the -O2/-O3 optimization enhancements, if you will.
Then:
Code:
Variable Name: CMAKE_CXX_FLAGS_RELWITHDEBINFO
Description: Flags used by the compiler during Release with Debug Info builds.
Current Value: -O2 -g
New Value (Enter to keep current value):
I change this one to just "-g".
Again later:
Code:
Variable Name: CMAKE_C_FLAGS_RELEASE
Description: Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).
Current Value: -O3 -DNDEBUG
New Value (Enter to keep current value):
Same as CMAKE_CXX_FLAGS_RELEASE, I set this to "-march=native -DNDEBUG".
Last -O2 entry:
Code:
Variable Name: CMAKE_C_FLAGS_RELWITHDEBINFO
Description: Flags used by the compiler during Release with Debug Info builds.
Current Value: -O2 -g
New Value (Enter to keep current value):
Like CMAKE_CXX_FLAGS_RELWITHDEBINFO, I set this to just "-g".
Finally, if you want "Bots":
Code:
Variable Name: EQEMU_ENABLE_BOTS
Description: Enable Bots
Current Value: OFF
New Value (Enter to keep current value):
Change that to "ON" and continue to the end.
After "cmake -i" finishes, to compile the build:
All of the built binaries will be in the Bin/ directory. At this point, I usually shut the server down, create a back up of my existing server directory, and then run:
Code:
cp Bin/* <server directory>
This will copy everything in Bin/ to the server's directory. It will have libCommon.a in there. This file can be removed as it's only needed during compile, as was explained to me not too long ago.
Finally, if you're on a multi-core system you can use "make -jx" (instead of just "make") where x is the number of CPU cores you want to use during compile. This greatly speeds up the compile. For example, on my quad-core system I use "make -j3" to use 3 cores, because my one of my cores is usually really busy with MySQL queries.