Refactor out some stuff to CMake tests
Skip unnecessary CMake tests
Fix mistaken preprocessor conditionals
Add missing HAVE_WIN_ATOMIC block
Merge pull request #166 from TsudaKageyu/cmake_test

Refactor out some stuff to CMake tests