Merge pull request #1652 from gnl21/cmake-fix

Work around a CMake cross-compilation issue