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.
This commit is contained in:
Marcus Hanwell 2009-12-14 14:15:31 -05:00
parent 555fcbd2e2
commit e4ebb49717
1 changed files with 8 additions and 0 deletions

View File

@ -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.