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>
Fri, 4 Jan 2019 12:46:15 +0000 (13:46 +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 1217cb9b41719eb5f06fc5f5a1e4e0a7c53e6187..1152d0b8edec368db8ad4a37f8d8eaf62f1fc0e0 100644 (file)
@@ -74,9 +74,9 @@ function(gmx_manage_lmfit)
         set(HAVE_LMFIT 1 CACHE INTERNAL "Is lmfit found?")
     elseif(GMX_USE_LMFIT STREQUAL "EXTERNAL")
         # 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()
 
         set(HAVE_LMFIT 1 CACHE INTERNAL "Is lmfit found?")