Forráskód Böngészése

Library depending on debug build of PythonQt will link against correct python library

Since CTK now depends on the 'patched-2' branch of PythonQt, this is
required to ensure the _DEBUG macro will be undefined
within PythonQtPythonInclude.h. By undefining _DEBUG, both PythonQt or any
library linking against it can successfully link against release
python library.

See https://github.com/commontk/PythonQt/blob/6366f002a93aa238c55f58de949d09c552cda5a9/src/PythonQtPythonInclude.h#L62

This will fix error like the following:

19>3>5>Generating moc_ctkVTKConnection.cxx
19>3>4>LINK : fatal error LNK1104: cannot open file 'python26_d.lib'

See issue #203
Jean-Christophe Fillion-Robin 12 éve
szülő
commit
77805079f4
1 módosított fájl, 3 hozzáadás és 0 törlés
  1. 3 0
      Utilities/CMake/FindPythonQt.cmake

+ 3 - 0
Utilities/CMake/FindPythonQt.cmake

@@ -25,6 +25,9 @@ endif()
 
 set(PYTHONQT_FOUND 0)
 if(PYTHONQT_INCLUDE_DIR AND PYTHONQT_LIBRARY)
+  # Currently CMake'ified PythonQt only supports building against a python Release build. 
+  # This applies independently of CTK build type (Release, Debug, ...)
+  add_definitions(-DPYTHONQT_USE_RELEASE_PYTHON_FALLBACK)
   set(PYTHONQT_FOUND 1)
   set(PYTHONQT_LIBRARIES ${PYTHONQT_LIBRARY} ${PYTHONQT_LIBUTIL})
 endif()