aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken/CMakeLists.txt
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-06-21 11:15:30 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-06-21 11:37:23 -0300
commit2f7c24248b6f8b398b6211f3bf6e09767ea913d8 (patch)
tree47a5921e41a28a8a60ef32c620780c16247f5e88 /libshiboken/CMakeLists.txt
parent102a3c3ae6b55f69a00a08c8a3847b114edf2322 (diff)
Fix bug: "Debug build fails to run the tests (doesn't work) [_Py_AddToAllObjects: Assertion (...) failed]"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libshiboken/CMakeLists.txt')
-rw-r--r--libshiboken/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/libshiboken/CMakeLists.txt b/libshiboken/CMakeLists.txt
index 485583e4b..73d31afd8 100644
--- a/libshiboken/CMakeLists.txt
+++ b/libshiboken/CMakeLists.txt
@@ -1,6 +1,7 @@
project(libshiboken)
find_package(PythonLibs REQUIRED)
+find_package(PythonInterp REQUIRED)
#Find installed sparsehash
find_path(SPARSEHASH_INCLUDE_PATH sparseconfig.h PATH_SUFFIXES "/google/sparsehash")
@@ -23,6 +24,16 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenVersion.cmake.in"
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shiboken.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/shiboken.pc" @ONLY)
+# Detect if the python libs were compiled in debug mode
+execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\
+ print sysconfig.get_config_var('Py_DEBUG')"
+ OUTPUT_VARIABLE PY_DEBUG
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+if (PY_DEBUG)
+ add_definitions("-DPy_DEBUG")
+endif()
+
set(libshiboken_SRC
basewrapper.cpp
helper.cpp