File: FindPySide2.cmake

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (27 lines) | stat: -rw-r--r-- 1,094 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Find PySide2
#
# PYSIDE2_INCLUDE_DIR - the folder for include files that contains PySide2/ and shiboken2/
# PYSIDE2_PYTHON_PATH - the folder to add to python's sys.path to locate the PySide modules
# PYSIDE2_LIBRARY_DIR - the folder containing the libshiboken2.so to link against with -lshiboken2
# PYSIDE2_FOUND       - true if PySide2 was successfully located

find_library(SHIBOKEN2_LIBRARY
             NAMES shiboken2)

get_filename_component(PYSIDE2_LIBRARY_DIR ${SHIBOKEN2_LIBRARY} DIRECTORY)

find_path(PYSIDE2_PACKAGE_INIT_PY
          NAMES PySide2/__init__.py)

get_filename_component(PYSIDE2_PACKAGE_DIR "${PYSIDE2_PACKAGE_INIT_PY}" DIRECTORY)
get_filename_component(PYSIDE2_PYTHON_PATH "${PYSIDE2_PACKAGE_DIR}" DIRECTORY)

find_path(PYSIDE2_INCLUDE_DIR
          NAMES PySide2/pyside.h
          HINTS ${PYSIDE2_PACKAGE_DIR}/include
          )

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PySide2 DEFAULT_MSG PYSIDE2_INCLUDE_DIR PYSIDE2_PYTHON_PATH PYSIDE2_LIBRARY_DIR)

mark_as_advanced(PYSIDE2_INCLUDE_DIR PYSIDE2_PYTHON_PATH PYSIDE2_LIBRARY_DIR)