[CMake] cmake_minimum_required in third party scripts

Robert Dailey rcdailey.lists at gmail.com
Thu Aug 23 11:45:46 EDT 2012


Suppose a case where I am taking some CMake modules that provide
additional functionality for me. Those modules are designed to be
third-party, and used independently of any CMake project. However,
those modules will require a minimum version of CMake separate from
the minimum that may be required by the root CMakeLists.txt (which is
provided by another user).

How can I specify the minimum version required for my common modules?
I would expect it to behave like this:

1. If the root CMakeLists.txt minimum required is HIGHER than my
common module's minimum required, then the common module's minimum
required is ignored.
2. If the root CMakeLists.txt minimum required is LOWER than my common
module's minimum required, then the common module's minimum required
takes precedence and should be the version used by the root
CMakeLists.txt

There probably isn't functionality for this now, but when you start to
think of CMake scripts as third party modules, where you could have
multiple of them, each with its own version requirement, this
situation is impossible to handle and becomes very important.

Is there a workaround for this, or does anyone have suggestions?


More information about the CMake mailing list