support CMake build. Tested only in windows