1

I'm building a project for a build server which uses CMake 2.8.12. However my local version needs to be CMake 3.3 to support VS2015. So I tend to use features (like interface-libraries) that are not available in CMake 2.8 which I only notice once I pushed it to the build-server.
Is it possible to make CMake act like an older version and (at least) warn/error on using features that came with newer versions?
I know about about the policies and I could set all of them to OLD but that won't stop me from (e.g.) using an interface library.

What also makes it harder is that the documentation does not seem to mention when a feature was added. You would have to crawl through all release notes. Or is there a central changelog? Like "Added after CMake 2.8.12 to 3.3.1" or so?

Flamefire
  • 5,313
  • 3
  • 35
  • 70
  • Just for clarification: you use `cmake_minimum_required(VERSION 2.8.12)` doesn't prevent using interface libraries. Is this what do you observe? – Tsyvarev Oct 01 '17 at 23:11
  • 1
    Exactly. Even with 2.8.12 set as minimum version I can use interface libraries without any warning or error. But I would like an error for this. – Flamefire Oct 01 '17 at 23:43
  • I requested that the docs annotate the commands with the version in which they were introduced in order to solve this problem. Their response was to simply use older docs only when looking up commands. That's fine for the web browser, but I often use the command-line help too. – legalize Oct 03 '17 at 00:19
  • Possible duplicate of [Finding which CMake version a feature was introduced in](https://stackoverflow.com/questions/40844358/finding-which-cmake-version-a-feature-was-introduced-in) – Florian Oct 04 '17 at 07:00
  • This is helpful and answers the 2nd part of the question. So I assume there is no way to make cmake behave like it was older than it is? – Flamefire Oct 05 '17 at 13:11

0 Answers0