Completely backport XOPEN_SOURCE test from autoconf to CMake