WL#5161: CMake-based unified build system

Affects: Server-5.5   —   Status: Complete

Currently, there are 2 build do different toolsets used to build MySQL Server
- GNU (autoconf, automake, libtool)  is used on Unixes.
- CMake  is used on Windows.

The purpose of this worklog is to unify the build system .After evaluation 
period, switch from using 2 different systems to a  single one CMake

The main reasons for choosing CMake is that it is obviously simpler to maintain 
a unified build system than two disparate systems.

Here are some pro-CMake arguments:

- It works on Window. GNU buildsystem does not appear to be enough  “cross-
platform”,  that is it does not work and likely never will work natively on 
Windows.

- Traditionally, new MySQL features that required changes in build (plugin 
yystem,  unit tests,  most recently  googletest integration) were always 
implemented on Unixes first, leaving Windows behind, sometimes for years. This 
would not happen with unified build system.

- We already use CMake since 2006 on Windows, so we do not need to start from 
scratch, only port what we have to Unix.

- CMake runs on every OS and compiler we support.

- It is simple to  get. It is available  in all major Linux  repositories 
(checked Ubuntu, Fedora, OpenSUSE). It is also in OpenSolaris repository, known 
as SUNWCmake. It in FreeBSD ports. The It is also very simple to compile it 
from source, the single prerequisite is a working C++ compiler and make utility.

- CMake has support features we need and might need:  system checks, cross-
compiling.

- CMake  provides integrated support for packaging. It can handle both simple 
packages (tar.gz or zip archives) and more complex things like DEB and RPM 
without much extra coding.

- Good integration with the popular IDEs (Visual Studio, Xcode, Eclipse CDT, 
KDevelop). Developing in IDE makes development process more enjoyable, and 
potentially it lowers the barrier for external contributors. Of course, cmake 
can generate traditional Unix Makefiles, which appear to be are superior to 
autotools generated ones (for example they have progress indicators, color and 
working dependencies).

- Scripting language used by CMake is simpler m4 used by autotools.

- CMake is a single small tool, not a bunch of different tools as in GNU system
(autoconf,autoheader,automake,libtool)