Permalink
Browse files

Append "lib-tk" to PYTHONPATH if Tkinter extension is enabled

This will fix tcl tests on Linux. On MacOSX, the module Tkinter can
now be imported by there are still issue to import "_ctypes" module.
  • Loading branch information...
1 parent 8a3c51a commit 70137a20d007c7a44c6374a1f5aa2f78bc99fd65 @jcfr jcfr committed Apr 16, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 cmake/libpython/CMakeLists.txt
@@ -142,14 +142,18 @@ if(UNIX)
PROPERTY COMPILE_FLAGS
-Wno-deprecated-declarations
)
+ set(PYTHONPATH "${EXTRA_PYTHONPATH}:lib-dynload:plat-${PY_PLATFORM}")
+ if(ENABLE_TKINTER)
+ set(PYTHONPATH "${PYTHONPATH}:lib-tk")
+ endif(ENABLE_TKINTER)
set_property(
SOURCE ${SRC_DIR}/Modules/getpath.c
PROPERTY COMPILE_DEFINITIONS
PREFIX="${CMAKE_INSTALL_PREFIX}"
EXEC_PREFIX="${CMAKE_INSTALL_PREFIX}"
VERSION="${PY_VERSION_MAJOR}.${PY_VERSION_MINOR}"
VPATH="."
- PYTHONPATH="${EXTRA_PYTHONPATH}:lib-dynload:plat-${PY_PLATFORM}"
+ PYTHONPATH="${PYTHONPATH}"
)
elseif(WIN32)
# HACK To workaround limitation in escaping logic of CMake, the pythonpath
@@ -173,6 +177,9 @@ elseif(WIN32)
set(PYTHONPATH "${PYTHONPATH}${PATHSEP}.\\\\${EXTENSION_INSTALL_DIR_ESCAPED}")
set(PYTHONPATH "${PYTHONPATH}${PATHSEP}.\\\\${EXTENSION_INSTALL_DIR_ESCAPED}\\\\${CMAKE_CFG_INTDIR}")
set(PYTHONPATH "${PYTHONPATH}${PATHSEP}.\\\\${PYTHONHOME_ESCAPED}\\\\plat-${PY_PLATFORM}")
+ if(ENABLE_TKINTER)
+ set(PYTHONPATH "${PYTHONPATH}${PATHSEP}.\\\\${PYTHONHOME_ESCAPED}\\\\lib-tk")
+ endif(ENABLE_TKINTER)
set_property(
SOURCE ${SRC_DIR}/PC/getpathp.c
PROPERTY COMPILE_DEFINITIONS

0 comments on commit 70137a2

Please sign in to comment.