From 4544a943ca2df4e6f0ac24914f0c0f844dc6f748 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 2 Nov 2020 09:52:19 +0100 Subject: Binding Example helpers: Remove version numbers - Rename the scripts - Introduce variables for the versions in pyside_config.py Change-Id: I1dcb8ca7eee259f25af0db7c09abd30484c7e99c Reviewed-by: Cristian Maureira-Fredes --- examples/samplebinding/CMakeLists.txt | 26 +++++++++++++------------- examples/samplebinding/README.md | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'examples/samplebinding') diff --git a/examples/samplebinding/CMakeLists.txt b/examples/samplebinding/CMakeLists.txt index aefc775fe..fcad47b28 100644 --- a/examples/samplebinding/CMakeLists.txt +++ b/examples/samplebinding/CMakeLists.txt @@ -47,8 +47,8 @@ endif() message(STATUS "Using python interpreter: ${python_interpreter}") # Macro to get various pyside / python include / link flags and paths. -# Uses the not entirely supported utils/pyside2_config.py file. -macro(pyside2_config option output_var) +# Uses the not entirely supported utils/pyside_config.py file. +macro(pyside_config option output_var) if(${ARGC} GREATER 2) set(is_list ${ARGV2}) else() @@ -56,13 +56,13 @@ macro(pyside2_config option output_var) endif() execute_process( - COMMAND ${python_interpreter} "${CMAKE_SOURCE_DIR}/../utils/pyside2_config.py" + COMMAND ${python_interpreter} "${CMAKE_SOURCE_DIR}/../utils/pyside_config.py" ${option} OUTPUT_VARIABLE ${output_var} OUTPUT_STRIP_TRAILING_WHITESPACE) if ("${${output_var}}" STREQUAL "") - message(FATAL_ERROR "Error: Calling pyside2_config.py ${option} returned no output.") + message(FATAL_ERROR "Error: Calling pyside_config.py ${option} returned no output.") endif() if(is_list) string (REPLACE " " ";" ${output_var} "${${output_var}}") @@ -70,14 +70,14 @@ macro(pyside2_config option output_var) endmacro() # Query for the shiboken generator path, Python path, include paths and linker flags. -pyside2_config(--shiboken6-module-path shiboken6_module_path) -pyside2_config(--shiboken6-generator-path shiboken6_generator_path) -pyside2_config(--python-include-path python_include_dir) -pyside2_config(--shiboken6-generator-include-path shiboken_include_dir 1) -pyside2_config(--shiboken6-module-shared-libraries-cmake shiboken_shared_libraries 0) -pyside2_config(--python-link-flags-cmake python_linking_data 0) - -set(shiboken_path "${shiboken6_generator_path}/shiboken6${CMAKE_EXECUTABLE_SUFFIX}") +pyside_config(--shiboken-module-path shiboken_module_path) +pyside_config(--shiboken-generator-path shiboken_generator_path) +pyside_config(--python-include-path python_include_dir) +pyside_config(--shiboken-generator-include-path shiboken_include_dir 1) +pyside_config(--shiboken-module-shared-libraries-cmake shiboken_shared_libraries 0) +pyside_config(--python-link-flags-cmake python_linking_data 0) + +set(shiboken_path "${shiboken_generator_path}/shiboken6${CMAKE_EXECUTABLE_SUFFIX}") if(NOT EXISTS ${shiboken_path}) message(FATAL_ERROR "Shiboken executable not found at path: ${shiboken_path}") endif() @@ -93,7 +93,7 @@ endif() # Enable rpaths so that the built shared libraries find their dependencies. set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) -set(CMAKE_INSTALL_RPATH ${shiboken6_module_path} ${CMAKE_CURRENT_SOURCE_DIR}) +set(CMAKE_INSTALL_RPATH ${shiboken_module_path} ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # ============================================================================================= # !!! End of dubious section. diff --git a/examples/samplebinding/README.md b/examples/samplebinding/README.md index 34f3568f2..93d56f5bd 100644 --- a/examples/samplebinding/README.md +++ b/examples/samplebinding/README.md @@ -127,7 +127,7 @@ rules for those interested in the build process. This example can only be built using **CMake**. The following requirements need to be met: -* A PySide2 package is installed into the current active Python +* A PySide package is installed into the current active Python environment (system or virtualenv) * A new enough version of CMake (**3.1+**). @@ -138,8 +138,8 @@ For Windows you will also need: configuration is the same (all Release, which is more likely, or all Debug). -The build uses the `pyside2_config.py` file to configure the project -using the current PySide2/Shiboken6 installation. +The build uses the `pyside_config.py` file to configure the project +using the current PySide/Shiboken installation. ### Using CMake @@ -215,18 +215,18 @@ no clean solution to include symbolic links in a wheel package ## Windows Notes The build config of the bindings (Debug or Release) should match -the PySide2 build config, otherwise the application will not properly +the PySide build config, otherwise the application will not properly work. In practice this means the only supported configurations are: 1. release config build of the bindings + - PySide2 `setup.py` without `--debug` flag + `python.exe` for the - PySide2 build process + `python36.dll` for the linked in shared + PySide `setup.py` without `--debug` flag + `python.exe` for the + PySide build process + `python36.dll` for the linked in shared library. 2. debug config build of the application + - PySide2 `setup.py` **with** `--debug` flag + `python_d.exe` for the - PySide2 build process + `python36_d.dll` for the linked in shared + PySide `setup.py` **with** `--debug` flag + `python_d.exe` for the + PySide build process + `python36_d.dll` for the linked in shared library. This is necessary because all the shared libraries in question have to -- cgit v1.2.3