From 77805079f4bd50b7276480f14f000ae3f23309a8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 20 Jul 2012 00:16:55 -0400 Subject: [PATCH] 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 --- Utilities/CMake/FindPythonQt.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Utilities/CMake/FindPythonQt.cmake b/Utilities/CMake/FindPythonQt.cmake index 82c38ecf81..8abc05b419 100644 --- a/Utilities/CMake/FindPythonQt.cmake +++ b/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()