fix wrong debug macro
fix build error with VS2008
cmake: support debug flag