Re: [CMake] How to set C++ standard?

2017-04-20 Thread Alex Chen
lt;alex_c...@filemaker.com> Cc: CMake <cmake@cmake.org> Subject: Re: [CMake] How to set C++ standard? You generally shouldn't set CMAKE_CXX_STANDARD on its own, you should also be explicitly setting CMAKE_CXX_STANDARD_REQUIRED and CMAKE_CXX_EXTENSIONS to ensure you are getting the

Re: [CMake] How to set C++ standard?

2017-04-20 Thread Craig Scott
You generally shouldn't set CMAKE_CXX_STANDARD on its own, you should also be explicitly setting CMAKE_CXX_STANDARD_REQUIRED and CMAKE_CXX_EXTENSIONS to ensure you are getting the behaviour you want. These would also typically be set by the project's own CMakeLists.txt file rather than being

[CMake] How to set C++ standard?

2017-04-20 Thread Alex Chen
I tried to set the compiler flag –std=c++14 via cmake command line on Linux with –DCMAKE_CXX_STANDARD=14.  The message from ‘make’ shows   -std=c++11 –std=gnu++14 If I do not set that flag, I get -std=c++11.  This seem to imply the CMAKE_CXX_STANDARD flag sets gnu++ instead of c++.  How do I