zaphoyd/websocketpp — pull request #204 by jonnenauha (2013-04-01 15:09:59+00:00)
Title: CMake prebuild system

Hello,

As I mentioned in one of the issues I was interested in moving websocketpp from scons to cmake. I don't know if @zaphoyd will adopt this to mainline, but CMake might be a more familiar system for more people. Currently buiding the 0.3 branch is quite difficult on windows and this is what I tackled first as my main target.

CMake is a multiplatform prebuild system that spits out makefiles/IDE spesific solution/project files. It has very extensive built in modules that can find all kinds of dependencies that your project might require.

This pull request is not done and should not be merged yet. I just want to lay out the work here so people can review and comment on it.

Done
* All the basics in main CMakeLists.txt are there.
* Finding boost

Todo
* Properly support BUILD_EXAMPLES. Almost done but VC9 stdint.h errors stop the build.
* Properly support BUILD_TESTS. CMakeLists.txt not done yet, adding this is quite trivial.
* Properly support ENABLE_CPP11 and port it to whatever scons was doing with it.
* Find out exact boost dependencies for linux/osx and link to them.
* Test on OSX (I dont have this) and linux (I can test ubuntu etc. on a VM)

Questions for @zaphoyd
* Can I go ahead and add http://msinttypes.googlecode.com/svn/trunk/stdint.h to the repo and include it into the project when VC9 is used? I assume you want to keep supporting VC9 with ENABLE_CPP11=FALSE? I think you had stdint.h in the repo when /windows was still there for exactly this case.
* I'm trying to figure out what boost libraries I should link against on each platform. It looks like you are linking to `system thread regex` if `ENABLE_CPP11=FALSE`. What should I link against if CPP11 is true. I have VC10 that I can try but my main VC9 does not have any CPP11 (except tr1 stuff).
* If `ENABLE_CPP11=TRUE` it seems i need to define preprocessor macro `_WEBSOCKETPP_CPP11_STL_` and add `-std=c++0x` etc. for gcc/g++. Anything else?
* Do you use any other preprocessor macros that will affect the build that I should take care of?

P.S. Thanks for the lib. Hopefully cmake would make it more accessible for more people :) I'm sorry if I have a bit of trouble porting the scons scripts to cmake, its all new to me and its quite hard to understand some of the parts.