Am Donnerstag, 14. Juli 2016 um 15:27:00, schrieb Brad King <brad.k...@kitware.com> > On 07/14/2016 02:48 PM, Kornel Benko wrote: > > I am asking about '-std=gnu++11'. > On 07/14/2016 02:45 PM, Kornel Benko wrote: > > The new cmake-files from QT5.7 are somehow responsible that this happens. > > The file `lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake` in Qt 5.7 contains: > > set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES > cxx_decltype) > > This tells CMake that dependents of this library need to be compiled as > at least C++11. This causes `-std=gnu++11` to be added automatically.
Thanks Brad, that was what I was searching for. > What you can do is not add your own flag and instead do > > set(CMAKE_CXX_STANDARD 14) > > or set the CXX_STANDARD property of specific targets. That tells CMake > to build as C++14 so it will add -std=gnu++14. If you don't want the > extensions then also set > > set(CMAKE_CXX_EXTENSIONS OFF)l I did this, as it seemed least invasive. But now, instead of '-std=gnu++1' I got '-std=c++11' which is not better. Of course, since QT5.7 explicitly requires C++11 features, we don't need C++14. > Relevant docs: > > https://cmake.org/cmake/help/v3.6/manual/cmake-compile-features.7.html > https://cmake.org/cmake/help/v3.6/variable/CMAKE_CXX_STANDARD.html > https://cmake.org/cmake/help/v3.6/variable/CMAKE_CXX_EXTENSIONS.html > > -Brad Kornel
signature.asc
Description: This is a digitally signed message part.
-- 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-developers