Explorar o código

Merge branch 'fix-pythonqt-install-dir-var-reset'

* fix-pythonqt-install-dir-var-reset:
  Ensure PYTHONQT_INSTALL_DIR is not reset in project including CTK
Jean-Christophe Fillion-Robin %!s(int64=10) %!d(string=hai) anos
pai
achega
59dfc7f24b
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      Utilities/CMake/FindPythonQt.cmake

+ 3 - 1
Utilities/CMake/FindPythonQt.cmake

@@ -9,7 +9,9 @@ if(NOT PYTHONLIBS_FOUND)
   message(FATAL_ERROR "error: Python is required to build PythonQt")
 endif()
 
-find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.")
+if(NOT EXISTS "${PYTHONQT_INSTALL_DIR}")
+  find_path(PYTHONQT_INSTALL_DIR include/PythonQt/PythonQt.h DOC "Directory where PythonQt was installed.")
+endif()
 find_path(PYTHONQT_INCLUDE_DIR PythonQt.h "${PYTHONQT_INSTALL_DIR}/include/PythonQt" DOC "Path to the PythonQt include directory")
 find_library(PYTHONQT_LIBRARY_RELEASE PythonQt PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.")
 find_library(PYTHONQT_LIBRARY_DEBUG NAMES PythonQt${CTK_CMAKE_DEBUG_POSTFIX} PythonQt${CMAKE_DEBUG_POSTFIX} PythonQt PATHS "${PYTHONQT_INSTALL_DIR}/lib" DOC "The PythonQt library.")