aboutsummaryrefslogtreecommitdiffstats
path: root/examples/scriptableapplication/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/scriptableapplication/CMakeLists.txt')
-rw-r--r--examples/scriptableapplication/CMakeLists.txt29
1 files changed, 22 insertions, 7 deletions
diff --git a/examples/scriptableapplication/CMakeLists.txt b/examples/scriptableapplication/CMakeLists.txt
index b1a9ca078..fbfa00b98 100644
--- a/examples/scriptableapplication/CMakeLists.txt
+++ b/examples/scriptableapplication/CMakeLists.txt
@@ -1,5 +1,8 @@
-cmake_minimum_required(VERSION 3.16)
-cmake_policy(VERSION 3.16)
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+cmake_minimum_required(VERSION 3.18)
+cmake_policy(VERSION 3.18)
# Enable policy to run automoc on generated files.
if(POLICY CMP0071)
@@ -12,13 +15,25 @@ project(scriptableapplication)
set(CMAKE_CXX_STANDARD 17)
# Find required Qt packages.
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 COMPONENTS Core Gui Widgets)
# Use provided python interpreter if given.
if(NOT python_interpreter)
- find_program(python_interpreter NAMES python3 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}")
@@ -86,7 +101,7 @@ set(WRAPPED_HEADER ${CMAKE_SOURCE_DIR}/wrappedclasses.h)
set(TYPESYSTEM_FILE ${CMAKE_SOURCE_DIR}/scriptableapplication.xml)
set(SHIBOKEN_OPTIONS --generator-set=shiboken --enable-parent-ctor-heuristic
- --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero
+ --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb-bool
--avoid-protected-hack
${INCLUDES}
-I${CMAKE_SOURCE_DIR}