From 7f5723eac1366e901391fb5771f4a70a45dc6932 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Mon, 20 Sep 2010 17:26:09 -0300 Subject: Shiboken generator code moved to the directory generator. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer: Renato Araújo Luciano Wolf --- tests/CMakeLists.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/CMakeLists.txt') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dc5e52d4e..48d9de484 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,28 @@ add_subdirectory(libsample) add_subdirectory(libother) + +# 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(CMAKE_BUILD_TYPE STREQUAL "Debug") + if(NOT PYTHON_DEBUG_LIBRARIES) + message(FATAL_ERROR "Python debug library not found. Try compile shiboken with -DCMAKE_BUILD_TYPE=Release") + endif() + if(NOT PY_DEBUG) + message(WARNING "Compiling shiboken with debug enabled, but the python executable was not compiled with debug support.") + else() + add_definitions("-DPy_DEBUG") + endif() + set(SBK_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES}) +else() + set(SBK_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) + add_definitions("-DNDEBUG") +endif() + add_subdirectory(samplebinding) add_subdirectory(otherbinding) -- cgit v1.2.3