Fix non-C89 variable declaration.

Microsofts C compiler does not support the C99 standard, so variables has
to be declared at the start of a scope.
Initial CMake commit.
Add all tests and benchmarks to CMake project.

Also fixed some minor issues with what's built.
More work on adding tests to CMake project
Generate a dummy evconfig-private.h so things build properly.

Windows used to have an empty file for this before.
Link libm on unix platforms.
Added some GCC specific options.

- Added sample applications.
- Fixed the https-client to work on Windows kind of (No cert validation).
Use evutil_closesocket instead.
Add copyright and licensing files for CMake modules.
Only include WIN32 getopt where it is used.

getopt is only used in the benchmark tests, don't include it in the core
lib...
Fix bench_cascade program on Windows.
Don't segfault on no found event backend.
Only test the event backends available on the system.

Fix how the CMake project adds the tests using the different backends. At
first we tried to do it exactly as it's done in test/test.sh.

However, test.sh uses a special program test-init to decide if a given
backend is available or not before running the actual tests. Doing it this way
will not be possible using CMake. Since then we would have to have the
test-init executable compiled at the time we run CMake, to know what tests
we should add. (And since CMake generates the make/project files that
compiles the executables, there's a catch 22).

Instead of deciding what tests to run this way, we simply use the result
of the CMake system introspection (that figures out what backends are
available) to decide what backend tests to add.
Added a "make verify" target.

This is more than for cosmetic purposes to match how it's done with autoconf.

Due to the fact that we use environment variables to turn off certain backends during the tests, simply running "ctest" or "make test" can result in failed tests.

This is because if you do "EVENT_NOEPOLL=yes && export EVENT_NOEPOLL" and then run the tests, when running the epoll tests, the EPOLL backend will be turned off. There is no way of unsetting an environment variable for a test in CMake, you can only set them. And since libevent simply checks if the environment variable is set (it doesn't check the actual value of it), this won't work.

So to remedy this, we create the "make verify" target that first unsets all the EVENT_NO* environment variables, and then runs ctest.

Also bumped the required CMake version from 2.6 to 2.8, since the set_test_properties(bla PROPERTIES ENVIRONMENT "SOME_VAR") requires 2.8

Added some explicit dependencies for the test programs to libevent, so they don't just fail if you try to run the tests without first doing "make"
Fix the make "verify" target on Windows.

Windows does not have the "unset" command, but this doesn't matter since
the problem that requires us to use unset doesn't happen on Windows.

Also did some minor cosmetic changes, and dependcy changes.
Get rid of deprecation warnings for OpenSSL on OSX 10.7+
Fix kqueue support.
Added a test for testing if kqueue works with pipes.
Change the BSD license from 4 to 3-clause.

This makes it GPL compatible. Changing the license from 4 to 3-clause BSD
license is OK according to a Berkley announcement on July 22, 1999 by
William Hoskins, the director of the fofice of technology licensing for
Berkley:

ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
Minimum required python version is 2.4.

Got rid of TODO... The version you specify to find_package is the minimum
version, so exactly what we want.