From 386bc72e6743e7cbbbf0a22f587458e6b18edb6c Mon Sep 17 00:00:00 2001 From: olav-st Date: Thu, 8 Jun 2017 22:54:05 +0200 Subject: [PATCH] apply (modified) patch from issue #281 to fix pythonqt detection --- cmake/modules/FindPythonQt.cmake | 4 +++- cmake/modules/FindPythonQt_QtAll.cmake | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindPythonQt.cmake b/cmake/modules/FindPythonQt.cmake index 7165894..1ecd154 100644 --- a/cmake/modules/FindPythonQt.cmake +++ b/cmake/modules/FindPythonQt.cmake @@ -5,7 +5,9 @@ find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.") find_path(PYTHONQT_INCLUDE_DIR PythonQt.h "${PYTHONQT_INSTALL_DIR}/include/PythonQt" DOC "Path to the PythonQt include directory") -find_library(PYTHONQT_LIBRARY NAMES PythonQt QtPython PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.") +file(GLOB PYTHONQT_LIB_FILE LIST_DIRECTORIES false RELATIVE "${PYTHONQT_INSTALL_DIR}/lib" "${PYTHONQT_INSTALL_DIR}/lib/*PythonQt-Qt[4-9]*.so") +string(REGEX REPLACE "^lib(.+)\\.so$" "\\1" PYTHONQT_LIB "${PYTHONQT_LIB_FILE}") +find_library(PYTHONQT_LIBRARY NAMES PythonQt QtPython "${PYTHONQT_LIB}" PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.") mark_as_advanced(PYTHONQT_INSTALL_DIR) mark_as_advanced(PYTHONQT_INCLUDE_DIR) diff --git a/cmake/modules/FindPythonQt_QtAll.cmake b/cmake/modules/FindPythonQt_QtAll.cmake index f8c21c5..3c9ddc8 100644 --- a/cmake/modules/FindPythonQt_QtAll.cmake +++ b/cmake/modules/FindPythonQt_QtAll.cmake @@ -6,7 +6,10 @@ find_path(PYTHONQT_QTALL_INSTALL_DIR NAMES include/PythonQt/PythonQt_QtAll.h include/PythonQt/extensions/PythonQt_QtAll/PythonQt_QtAll.h DOC "Directory where PythonQt_QtAll.h was installed.") find_path(PYTHONQT_QTALL_INCLUDE_DIR PythonQt_QtAll.h PATHS "${PYTHONQT_QTALL_INSTALL_DIR}/include/PythonQt" "${PYTHONQT_QTALL_INSTALL_DIR}/include/PythonQt/extensions/PythonQt_QtAll" ${CMAKE_INCLUDE_PATH} ${CMAKE_INSTALL_PREFIX}/include ${CMAKE_INSTALL_PREFIX}/include/PythonQt ${CMAKE_INSTALL_PREFIX}/include/PythonQt/extensions/PythonQt_QtAll DOC "Path to the PythonQt_QtAll include directory") -find_library(PYTHONQT_QTALL_LIBRARY NAMES PythonQt_QtAll QtPython_QtAll PATHS "${PYTHONQT_QTALL_INSTALL_DIR}/extensions/PythonQt_QtAll" DOC "The PythonQt_QtAll library.") +file(GLOB PYTHONQT_QTALL_LIB_FILE LIST_DIRECTORIES false RELATIVE "${PYTHONQT_INSTALL_DIR}/lib" "${PYTHONQT_INSTALL_DIR}/lib/*PythonQt_QtAll-Qt[4-9]*.so") +string(REGEX REPLACE "^lib(.+)\\.so$" "\\1" PYTHONQT_QTALL_LIB "${PYTHONQT_QTALL_LIB_FILE}") + +find_library(PYTHONQT_QTALL_LIBRARY NAMES PythonQt_QtAll QtPython_QtAll "${PYTHONQT_QTALL_LIB}" PATHS "${PYTHONQT_QTALL_INSTALL_DIR}/extensions/PythonQt_QtAll" DOC "The PythonQt_QtAll library.") mark_as_advanced(PYTHONQT_QTALL_INSTALL_DIR) mark_as_advanced(PYTHONQT_QTALL_INCLUDE_DIR)