aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-10-25 16:58:03 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-10-26 13:49:07 -0300
commit720c76980dedd51abee7f182bd261a9ce5405a5e (patch)
treee8d0d0112a08dc4302852d7890a091854b709676
parentb7f36fec396631cf61ecc801e55df73a2ef55857 (diff)
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.
-rw-r--r--CMakeLists.txt25
-rw-r--r--cmake/Modules/FindPythonInterpWithDebug.cmake21
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/pysidetest/CMakeLists.txt1
4 files changed, 5 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58f7a523b..e148c2a66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,11 +3,8 @@ include(cmake/Macros/icecc.cmake) # this must be the first line!
project(pysidebindings)
cmake_minimum_required(VERSION 2.6)
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
- ${CMAKE_SOURCE_DIR}/cmake/Macros/
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Macros/
${CMAKE_MODULE_PATH})
-find_package(PythonLibs REQUIRED)
-find_package(PythonInterpWithDebug REQUIRED)
find_package(GeneratorRunner 0.6 REQUIRED)
find_package(Shiboken 0.5 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
@@ -143,7 +140,7 @@ add_custom_target(dist
if (NOT SITE_PACKAGE)
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}')"
OUTPUT_VARIABLE SITE_PACKAGE
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -154,22 +151,8 @@ if (NOT SITE_PACKAGE)
endif()
endif()
-# 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 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()
+if(SHIBOKEN_BUILD_TYPE STREQUAL "Debug")
+ add_definitions("-DPy_DEBUG")
set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
else()
set(PYSIDE_PYTHON_LIBRARIES ${PYTHON_LIBRARIES})
diff --git a/cmake/Modules/FindPythonInterpWithDebug.cmake b/cmake/Modules/FindPythonInterpWithDebug.cmake
deleted file mode 100644
index 264dd5d81..000000000
--- a/cmake/Modules/FindPythonInterpWithDebug.cmake
+++ /dev/null
@@ -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()
-
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 83a5d212b..f4c73b476 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -37,7 +37,7 @@ else()
else()
message(WARNING "Invalid call of macro PYSIDE_TEST")
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})
set_tests_properties(${TEST_NAME} PROPERTIES
TIMEOUT ${CTEST_TESTING_TIMEOUT}
diff --git a/tests/pysidetest/CMakeLists.txt b/tests/pysidetest/CMakeLists.txt
index 887a2d57f..875ff0c3f 100644
--- a/tests/pysidetest/CMakeLists.txt
+++ b/tests/pysidetest/CMakeLists.txt
@@ -4,7 +4,6 @@ project(testbinding)
cmake_minimum_required(VERSION 2.6)
find_package(Qt4 4.5.0 REQUIRED)
find_package(PythonLibs REQUIRED)
-find_package(PythonInterpWithDebug REQUIRED)
find_package(GeneratorRunner 0.6 REQUIRED)
find_package(Shiboken 0.5 REQUIRED)