From 3ad9f59ddfe3fe12c0aaf9ee8992e6a691500315 Mon Sep 17 00:00:00 2001 From: "C. Weaver" Date: Thu, 17 Aug 2023 19:24:32 -0400 Subject: [PATCH] Force caching of Python_NumPy_FOUND to fix repeated application of cmake --- cmake/Spt3gBoostPython.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/Spt3gBoostPython.cmake b/cmake/Spt3gBoostPython.cmake index 8cc1bcd9..34698316 100644 --- a/cmake/Spt3gBoostPython.cmake +++ b/cmake/Spt3gBoostPython.cmake @@ -1,4 +1,5 @@ # Locate Python + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12) find_package(Python COMPONENTS Interpreter Development) else() @@ -15,9 +16,9 @@ endif() execute_process(COMMAND ${Python_EXECUTABLE} -c "import numpy" RESULT_VARIABLE NUMPY_FOUND ERROR_QUIET) if(NUMPY_FOUND EQUAL 0) - set(Python_NumPy_FOUND TRUE CACHE BOOL "Numpy found successfully") + set(Python_NumPy_FOUND TRUE CACHE BOOL "Numpy found successfully" FORCE) else(NUMPY_FOUND EQUAL 0) - set(Python_NumPy_FOUND FALSE CACHE BOOL "Numpy found successfully") + set(Python_NumPy_FOUND FALSE CACHE BOOL "Numpy found successfully" FORCE) endif(NUMPY_FOUND EQUAL 0) if(Python_NumPy_FOUND)