From 01d81c7fa5e43210a40c61ce39287c7be245f7c4 Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Tue, 12 Oct 2021 16:25:20 +0200 Subject: cmake: use LooseVersion to ensure correct version comparisons current implementation uses version strings for comparisons. This led version 3.10 to be smaller than 3.6 which is obviously wrong. Use LooseVersion to have correct version comparison. --- host/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/CMakeLists.txt') diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index b741881d0..fcf9feed3 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -311,19 +311,19 @@ include(UHDPython) PYTHON_CHECK_MODULE( "Python version ${PYTHON_MIN_VERSION} or greater" - "platform" "platform.python_version() >= '${PYTHON_MIN_VERSION}'" + "platform" "LooseVersion(platform.python_version()) >= LooseVersion('${PYTHON_MIN_VERSION}')" HAVE_PYTHON_PLAT_MIN_VERSION ) PYTHON_CHECK_MODULE( "Mako templates ${PY_MAKO_MIN_VERSION} or greater" - "mako" "mako.__version__ >= '${PY_MAKO_MIN_VERSION}'" + "mako" "LooseVersion(mako.__version__) >= LooseVersion('${PY_MAKO_MIN_VERSION}')" HAVE_PYTHON_MODULE_MAKO ) PYTHON_CHECK_MODULE( "requests ${PY_REQUESTS_MIN_VERSION} or greater" - "requests" "requests.__version__ >= '${PY_REQUESTS_MIN_VERSION}'" + "requests" "LooseVersion(requests.__version__) >= LooseVersion('${PY_REQUESTS_MIN_VERSION}')" HAVE_PYTHON_MODULE_REQUESTS ) -- cgit v1.2.3