gmxManageLmfit.cmake: enforce usage of 7.0
authorChristoph Junghans <junghans@lanl.gov>
Thu, 3 Jan 2019 10:39:04 +0000 (03:39 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 22 Jan 2019 08:09:33 +0000 (09:09 +0100)
LMFIT_FOUND will also be true for version lower than 7.0, so we
need to check the version explicitly in gmxManageLmfit.cmake.

Change-Id: Ia3ae12b3a74d2b567432f5ef18a77c13b19cdb85

cmake/gmxManageLmfit.cmake

index 182928f127ea047f689eb3713cf2dc37e0c53f24..6235ba4dec8695b174b11f0eb1394ed95c3e86f3 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2016, by the GROMACS development team, led by
+# Copyright (c) 2016,2019, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -41,9 +41,9 @@ mark_as_advanced(GMX_EXTERNAL_LMFIT)
 macro(manage_lmfit)
     if(GMX_EXTERNAL_LMFIT)
         # Find an external lmfit library.
-        find_package(Lmfit ${GMX_LMFIT_MINIMUM_REQUIRED_VERSION})
-        if(NOT LMFIT_FOUND)
-            message(FATAL_ERROR "External lmfit could not be found, please adjust your pkg-config path to include the lmfit.pc file")
+        find_package(Lmfit ${GMX_LMFIT_REQUIRED_VERSION})
+        if(NOT LMFIT_FOUND OR LMFIT_VERSION VERSION_LESS GMX_LMFIT_REQUIRED_VERSION)
+            message(FATAL_ERROR "External lmfit >= ${GMX_LMFIT_REQUIRED_VERSION} could not be found, please adjust your pkg-config path to include the lmfit.pc file")
         endif()
     endif()
 endmacro()