CMake: Search for PythonQt headers in more places.

Suggested by Denis Proskurin.
This commit is contained in:
Adriaan de Groot 2018-09-03 05:34:23 -04:00
parent aee5676ae8
commit 9651c588bc

View File

@ -24,17 +24,24 @@ string(REGEX REPLACE
) )
if(NOT EXISTS "${PYTHONQT_INSTALL_DIR}") if(NOT EXISTS "${PYTHONQT_INSTALL_DIR}")
find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.") find_path(PYTHONQT_INSTALL_DIR
NAMES
include/PythonQt/PythonQt.h
include/PythonQt5/PythonQt.h
DOC "Directory where PythonQt was installed.")
endif() endif()
# XXX Since PythonQt 3.0 is not yet cmakeified, depending # XXX Since PythonQt 3.0 is not yet cmakeified, depending
# on how PythonQt is built, headers will not always be # on how PythonQt is built, headers will not always be
# installed in "include/PythonQt". That is why "src" # installed in "include/PythonQt". That is why "src"
# is added as an option. See [1] for more details. # is added as an option. See [1] for more details.
# [1] https://github.com/commontk/CTK/pull/538#issuecomment-86106367 # [1] https://github.com/commontk/CTK/pull/538#issuecomment-86106367
find_path(PYTHONQT_INCLUDE_DIR PythonQt.h find_path(PYTHONQT_INCLUDE_DIR PythonQt.h
PATHS "${PYTHONQT_INSTALL_DIR}/include/PythonQt" PATHS
"${PYTHONQT_INSTALL_DIR}/include/PythonQt"
"${PYTHONQT_INSTALL_DIR}/include/PythonQt5"
"${PYTHONQT_INSTALL_DIR}/src" "${PYTHONQT_INSTALL_DIR}/src"
DOC "Path to the PythonQt include directory") DOC "Path to the PythonQt include directory")
if ( NOT PythonQt_FIND_QUIETLY ) if ( NOT PythonQt_FIND_QUIETLY )
message( STATUS "Searching for PythonQt (PythonLibs ${PYTHONLIBS_MAJMIN}) .." ) message( STATUS "Searching for PythonQt (PythonLibs ${PYTHONLIBS_MAJMIN}) .." )