Thanks I was exactly looking for this in particularly, must have searched 
wrongly!


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?

________________________________
Van: Brad King <brad.k...@kitware.com>
Verzonden: woensdag 23 augustus 2017 16:18
Aan: maikel van den Hurk; cmake-developers@cmake.org
Onderwerp: Re: [cmake-developers] Extend CMAKE_<LANG>_FLAGS(_<CONFIG>) from a 
CMake Toolchain

On 08/23/2017 09:56 AM, maikel van den Hurk wrote:
> 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.

This has been possible since commit v3.7.0-rc1~392^2 (Honor
CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files,
2016-07-05).  See the CMake 3.7 release notes:

  https://cmake.org/cmake/help/v3.9/release/3.7.html#variables
CMake 3.7 Release Notes — CMake 3.9.1 
Documentation<https://cmake.org/cmake/help/v3.9/release/3.7.html#variables>
cmake.org
Generators ¶ The Ninja generator learned to conditionally support Fortran when 
using a ninja tool that has the necessary features. See generator documentation 
for ...



  "Toolchain files may now set a CMAKE_<LANG>_FLAGS_INIT variable
  to initialize the CMAKE_<LANG>_FLAGS cache entry the first time
  a language is enabled in a build tree."

See documentation here:

  https://cmake.org/cmake/help/v3.9/variable/CMAKE_LANG_FLAGS_INIT.html
CMAKE_<LANG>_FLAGS_INIT — CMake 3.9.0 
Documentation<https://cmake.org/cmake/help/v3.9/variable/CMAKE_LANG_FLAGS_INIT.html>
cmake.org
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>.




-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to