summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2012-03-27 20:21:06 (GMT)
committerBen Boeckel <mathstuf@gmail.com>2012-03-27 20:21:06 (GMT)
commit6a46f5ce809185e0c7dbd3d618eb4bbde808827b (patch)
tree1ca472c78d545ec1f8d9413d8b3af51786e08d0e /Modules
parent58db6ac2991ee00536f7aded84811f1e3eead906 (diff)
downloadCMake-6a46f5ce809185e0c7dbd3d618eb4bbde808827b.zip
CMake-6a46f5ce809185e0c7dbd3d618eb4bbde808827b.tar.gz
CMake-6a46f5ce809185e0c7dbd3d618eb4bbde808827b.tar.bz2
Don't put legacy variables back into the cache
If PYTHON_INCLUDE_PATH is put into the cache, then it will always override whatever might be found and PYTHON_INCLUDE_DIR is never given a chance to find something different. It being marked as INTERNAL also means that it cannot be changed without editing CMakeCache.txt directly. Basically, the scenario is that if the Python version is changed, then deleting PYTHON_INCLUDE_DIR doesn't work because any cached PYTHON_INCLUDE_PATH variable is set before find_path is even called. Any build tree using a previous version will still need either manual removal of PYTHON_INCLUDE_PATH or a complete reconfigure, but in the future changing the Python version can be accomplished by deleting PYTHON_INCLUDE_DIR and reconfiguring with the new version.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindPythonLibs.cmake5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index fcd0838..e833150 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -123,9 +123,8 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
python${_CURRENT_VERSION}
)
- # For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal.
- SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
- "Path to where Python.h is found (deprecated)")
+ # For backward compatibility, set PYTHON_INCLUDE_PATH.
+ SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
IF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str