Port arith checks to CMake