From 326e756f2ff38c46f9fb7fcd73f178bc6e2afbd6 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 17 Jul 2013 10:37:58 +0000 Subject: NO-JIRA: Enhance proton version compatibility check to restrict latest as well as earliest compatible version git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1504071 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/amqp.cmake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'qpid/cpp') diff --git a/qpid/cpp/src/amqp.cmake b/qpid/cpp/src/amqp.cmake index 45b0c51527..30cb8484ed 100644 --- a/qpid/cpp/src/amqp.cmake +++ b/qpid/cpp/src/amqp.cmake @@ -24,14 +24,19 @@ include(FindPkgConfig) pkg_check_modules(PROTON libqpid-proton) set (amqp_default ${amqp_force}) -set (required_version 0.3) +set (minimum_version 0.3) +set (maximum_version 0.4) if (PROTON_FOUND) - if (PROTON_VERSION LESS ${required_version}) - message(STATUS "Qpid proton is too old, amqp 1.0 support not enabled") - else (PROTON_VERSION LESS ${required_version}) - message(STATUS "Qpid proton found, amqp 1.0 support enabled") - set (amqp_default ON) - endif (PROTON_VERSION LESS ${required_version}) + if (PROTON_VERSION LESS ${minimum_version}) + message(STATUS "Qpid proton ${PROTON_VERSION} is too old, require ${minimum_version} - ${maximum_version}; amqp 1.0 support not enabled") + else (PROTON_VERSION LESS ${minimum_version}) + if (PROTON_VERSION GREATER ${maximum_version}) + message(STATUS "Qpid proton ${PROTON_VERSION} is too new, require ${minimum_version} - ${maximum_version}; amqp 1.0 support not enabled") + else (PROTON_VERSION GREATER ${maximum_version}) + message(STATUS "Qpid proton found, amqp 1.0 support enabled") + set (amqp_default ON) + endif (PROTON_VERSION GREATER ${maximum_version}) + endif (PROTON_VERSION LESS ${minimum_version}) else (PROTON_FOUND) message(STATUS "Qpid proton not found, amqp 1.0 support not enabled") endif (PROTON_FOUND) -- cgit v1.2.1