[cmake-developers] Wrong cxx-extension flags

Kornel Benko kornel at lyx.org
Thu Jul 14 13:13:38 EDT 2016


I have 2 compilers installed. The attached minimal CMakeLists.txt example shows everything OK if
using the compiler at standard place.

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=gnu++11
-- Configuring done
-- Generating done
-- Build files have been written to: /usr2/kornel/tmp/cmake

But setting for alternative compiler (on clean build dir)
	env{CXX} => /usr/local/gcc6.1/bin/g++
	env{CC} =>  /usr/local/gcc6.1/bin/gcc
I get following output:

-- The C compiler identification is GNU 6.1.0
-- The CXX compiler identification is GNU 6.1.0
-- Check for working C compiler: /usr/local/gcc6.1/bin/gcc
-- Check for working C compiler: /usr/local/gcc6.1/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/gcc6.1/bin/g++
-- Check for working CXX compiler: /usr/local/gcc6.1/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=gnu++11
-- Configuring done
-- Generating done
-- Build files have been written to: /usr2/kornel/tmp/cmake

I expected here "-- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=c++14".

My cmake version is "cmake version 3.6.20160714-ga6bd0"

	Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160714/2c27d9ed/attachment.sig>


More information about the cmake-developers mailing list