[Bf-blender-cvs] [34ee9ab97c0] blender2.8: CMake: remove PYTHON_NUMPY_INCLUDE_DIRS as a cache variable on macOS/Windows.

Brecht Van Lommel noreply at git.blender.org
Tue Sep 18 12:11:36 CEST 2018


Commit: 34ee9ab97c0cf629987f8f3f72b529ca7e73e027
Author: Brecht Van Lommel
Date:   Mon Sep 17 11:10:45 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB34ee9ab97c0cf629987f8f3f72b529ca7e73e027

CMake: remove PYTHON_NUMPY_INCLUDE_DIRS as a cache variable on macOS/Windows.

It's in a fixed location on those platforms, and having it as a cache variable
just means things break when we upgrade to a new Python version.

===================================================================

M	CMakeLists.txt
M	build_files/cmake/platform/platform_apple.cmake

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa1405994c3..389287c04a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -379,7 +379,9 @@ if(UNIX AND NOT APPLE)
 endif()
 
 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
-if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
+if(WIN32 OR APPLE)
+	# Windows and macOS have this bundled with Python libraries.
+elseif(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
 	set(PYTHON_NUMPY_PATH            "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
 	mark_as_advanced(PYTHON_NUMPY_PATH)
 	set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
@@ -1477,14 +1479,14 @@ if(WITH_PYTHON)
 		)
 	endif()
 
-	if(WIN32)
-		# pass, we have this in an archive to extract
+	if(WIN32 OR APPLE)
+		# Windows and macOS have this bundled with Python libraries.
 	elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
 		if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
 			find_python_package(numpy)
 			unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
 			set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
-		        mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
+			mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
 		endif()
 	endif()
 
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 8562b8536a2..88ae9d4a6ef 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -114,7 +114,7 @@ if(WITH_PYTHON)
 	set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
 
 	# needed for Audaspace, numpy is installed into python site-packages
-	set(NUMPY_INCLUDE_DIRS "${PYTHON_LIBPATH}/site-packages/numpy/core/include")
+	set(PYTHON_NUMPY_INCLUDE_DIRS "${PYTHON_LIBPATH}/site-packages/numpy/core/include")
 
 	if(NOT EXISTS "${PYTHON_EXECUTABLE}")
 		message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")



More information about the Bf-blender-cvs mailing list