Remove CMAKE_HOST_ references CMAKE_HOST_ describes the host system not the target. For cross compilation to work the actual target system should be used for making decisions in CMake.