title: Forcing C99 in CMake (to use 'for' loop initial declaration)
body: <p>I've been searching a portable way to force CMake to enable the compiler's C99 features in order to avoid the following <code>gcc</code> error for instance:</p>
  
  <pre><code>error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int s = 1; s &lt;= in_para-&gt;StepNumber; s++){
  ^
  </code></pre>
  
  <p>I also wouldn't like to check for which compiler and append something like:</p>
  
  <pre><code>set(CMAKE_C_FLAGS "-std=c99") # that would be bad
  </code></pre>
  
  <p>So I found this post: <a href="http://cmake.3232098.n2.nabble.com/Enabling-C99-in-CMake-td6505762.html" rel="noreferrer">Enabling C99 in CMake</a> and the associated feature request: <a href="http://www.cmake.org/Bug/view.php?id=12300" rel="noreferrer">0012300: CMake has no cross-platform way to ask for C99</a>. In this Mantis bug I learned about <a href="http://www.steveire.com/cmake-future/manual/cmake-compile-features.7.html#manual:cmake-compile-features%287%29" rel="noreferrer"><code>target_compiler_features</code></a> and after that I found these SOF answers on it: <a href="https://stackoverflow.com/a/20165519/1254880">How to activate C++11 in CMake?</a> and <a href="https://stackoverflow.com/a/20165220/1254880">How to detect C++11 support of a compiler with CMake</a>.</p>
  
  <p>So my questions are: this <code>target_compiler_features</code> will provide a way to require a C feature as well as a C++ one? What is the most portable way to achive this by now - I'm currently using CMake 2.8.12.2. The <code>target_compiler_features</code> isn't in CMake's most recent release version (3.0.0). Do you know when it is being released?</p>