Qt 5.7 adding -std=gnu++11 to my compiler flags, clobbering -std=c++14
<p>I am setting the following flags in my <code>CMakeLists.txt</code></p>

<pre><code>set(CMAKE_CXX_FLAGS "-std=c++14 -g -O0")
</code></pre>

<p>I am then using <code>find_package</code> to locate <code>Qt5Test</code></p>

<pre><code>find_package(Qt5Test REQUIRED)
</code></pre>

<p>I am then creating a <a href="https://wiki.qt.io/Model_Test" rel="noreferrer">Model Test</a> library</p>

<pre><code>add_library          (modeltest STATIC ${SRCS})
target_link_libraries(modeltest Qt5::Test)
</code></pre>

<p>For some reason I'm getting <code>-fPIC -std=gnu++11</code> added to my compiler flags</p>

<pre><code>CMakeFiles/modeltest.dir/flags.make:CXX_FLAGS = -std=c++14 -g -O0 -fPIC -std=gnu++11
</code></pre>

<p>This is clobbering my <code>-std=c++14</code> flag, causing all the c++14 features in my program to end up as compiler errors:</p>

<pre><code>error: ‘foo’ function uses ‘auto’ type specifier without trailing return type
constexpr auto foo()
                   ^
note: deduced return type only available with -std=c++14 or -std=gnu++14
</code></pre>

<ul>
<li>Is there a way to fix this? </li>
<li>I'm using the latest version of Qt 5.7 downloaded from their site today</li>
</ul>