Answering my own question : this is fixed on trunk http://www.cmake.org/Bug/view.php?id=15355
Laurent From: Laurent Demailly <[email protected]<mailto:[email protected]>> Date: Wednesday, January 14, 2015 at 8:33 PM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: [CMake] set(CMAKE_CXX_STANDARD 11) on macos - "...CMake does not know the compile flags to use to enable it." Hi all, I have a very simple CMakeLists.txt – am using cmake 3.1 to be able to easily request C++ 11 – it works fine on ubuntu but not on MacOS with Xcode 6 and command line tools installed: $ cat CMakeLists.txt cmake_minimum_required(VERSION 3.1) project("Test1" C CXX) # We need C++ 11 set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED on) file(WRITE test1.cpp "int main(int argc, char** argv) {auto x=argc; return x;}") add_executable(test1 test1.cpp) $ cmake31 . -- The C compiler identification is AppleClang 6.0.0.6000056 -- The CXX compiler identification is AppleClang 6.0.0.6000056 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done CMake Error in CMakeLists.txt: Target "test1" requires the language dialect "CXX11" (with compiler extensions), but CMake does not know the compile flags to use to enable it. This is with CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CXXFLAGS="-std=c++11" But same without that Any idea why Cmake complains and how to not make it complain ? Help/pointer greatly appreciated Thanks Laurent
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
