在CMake模块目录中有一个文件readme.txt
,其中包含CMake模块编写器的有用信息。这是该文件中关于如何将版本号传递给模块的相关部分:
If any version numbers are given to the command it will set the
following variables before loading the module:
XXX_FIND_VERSION = full requested version string
XXX_FIND_VERSION_MAJOR = major version if requested, else 0
XXX_FIND_VERSION_MINOR = minor version if requested, else 0
XXX_FIND_VERSION_PATCH = patch version if requested, else 0
XXX_FIND_VERSION_TWEAK = tweak version if requested, else 0
XXX_FIND_VERSION_COUNT = number of version components, 0 to 4
XXX_FIND_VERSION_EXACT = true if EXACT option was given
非常感谢!这真的有助于获得这个变量引用。 – Drake 2011-02-04 04:13:09