Updated CMakeLists (see details). Cleared main().

-Added extra compile flags as Quentin requested
-Fixed compile modes not working due to commands order
-Fixed typos