From d636a49a81be360fedec6530742faea6c04833fb Mon Sep 17 00:00:00 2001 From: inv Date: Tue, 29 Oct 2013 07:01:37 +0000 Subject: [PATCH] proper detection of PyQt4 with no env set --- adm_local/cmake_files/FindPyQt4.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/adm_local/cmake_files/FindPyQt4.cmake b/adm_local/cmake_files/FindPyQt4.cmake index a7f0349ac..f48e7258b 100644 --- a/adm_local/cmake_files/FindPyQt4.cmake +++ b/adm_local/cmake_files/FindPyQt4.cmake @@ -69,9 +69,16 @@ ENDIF() MARK_AS_ADVANCED(PYQT_SIP_MAIN_FILE) # Get PyQt compilation flags: -SET(PYQT_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") +SET(PYQT_PYTHONPATH "${_tmp_ROOT_DIR};${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") SET(PYQT_SIPFLAGS) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; + +IF(WIN32 AND NOT CYGWIN) + SET(_cmd set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYTHON_EXECUTABLE}) +ELSE() + SET(_cmd /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYTHON_EXECUTABLE}) +ENDIF() + +EXECUTE_PROCESS(COMMAND "${_cmd}" -c "import sys; sys.path[:0] = ['${PYQT_PYTHONPATH}'] sys.path[:0] = ['${SIP_PYTHONPATH}'] from PyQt4 import pyqtconfig; -- 2.39.2