From 15273fe0fe52569013dd4811bf9ed770ce7fb287 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 8 May 2018 14:15:57 +0200 Subject: Add an example that demonstrates bindings to a custom C++ library A CMake project is included that builds two shared libraries: 1) libuniverse - a hypothetical C++ library for which bindings need to be created. 2) Universe - a Python module containing bindings to the above library. The example showcases the following concepts: * primitive type bindings (bool, std::string) * types with object and value semantics (pass by pointer VS pass by copy) * inheritance and overriding virtual methods * ownership of heap-allocated C++ objects * constructors with default parameters * general structure of CMakeLists.txt file for generating bindings Task-number: PYSIDE-597 Change-Id: I7b0f203e2844e815aa611af3de2b50a9aa9b5bfc Reviewed-by: Friedemann Kleint --- examples/scriptableapplication/pyside2.pri | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'examples/scriptableapplication/pyside2.pri') diff --git a/examples/scriptableapplication/pyside2.pri b/examples/scriptableapplication/pyside2.pri index 59f7fd983..17be4392f 100644 --- a/examples/scriptableapplication/pyside2.pri +++ b/examples/scriptableapplication/pyside2.pri @@ -1,19 +1,21 @@ -PYSIDE2 = $$system(python $$PWD/pyside2_config.py --pyside2) +PYSIDE_CONFIG = $$PWD/../utils/pyside2_config.py + +PYSIDE2 = $$system(python $$PYSIDE_CONFIG --pyside2) isEmpty(PYSIDE2): error(Unable to locate the PySide2 package location) -PYTHON_INCLUDE = $$system(python $$PWD/pyside2_config.py --python-include) +PYTHON_INCLUDE = $$system(python $$PYSIDE_CONFIG --python-include) isEmpty(PYTHON_INCLUDE): error(Unable to locate the Python include headers directory) -PYTHON_LFLAGS = $$system(python $$PWD/pyside2_config.py --python-link) +PYTHON_LFLAGS = $$system(python $$PYSIDE_CONFIG --python-link) isEmpty(PYTHON_LFLAGS): error(Unable to locate the Python library for linking) -PYSIDE2_INCLUDE = $$system(python $$PWD/pyside2_config.py --pyside2-include) +PYSIDE2_INCLUDE = $$system(python $$PYSIDE_CONFIG --pyside2-include) isEmpty(PYSIDE2_INCLUDE): error(Unable to locate the PySide2 include headers directory) -PYSIDE2_LFLAGS = $$system(python $$PWD/pyside2_config.py --pyside2-link) +PYSIDE2_LFLAGS = $$system(python $$PYSIDE_CONFIG --pyside2-link) isEmpty(PYSIDE2_LFLAGS): error(Unable to locate the PySide2 libraries for linking) -PYSIDE2_SHARED_LIBRARIES = $$system(python $$PWD/pyside2_config.py --pyside2-shared-libraries) +PYSIDE2_SHARED_LIBRARIES = $$system(python $$PYSIDE_CONFIG --pyside2-shared-libraries) isEmpty(PYSIDE2_SHARED_LIBRARIES): error(Unable to locate the used PySide2 shared libraries) INCLUDEPATH += "$$PYTHON_INCLUDE" $$PYSIDE2_INCLUDE -- cgit v1.2.3