Added cmake support and static library building.
On MSVC there is no m library
On MSVC optimizations will be automatically set by selected build configuration
Added workaround for target_compile_options for old cmake
Put workaround in a more appropriate place
Merge pull request #4 from projedi/my-branch

merge back 2