Re: [cmake-developers] Wrong cxx-extension flags
Am Donnerstag, 14. Juli 2016 um 16:06:17, schrieb Brad King> On 07/14/2016 03:59 PM, Kornel Benko wrote: > >> What you can do is not add your own flag and instead do > >> > >> set(CMAKE_CXX_STANDARD 14) > >> set(CMAKE_CXX_EXTENSIONS OFF) > > > > 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. > > I don't quite follow here. What flag to you want to get? I meant we don't need to test for c++14. > Don't add your own flag explicitly. Some combination of > the above settings can get the flag you need. I have to stick also with older cmake versions, so bear with me. Nonetheless, I tested some combinations already, and it all looks good. > -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
Re: [cmake-developers] Wrong cxx-extension flags
Am Donnerstag, 14. Juli 2016 um 15:27:00, schrieb Brad King> 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
Re: [cmake-developers] Wrong cxx-extension flags
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. 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) 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 -- 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
Re: [cmake-developers] Wrong cxx-extension flags
Am Donnerstag, 14. Juli 2016 um 14:36:43, schrieb Brad King> In lyx I see the > > development/cmake/modules/FindCXX11Compiler.cmake I had to reread. Yes, I know this file too. There is set the '-std=c++14'. But I am asking about '-std=gnu++11'. 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
Re: [cmake-developers] Wrong cxx-extension flags
Am Donnerstag, 14. Juli 2016 um 14:36:43, schrieb Brad King> On 07/14/2016 01:59 PM, Kornel Benko wrote: > > I was trying to compile lyx with QT5.7. > > ... > > found that the flags in the flag.cmake files were mismatched. > > > > Therefore I started searching, where the extra ' --std=gnu++11' came > > from, and found it in Modules/Compiler/GNU-CXX.cmake. > > It appears there but only in a table. Other settings are required > to get the table entry to be used. See the CXX_STANDARD target > property: > > https://cmake.org/cmake/help/v3.6/prop_tgt/CXX_STANDARD.html > > Unless you or the project is setting that (perhaps via the > CMAKE_CXX_STANDARD variable) then CMake won't add any flags. > > In lyx I see the > > development/cmake/modules/FindCXX11Compiler.cmake No, this file is only used for QT4. The new cmake-files from QT5.7 are somehow responsible that this happens. If I compile with QT5.6 (which also has files like Qt5CoreConfig.cmake) no such problem occurs. > source file that adds such flags. Please ask them about it. I know, I am one of the creators. But, as already said, this is not the case here. > -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
Re: [cmake-developers] Wrong cxx-extension flags
On 07/14/2016 01:59 PM, Kornel Benko wrote: > I was trying to compile lyx with QT5.7. > ... > found that the flags in the flag.cmake files were mismatched. > > Therefore I started searching, where the extra ' --std=gnu++11' came > from, and found it in Modules/Compiler/GNU-CXX.cmake. It appears there but only in a table. Other settings are required to get the table entry to be used. See the CXX_STANDARD target property: https://cmake.org/cmake/help/v3.6/prop_tgt/CXX_STANDARD.html Unless you or the project is setting that (perhaps via the CMAKE_CXX_STANDARD variable) then CMake won't add any flags. In lyx I see the development/cmake/modules/FindCXX11Compiler.cmake source file that adds such flags. Please ask them about it. -Brad -- 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
Re: [cmake-developers] Wrong cxx-extension flags
Am Donnerstag, 14. Juli 2016 um 13:35:06, schrieb Brad King> On 07/14/2016 01:13 PM, Kornel Benko wrote: > > -- The CXX compiler identification is GNU 6.1.0 > > -- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=gnu++11 > > I expected here "-- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=c++14". > > That is the option for C++11 with extensions. See > CMAKE_CXX14_EXTENSION_COMPILE_OPTION for C++14 with extensions. > Both of these are internal table entries for CMake's generators > and not meant for direct use by projects. > > What are you actually trying to do? > > -Brad I was trying to compile lyx with QT5.7. The effect was, that the compilation failed. Searching for a reason I found that the flags in the flag.cmake files were mismatched. Here one example: # CMAKE generated file: DO NOT EDIT! # Generated by "Unix Makefiles" Generator, CMake Version 3.6 # compile CXX with /usr/local/gcc6.1/bin/g++ CXX_FLAGS = -Wall -Wunused-parameter --std=c++14 -fno-strict-aliasing -Wall -Wunused-parameter --std=c++14 -fno-strict-aliasing -O0 -g3 -D_DEBUG -DBOOST_USER_CONFIG="" -fPIC --std=gnu++11 ... Therefore I started searching, where the extra ' --std=gnu++11' came from, and found it in Modules/Compiler/GNU-CXX.cmake. To verify, I made the output of this variable. To be clear, I did not want to do anything with the variable CMAKE_CXX14_EXTENSION_COMPILE_OPTION. 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
Re: [cmake-developers] Wrong cxx-extension flags
On 07/14/2016 01:13 PM, Kornel Benko wrote: > -- The CXX compiler identification is GNU 6.1.0 > -- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=gnu++11 > I expected here "-- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=c++14". That is the option for C++11 with extensions. See CMAKE_CXX14_EXTENSION_COMPILE_OPTION for C++14 with extensions. Both of these are internal table entries for CMake's generators and not meant for direct use by projects. What are you actually trying to do? -Brad -- 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