[CMake] initializing flags from toolchain files (was: CMake 3.6.0-rc4 now ready for testing!)

Brad King brad.king at kitware.com
Thu Jul 7 09:07:02 EDT 2016


On 07/01/2016 04:06 AM, Hendrik Sattler wrote:
> So each and every toolchain file shall also take care of the  
> environment variable?
> How about CMAKE_CXX_FLAGS_INIT set by other module files?

Currently the only way to get CMake's default flags for the
platform and also add one's own flags from a toolchain file
is to set the environment variable.  I've now made changes
(for CMake 3.7) to enable use of CMAKE_CXX_FLAGS_INIT for this:

 Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a66004be

Also, CMake 3.7 will add a new policy to allow the per-config flags
to be used in try_compile too:

 try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG>
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d582c23a

-Brad


More information about the CMake mailing list