CMAKE, Clang et C++v11 sur OS X 10.8

OS X 1.8

CMAKE 2.8.9

Clang $ clang -v
Apple clang version 4.0 (tags/Apple/clang-421.10.60) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.0.0
Thread model: posix

CMAKELists.txt:

cmake_minimum_required (VERSION 2.8.9)
project (Test)
add_executable(Test main.cpp)

main.cpp

//Create a C++11 thread from the main program
#include <iostream>
#include <thread>

//This function will be called from a thread
void call_from_thread() {
    std::cout << "Hello, World!" << std::endl;
}

int main() {
    //Launch a thread
    std::thread t1(call_from_thread);

    //Join the thread with the main thread
    t1.join();

    return 0;
}

Mon erreur:

$ make
Scanning dependencies of target Test
[100%] Building CXX object CMakeFiles/Test.dir/main.cpp.o
test/main.cpp:4:10: fatal error: 'thread' file not found
#include <thread>
     ^
1 error generated.
make[2]: *** [CMakeFiles/Test.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Test.dir/all] Error 2
make: *** [all] Error 2

Ne sorte de la version de Clang pas le support C++v11 fonctionnalités? Ce même programme ne compile avec gcc-4.7.1 sur OSX 10.8

Cette référence dit qu'il doit travailler http://www.cpprocks.com/a-comparison-of-c11-language-support-in-vs2012-g-4-7-and-clang-3-1/

Ce que je fais mal?

Avez-vous ajouté -std=c++11 -stdlib=libc++ les drapeaux du compilateur?

OriginalL'auteur Jason | 2012-08-15