target_compile_feature does not set language
Hi,
...
project(${TARGET_NAME} VERSION 1.0.0)
...
set(CMAKE_CXX_COMPILER ${CPP_COMPILER})
set(CMAKE_C_COMPILER ${C_COMPILER})
...
target_compile_features(${TARGET_NAME} PUBLIC cxx_std_14)
I get, with gcc 5.5.0 (Ubuntu 16.04):
g++ -I/MyPackage/src/MyProject -isystem /MyPackage/includes -DNDEBUG -O2 -Wall -Wextra -Wconversion -Wold-style-cast -Winline -pedantic -o CMakeFiles/MyProject.dir/source1.cpp.o -c /MyPackage/src/MyProject/source1.cpp
In file included from /usr/include/c++/5/tuple:35:0,
from /MyPackage/includes/ThaliaUtilities/SomeHeader.hpp:35,
from /MyPackage/src/ThaliaUtilities_UT/MyProject.h:21,
from /MyPackage/src/ThaliaUtilities_UT/MyProject.cpp:21:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
I indeed cannot see -std=c++14 in the command line gcc does not seem to default to C++11.
Is there an issue with target_compile_features, is it a misuse on my part?