diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-09 22:30:30 +0100 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-02-09 22:30:30 +0100 |
commit | eaf703f16082fdd79983e32356aa20e64f94bd8b (patch) | |
tree | 466b4e6a719330c38a8d6a1b1e0bc1f2ccc1a22d /Source/cmExportInstallFileGenerator.cxx | |
parent | 1cc3e9f2e73b96370257b55f9c96586a898fe9a4 (diff) | |
download | cmake-eaf703f16082fdd79983e32356aa20e64f94bd8b.tar.gz |
Export: Use a macro to ensure minimum development version requirement
Use the version number of the specified release, or of the current
development version if the release is not yet made.
Diffstat (limited to 'Source/cmExportInstallFileGenerator.cxx')
-rw-r--r-- | Source/cmExportInstallFileGenerator.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx index 73e9b319ef..eb7cea9621 100644 --- a/Source/cmExportInstallFileGenerator.cxx +++ b/Source/cmExportInstallFileGenerator.cxx @@ -19,6 +19,18 @@ #include "cmInstallExportGenerator.h" #include "cmInstallTargetGenerator.h" #include "cmTargetExport.h" +#include "cmVersionConfig.h" + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +#define DEVEL_CMAKE_VERSION(maj, min, patch) \ + (maj > CMake_VERSION_MAJOR \ + || min > CMake_VERSION_MINOR \ + || patch > CMake_VERSION_PATCH) ? \ + STRINGIFY(CMake_VERSION_MAJOR) "." STRINGIFY(CMake_VERSION_MINOR) "." \ + STRINGIFY(CMake_VERSION_PATCH) "." STRINGIFY(CMake_VERSION_TWEAK) \ + : #maj "." #min "." #patch //---------------------------------------------------------------------------- cmExportInstallFileGenerator @@ -176,7 +188,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os) if (require3_0_0) { - this->GenerateRequiredCMakeVersion(os, "2.8.12.20131007"); + this->GenerateRequiredCMakeVersion(os, DEVEL_CMAKE_VERSION(3, 0, 0)); } else if (require2_8_12) { |