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

Stephen Kelly steveire at gmail.com
Thu Aug 29 11:14:50 EDT 2013


Brad King wrote:

>> Yes, versioning is a good idea to think about.
>>
>>write_compiler_detection_header(
>>FILE ${CMAKE_CURRENT_BINARY_DIR}/grantlee_compiler_detection.h
>>PREFIX Grantlee_
>>VERSION 3
>>)
> 
> This could help somewhat because we could change what is produced
> by a newer version while still knowing how to generate the old
> version.  The version argument must be required.

Ok, I see what you mean.

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.

> 
> Rather than a single versioned header we should also consider
> asking the caller to list the information and features needed.
> That way a project can expose a header without more information
> than they want to support.

Yes, good idea.

Thanks,

Steve.





More information about the cmake-developers mailing list