+# Ensure __thread is support
+if (APPLE)
+ include (CheckCXXSourceCompiles)
+ check_cxx_source_compiles("__thread int i; int main() { return 0; }" HAVE_COMPILER_TLS)
+ if (NOT HAVE_COMPILER_TLS)
+ message (FATAL_ERROR "C++ compiler does not support __thread keyword. Please install XCode 4.5 or higher.")
+ endif ()
+endif ()
+