aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgetbinding/CMakeLists.txt
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2022-08-05 17:41:14 +0200
committerAdrian Herrmann <adrian.herrmann@qt.io>2022-08-09 13:02:33 +0200
commitf9f620436058efe93d086c5214955c4d56e70e26 (patch)
tree1ce7e3fac5dfbbad2e63d2e91544f1ef8471e7db /examples/widgetbinding/CMakeLists.txt
parent34585b87fa5a06d3f9928d82d95ee242bdc54fb6 (diff)
Fix binding, scriptable examples for Windows debug
Fix the samplebinding, widgetbinding and scriptableapplication examples for debug configurations on Windows: 1. Account for the python_d executable name vs python 2. Same for the pyd file name for the binding examples (module_d.pyd instead of module.pyd) Pick-to: 6.2 6.3 Change-Id: I60933e8968401e03c829b797c5bc67a4db8d115d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/widgetbinding/CMakeLists.txt')
-rw-r--r--examples/widgetbinding/CMakeLists.txt22
1 files changed, 20 insertions, 2 deletions
diff --git a/examples/widgetbinding/CMakeLists.txt b/examples/widgetbinding/CMakeLists.txt
index e601a3579..2fe1ddcb0 100644
--- a/examples/widgetbinding/CMakeLists.txt
+++ b/examples/widgetbinding/CMakeLists.txt
@@ -52,7 +52,21 @@ set(generated_sources
# ================================== Shiboken detection ======================================
# Use provided python interpreter if given.
if(NOT python_interpreter)
- find_program(python_interpreter "python")
+ if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+ find_program(python_interpreter "python_d")
+ if(NOT python_interpreter)
+ message(FATAL_ERROR
+ "A debug Python interpreter could not be found, which is a requirement when "
+ "building this example in a debug configuration. Make sure python_d.exe is in "
+ "PATH.")
+ endif()
+ else()
+ find_program(python_interpreter "python")
+ if(NOT python_interpreter)
+ message(FATAL_ERROR
+ "No Python interpreter could be found. Make sure python is in PATH.")
+ endif()
+ endif()
endif()
message(STATUS "Using python interpreter: ${python_interpreter}")
@@ -204,7 +218,11 @@ set_property(TARGET ${bindings_library} PROPERTY PREFIX "")
set_property(TARGET ${bindings_library} PROPERTY OUTPUT_NAME
"${bindings_library}${PYTHON_EXTENSION_SUFFIX}")
if(WIN32)
- set_property(TARGET ${bindings_library} PROPERTY SUFFIX ".pyd")
+ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
+ set_property(TARGET ${bindings_library} PROPERTY SUFFIX "_d.pyd")
+ else()
+ set_property(TARGET ${bindings_library} PROPERTY SUFFIX ".pyd")
+ endif()
endif()
# Make sure the linker doesn't complain about not finding Python symbols on macOS.