Re: [CMake] [cmake-developers] C++11/C++14 doesn't work in check_cxx_source_compiles

2016-11-28 Thread Brad King
On 11/24/2016 01:43 PM, Roman Wüger wrote: > Shouldn't this be done by CMAKE_CXX_STANDARD? Yes, this is a known problem with try_compile. It needs to learn to honor the CMAKE__STANDARD. CMake itself works around this problem in some cases, e.g. *

Re: [CMake] [cmake-developers] C++11/C++14 doesn't work in check_cxx_source_compiles

2016-11-25 Thread Craig Scott
Sorry, bad link in that last email. The try_compile() docs I meant to link to are here: https://cmake.org/cmake/help/latest/command/try_compile.html#other-behavior-settings On Sat, Nov 26, 2016 at 9:23 AM, Craig Scott wrote: > Sorry, I misunderstood. I had a look

Re: [CMake] [cmake-developers] C++11/C++14 doesn't work in check_cxx_source_compiles

2016-11-25 Thread Craig Scott
Sorry, I misunderstood. I had a look through the check_cxx_source_compiles() implementation and it basically forwards through to a try_compile() call. Looking at the docs for try_compile() , it says only the following are passed through to the temporary CMake project created for the test

Re: [CMake] [cmake-developers] C++11/C++14 doesn't work in check_cxx_source_compiles

2016-11-25 Thread Roman Wüger
but it does not set/add the required library > Am 24.11.2016 um 22:01 schrieb Craig Scott : > > You might also need to set CMAKE_CXX_EXTENSIONS to OFF (it's ON by default). > This controls which c++ library is linked for some compilers, with clang and > gcc being two

Re: [CMake] [cmake-developers] C++11/C++14 doesn't work in check_cxx_source_compiles

2016-11-24 Thread Craig Scott
You might also need to set CMAKE_CXX_EXTENSIONS to OFF (it's ON by default). This controls which c++ library is linked for some compilers, with clang and gcc being two cases where it does this. You may also find this article

Re: [CMake] [cmake-developers] C++11/C++14 doesn't work in check_cxx_source_compiles

2016-11-24 Thread Roman Wüger
It is working now, after I added -lc++ to CMAKE_REQUIRED_LIBRARIES before the check_cxx_source_compiles() call. Shouldn't this be done by CMAKE_CXX_STANDARD? Best Regards Roman > Am 24.11.2016 um 19:08 schrieb Roman Wüger : > > Hello, > > If I use a small piece of code