<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Thanks I was exactly looking for this in particularly, must have searched wrongly!</p>
<p><br>
</p>
<p>Though I wonder for example how could I for example change in my toolchain file which is setting up a GCC based compiler for example in release context the optimisation from O3 (CMake internal setting) to O2. It seems that there is mainly done appending
 instead of prepending to the FLAGS_INIT. Where generally speaking in context of GCC the last defined flag will be used, so how to deal properly with that?</p>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Van:</b> Brad King <brad.king@kitware.com><br>
<b>Verzonden:</b> woensdag 23 augustus 2017 16:18<br>
<b>Aan:</b> maikel van den Hurk; cmake-developers@cmake.org<br>
<b>Onderwerp:</b> Re: [cmake-developers] Extend CMAKE_<LANG>_FLAGS(_<CONFIG>) from a CMake Toolchain</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On 08/23/2017 09:56 AM, maikel van den Hurk wrote:<br>
> I was wondering why there is no ability to define CMAKE_<LANG>_FLAGS(_<CONFIG>) within a CMake Toolchain file, but still benefit from the CMAKE_<LANG>_INIT_FLAGS(_<CONFIG>) detected from CMake internals.
<br>
<br>
This has been possible since commit v3.7.0-rc1~392^2 (Honor<br>
CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files,<br>
2016-07-05).  See the CMake 3.7 release notes:<br>
<br>
  <a href="https://cmake.org/cmake/help/v3.9/release/3.7.html#variables" id="LPlnk194592" previewremoved="true">
https://cmake.org/cmake/help/v3.9/release/3.7.html#variables</a>
<div id="LPBorder_GT_15035015377430.5085184690353162" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15035015377420.44763529528428314" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15035015377420.16809134699791684" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15035015377430.7049481153789453"></div>
<div id="LPTitle_15035015377430.957619656813524" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15035015377430.060435410951424795" href="https://cmake.org/cmake/help/v3.9/release/3.7.html#variables" target="_blank" style="text-decoration: none;">CMake 3.7 Release Notes — CMake 3.9.1 Documentation</a></div>
<div id="LPMetadata_15035015377430.25595766796022934" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
cmake.org</div>
<div id="LPDescription_15035015377430.2273221946833367" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Generators ¶ The Ninja generator learned to conditionally support Fortran when using a ninja tool that has the necessary features. See generator documentation for ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
  "Toolchain files may now set a CMAKE_<LANG>_FLAGS_INIT variable<br>
  to initialize the CMAKE_<LANG>_FLAGS cache entry the first time<br>
  a language is enabled in a build tree."<br>
<br>
See documentation here:<br>
<br>
  <a href="https://cmake.org/cmake/help/v3.9/variable/CMAKE_LANG_FLAGS_INIT.html" id="LPlnk596258" previewremoved="true">
https://cmake.org/cmake/help/v3.9/variable/CMAKE_LANG_FLAGS_INIT.html</a>
<div id="LPBorder_GT_15035015670310.6697429433412573" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15035015670270.7908103162731355" role="presentation" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_15035015670300.2052480823354519" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_15035015670300.2618357074514138"></div>
<div id="LPTitle_15035015670300.21712928326532477" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15035015670300.12692140029346644" href="https://cmake.org/cmake/help/v3.9/variable/CMAKE_LANG_FLAGS_INIT.html" target="_blank" style="text-decoration: none;">CMAKE_<LANG>_FLAGS_INIT — CMake 3.9.0 Documentation</a></div>
<div id="LPMetadata_15035015670300.5703601529809513" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
cmake.org</div>
<div id="LPDescription_15035015670310.567724461504723" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
CMAKE_<LANG>_FLAGS_INIT¶ Value used to initialize the CMAKE_<LANG>_FLAGS cache entry the first time a build tree is configured for language <LANG>.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<br>
-Brad<br>
</div>
</span></font></div>
</div>
</body>
</html>