Skip to content

Commit

Permalink
Force caching of Python_NumPy_FOUND to fix repeated application of cm…
Browse files Browse the repository at this point in the history
…ake (#115)

Co-authored-by: C. Weaver <[email protected]>
  • Loading branch information
cnweaver and C. Weaver authored Sep 8, 2023
1 parent 0c5986b commit 1b06721
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmake/Spt3gBoostPython.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Locate Python

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12)
find_package(Python COMPONENTS Interpreter Development)
else()
Expand All @@ -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)
Expand Down

0 comments on commit 1b06721

Please sign in to comment.