Previously the detection compares "CMAKE_SYSTEM_NAME" and
"CMAKE_TARGET_SYSTEM_NAME", which only contains OS names like "Linux".
This is not sufficient when cross-compiling for different target CPUs.
This patch uses CMAKE_CROSSCOMPILING, which sets automatically by CMake
when cross compiling.