Fix T46623: OSX bpy.app.binary_path_python incorrect
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 Mar 2016 11:44:44 +0000 (22:44 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 Mar 2016 11:50:29 +0000 (22:50 +1100)
CMake's PYTHON_EXECUTABLE wasn't set.

CMakeLists.txt

index 12f58706103b1edb4afaab94acce86f1a6165441..b9b5cb0885444d084a87bf5dbe4555d75813ef11 100644 (file)
@@ -2004,14 +2004,14 @@ elseif(APPLE)
                if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
                        # normally cached but not since we include them with blender
                        set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
-                       # set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
+                       set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")
                        set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
                        set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
                        # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
                else()
                        # module must be compiled against Python framework
                        set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
-                       set(PYTHON_EXECUTABLE "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
+                       set(PYTHON_EXECUTABLE "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}m")
                        #set(PYTHON_LIBRARY python${PYTHON_VERSION})
                        set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
                        #set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
@@ -2020,6 +2020,10 @@ elseif(APPLE)
                # uncached vars
                set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
                set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
+
+               if(NOT EXISTS "${PYTHON_EXECUTABLE}")
+                       message(FATAL_ERROR "Python executable missing: ${PYTHON_EXECUTABLE}")
+               endif()
        endif()
 
        if(WITH_FFTW3)