summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Hanwell <marcus.hanwell@kitware.com>2009-12-14 19:15:31 (GMT)
committerMarcus Hanwell <marcus.hanwell@kitware.com>2009-12-14 19:15:31 (GMT)
commite4ebb49717cf8dca50807d7aee6cb0eba5b4d936 (patch)
treeac29090758e80877380848df3305d8fd2248ec7d
parent555fcbd2e2e5cafbb7cbf55b88093cc8f73a8009 (diff)
downloadCMake-e4ebb49717cf8dca50807d7aee6cb0eba5b4d936.zip
CMake-e4ebb49717cf8dca50807d7aee6cb0eba5b4d936.tar.gz
CMake-e4ebb49717cf8dca50807d7aee6cb0eba5b4d936.tar.bz2
Added a second call to find_library to find the static library.
When there is no shared object to link to a second call to find library is necessary to find the static Python library. Fixes an issue raised on the CMake mailing list, and it should be included in the next CMake patch release.
-rw-r--r--Modules/FindPythonLibs.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 81d1179..5c99e3f 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -44,6 +44,14 @@ FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
# Avoid finding the .dll in the PATH. We want the .lib.
NO_SYSTEM_ENVIRONMENT_PATH
)
+ # Look for the static library in the Python config directory
+ FIND_LIBRARY(PYTHON_LIBRARY
+ NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+ # Avoid finding the .dll in the PATH. We want the .lib.
+ NO_SYSTEM_ENVIRONMENT_PATH
+ # This is where the static library is usually located
+ PATH_SUFFIXES python${_CURRENT_VERSION}/config
+ )
# For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if
# PYTHON_INCLUDE_DIR is not set.