aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2021-10-12 16:25:20 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2021-10-14 11:03:10 -0700
commit01d81c7fa5e43210a40c61ce39287c7be245f7c4 (patch)
treec7b2cf6bcba50161ab8d549f7f005c78271db43c /host
parent393ab38853a9db513d54b03c3821712295b58846 (diff)
downloaduhd-01d81c7fa5e43210a40c61ce39287c7be245f7c4.tar.gz
uhd-01d81c7fa5e43210a40c61ce39287c7be245f7c4.tar.bz2
uhd-01d81c7fa5e43210a40c61ce39287c7be245f7c4.zip
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.
Diffstat (limited to 'host')
-rw-r--r--host/CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
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
)