summaryrefslogtreecommitdiffstats
path: root/Source/cmExportInstallFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-10 16:50:54 (GMT)
committerBrad King <brad.king@kitware.com>2014-02-10 20:32:33 (GMT)
commit9bcc1b21f05a8f522c5154e163942c6d133bb379 (patch)
tree4c1f8e58882959ee91bf8c0ad93c58a54e5be9fb /Source/cmExportInstallFileGenerator.cxx
parentd2059d25114b53c1e7531704b3e955c6853a355e (diff)
downloadCMake-9bcc1b21f05a8f522c5154e163942c6d133bb379.zip
CMake-9bcc1b21f05a8f522c5154e163942c6d133bb379.tar.gz
CMake-9bcc1b21f05a8f522c5154e163942c6d133bb379.tar.bz2
Export: Fix internal CMake version test logic
Fix the internal DEVEL_CMAKE_VERSION macro to use CMake_VERSION_ENCODE to compare version component-wise. Otherwise an old invocation of the macro may be tricked into using the current version when the requested major version is smaller than the current version but the requested minor version is larger. It should use the requested (old) version in that case.
Diffstat (limited to 'Source/cmExportInstallFileGenerator.cxx')
-rw-r--r--Source/cmExportInstallFileGenerator.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index eb7cea9..56c0ec1 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -19,15 +19,17 @@
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmTargetExport.h"
-#include "cmVersionConfig.h"
+#include "cmVersionMacros.h"
+#include "cmVersion.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) ? \
+ (CMake_VERSION_ENCODE(maj, min, patch) > \
+ CMake_VERSION_ENCODE(CMake_VERSION_MAJOR, CMake_VERSION_MINOR, \
+ CMake_VERSION_PATCH) \
+ ) ? \
STRINGIFY(CMake_VERSION_MAJOR) "." STRINGIFY(CMake_VERSION_MINOR) "." \
STRINGIFY(CMake_VERSION_PATCH) "." STRINGIFY(CMake_VERSION_TWEAK) \
: #maj "." #min "." #patch