Modified cmake files to make use of debug information provided by Shiboken.

In summation, PySide is compiled for debug if the libshiboken is
compiled for debug.
This commit is contained in:
Marcelo Lira 2010-10-25 16:58:03 -03:00
commit 720c76980d
4 changed files with 5 additions and 44 deletions

View file

@ -3,11 +3,8 @@ include(cmake/Macros/icecc.cmake) # this must be the first line!
project(pysidebindings) project(pysidebindings)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/
${CMAKE_SOURCE_DIR}/cmake/Macros/
${CMAKE_MODULE_PATH}) ${CMAKE_MODULE_PATH})
find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
find_package(GeneratorRunner 0.6 REQUIRED) find_package(GeneratorRunner 0.6 REQUIRED)
find_package(Shiboken 0.5 REQUIRED) find_package(Shiboken 0.5 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED) find_package(Qt4 4.5.0 REQUIRED)
@ -143,7 +140,7 @@ add_custom_target(dist
if (NOT SITE_PACKAGE) if (NOT SITE_PACKAGE)
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; \\ COMMAND ${SHIBOKEN_PYTHON_INTERPRETER} -c "from distutils import sysconfig; \\
print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}')" print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_PREFIX}')"
OUTPUT_VARIABLE SITE_PACKAGE OUTPUT_VARIABLE SITE_PACKAGE
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
@ -154,22 +151,8 @@ if (NOT SITE_PACKAGE)
endif() endif()
endif() endif()
# Detect if the python libs were compiled in debug mode if(SHIBOKEN_BUILD_TYPE STREQUAL "Debug")
execute_process( add_definitions("-DPy_DEBUG")
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 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.")
else()
add_definitions("-DPy_DEBUG")
endif()
set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES}) set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
else() else()
set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES})

View file

@ -1,21 +0,0 @@
INCLUDE(FindPythonInterp)
find_package(PythonInterp REQUIRED)
#Fix missing variable on UNIX env
if(NOT PYTHON_DEBUG_LIBRARIES AND UNIX)
set(PYTHON_DEBUG_LIBRARIES "${PYTHON_LIBRARIES}")
endif()
if(PYTHONINTERP_FOUND AND UNIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
# This is for Debian
set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}-dbg")
# Fall back to the standard interpreter.
if(NOT EXISTS "${PYTHON_EXECUTABLE_TMP}")
set(PYTHON_EXECUTABLE_TMP "${PYTHON_EXECUTABLE}")
endif()
set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_TMP}")
endif()

View file

@ -37,7 +37,7 @@ else()
else() else()
message(WARNING "Invalid call of macro PYSIDE_TEST") message(WARNING "Invalid call of macro PYSIDE_TEST")
endif() endif()
set(TEST_CMD ${XVFB_EXEC} ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}") set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
add_test(${TEST_NAME} ${TEST_CMD}) add_test(${TEST_NAME} ${TEST_CMD})
set_tests_properties(${TEST_NAME} PROPERTIES set_tests_properties(${TEST_NAME} PROPERTIES
TIMEOUT ${CTEST_TESTING_TIMEOUT} TIMEOUT ${CTEST_TESTING_TIMEOUT}

View file

@ -4,7 +4,6 @@ project(testbinding)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
find_package(Qt4 4.5.0 REQUIRED) find_package(Qt4 4.5.0 REQUIRED)
find_package(PythonLibs REQUIRED) find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
find_package(GeneratorRunner 0.6 REQUIRED) find_package(GeneratorRunner 0.6 REQUIRED)
find_package(Shiboken 0.5 REQUIRED) find_package(Shiboken 0.5 REQUIRED)