aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-07-19 15:19:45 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-07-23 11:10:28 -0300
commit8bde4b3800ca1c5c517fe382f6fdf78c212b9ad0 (patch)
treea987682b4e3b7bed92815801a8c848498e646ae1 /CMakeLists.txt
parentf7afa613cf4b4a7a587d29855465e1db577fcd06 (diff)
Use correct python lib in debug mode.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 17 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d601f840b..e79745715 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,11 @@ find_package(PythonInterpWithDebug REQUIRED)
find_package(Shiboken 0.3.3 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
+#Fix missing variable on UNIX env
+if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
+ set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}")
+endif()
+
set(BINDING_NAME PySide)
set(BINDING_API_MAJOR_VERSION "0")
set(BINDING_API_MINOR_VERSION "3")
@@ -135,10 +140,21 @@ execute_process(
print sysconfig.get_config_var('Py_DEBUG')"
OUTPUT_VARIABLE PY_DEBUG
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if (PY_DEBUG)
+
+if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ if(NOT PYTHON_DEBUG_LIBRARIES)
+ message(FATAL_ERROR "Python debug library not found. Try compile PySide with -DCMAKE_BUILD_TYPE=Release")
+ endif()
+ if(NOT PY_DEBUG)
+ message(WARNING "Compiling PySide with debug enabled, but the python executable was not compiled with debug support.")
+ endif()
add_definitions("-DPy_DEBUG")
+ set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
+else()
+ set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES})
endif()
+
set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic)
enable_testing()