ソースを参照

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 10 年 前
コミット
59dfc7f24b
共有1 個のファイルを変更した3 個の追加1 個の削除を含む
  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.")