Skip to content
Permalink
Browse files

make honoring -DPYTHON_LIBRARY more solid.

as cmake --help-module FindPythonLibs states
If you'd like to specify the installation of Python to use, you should modify the following cache variables:

         PYTHON_LIBRARY             - path to the python library
         PYTHON_INCLUDE_PATH         - path to where Python.h is found

(please note it is PYTHON_INCLUDE_PATH  (deprecated) and not PYTHON_INCLUDE_DIR (new in 2.8) since we require cmake >= 2.6.2)
  • Loading branch information
mbernasocchi committed Sep 10, 2013
1 parent e703bdf commit b61b5b0f8345d04b60e4c107aa4019f74faa4bed
Showing with 4 additions and 3 deletions.
  1. +4 −3 cmake/FindPythonLibrary.cmake
@@ -26,10 +26,10 @@

INCLUDE(CMakeFindFrameworks)

if(EXISTS PYTHON_LIBRARY)
if(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}")
# Already in cache, be silent
set(PYTHONLIBRARY_FOUND TRUE)
else(EXISTS PYTHON_LIBRARY)
else(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}")

set(_custom_python_fw FALSE)
if(APPLE AND PYTHON_CUSTOM_FRAMEWORK)
@@ -69,6 +69,7 @@ else(EXISTS PYTHON_LIBRARY)
STRING(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR})
endif(WIN32)
FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH)
set(PYTHON_INCLUDE_PATH ${PYTHON_INCLUDE_PATH} CACHE FILEPATH "Directory holding the python.h include file" FORCE)
set(PYTHONLIBRARY_FOUND TRUE)
endif(python_config)

@@ -109,4 +110,4 @@ else(EXISTS PYTHON_LIBRARY)
endif(PYTHONLIBRARY_FIND_REQUIRED)
endif(PYTHONLIBRARY_FOUND)

endif (EXISTS PYTHON_LIBRARY)
endif (EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}")

0 comments on commit b61b5b0

Please sign in to comment.
You can’t perform that action at this time.