From 9bcc1b21f05a8f522c5154e163942c6d133bb379 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Mon, 10 Feb 2014 11:50:54 -0500
Subject: 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.
---
 Source/cmExportInstallFileGenerator.cxx | 10 ++++++----
 1 file 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
-- 
cgit v0.12