[cmake-developers] c++ feature detection and usage requirements

Stephen Kelly steveire at gmail.com
Fri Aug 30 08:02:10 EDT 2013


Brad King wrote:

> On 08/29/2013 11:14 AM, Stephen Kelly wrote:
>> Another option would be not to have the VERSION in the signature, but
>> always use CMAKE_MINIMUM_VERSION_REQUIRED to determine what to generate.
>> 
>> The content generated depends only on the features of the cmake binary
>> being run, so it relieves users of the need to additionally maintain the
>> VERSION here and figure out how that maps to their minimum cmake version.
> 
> A project may wish to update to a newer required CMake version for some
> other feature but is not ready to port their header generation.  We
> could define the versions w.r.t. the CMake version and make VERSION
> optional.  If not present use CMAKE_MINIMUM_VERSION_REQUIRED.  If
> present then fail if VERSION is newer than CMAKE_MINIMUM_VERSION_REQUIRED.

I put an untested pseudo-code version of this in my compiler_features 
branch. It turns out that in order to do this, the compiler features would 
have to be listed independently of Modules/Compiler/${ID}.cmake. Otherwise I 
wouldn't be able to check the MSVC features while using GNU. 

Maybe they should be listed in Modules/CompilerFeatures/${ID}-${LANG}.cmake 
instead?

> 
> We also need a plan to phase out support for ancient versions in the
> future.

Any ideas on how to do that? 

Thanks,

Steve.




More information about the cmake-developers mailing list