I would like to target a specific version of CMake that is older than the version I am using myself (related to this question, i.e. correctly using cmake_minimum_requi
I made a firefox plugin, named CSince, available in https://addons.mozilla.org/firefox/addon/csince/.
When viewing a page of CMake documentation, it checks since which version the corresponding feature exists, and adds the information to the html contents.
A first checking is performed for versions starting with v3.0: the url pattern is checked for prior versions until a 404 error is returned by the server. For example, considering url for property BINARY_DIR:
https://cmake.org/cmake/help/latest/prop_dir/BINARY_DIR.html
Here urls are tested replacing latest with a version string:
https://cmake.org/cmake/help/v3.0/prop_dir/BINARY_DIR.html
https://cmake.org/cmake/help/v3.1/prop_dir/BINARY_DIR.html
https://cmake.org/cmake/help/v3.2/prop_dir/BINARY_DIR.html
...
Versions are tested using a dichotomic approach, to limit requests.
If the first checking process returns v3.0, a second pass is performed for older versions using a less reliable test: the single-page documentation is requested, and the feature string is searched in the text.
This two-passes system allows for example to find the right version for the property BINARY_DIR: the string BINARY_DIR obviously exists in CMake documentation v2.6, while it exists as a property only since CMake v3.7.
Any bug report or improvement request are welcome. Code source is available on GitHub under license MIT/X11: https://github.com/wasthishelpful/csince.