Set HAVE_LMFIT properly
authorMagnus Lundborg <lundborg.magnus@gmail.com>
Tue, 11 Dec 2018 16:16:09 +0000 (17:16 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 14 Dec 2018 13:23:43 +0000 (14:23 +0100)
The HAVE_LMFIT was only set in the local scope.
Fixes #2800

Change-Id: I34bd3dc1896526c09c6808c7020d3a492c4c8f31

cmake/gmxManageLmfit.cmake

index 1575f89fb4c8b0e6e722456583b379b46857ce1b..1217cb9b41719eb5f06fc5f5a1e4e0a7c53e6187 100644 (file)
@@ -71,7 +71,7 @@ function(gmx_manage_lmfit)
         # we will not be installing any content.
         install(TARGETS lmfit EXPORT libgromacs)
 
-        set(HAVE_LMFIT_VALUE TRUE)
+        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})
@@ -79,7 +79,7 @@ function(gmx_manage_lmfit)
             message(FATAL_ERROR "External lmfit could not be found, please adjust your pkg-config path to include the lmfit.pc file")
         endif()
 
-        set(HAVE_LMFIT_VALUE TRUE)
+        set(HAVE_LMFIT 1 CACHE INTERNAL "Is lmfit found?")
     else()
         # Create a dummy link target so the calling code doesn't need to know
         # whether lmfit support is being compiled.
@@ -88,6 +88,6 @@ function(gmx_manage_lmfit)
         # we will not be installing any content.
         install(TARGETS lmfit EXPORT libgromacs)
 
-        set(HAVE_LMFIT_VALUE FALSE)
+        set(HAVE_LMFIT 0 CACHE INTERNAL "Is lmfit found?")
     endif()
 endfunction()