File: FindPySide6.cmake

package info (click to toggle)
freecad 1.0.0%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 463,492 kB
  • sloc: cpp: 930,635; python: 586,652; xml: 103,037; ansic: 9,568; fortran: 3,878; lex: 699; sh: 645; javascript: 311; yacc: 271; makefile: 120
file content (22 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# The Qt for Python project officially recommends using pip to install PySide, so we expect to find PySide in the
# site-packages directory. The library will be called "PySide6.abi3.*", and there will be an "include" directory inside
# the site-packages/PySide6. Over time some distros may provide custom versions, so we also support using a more normal
# cMake find_package() call

find_package(PySide6 CONFIG QUIET)
if(NOT PySide6_FOUND)
    if(NOT PySide6_INCLUDE_DIR AND TARGET PySide6::pyside6)
        get_property(PySide6_INCLUDE_DIR TARGET PySide6::pyside6 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
    endif()

    if(NOT PySide6_INCLUDE_DIR)
        find_pip_package(PySide6)
        if (PySide6_FOUND)
            set(PYSIDE_INCLUDE_DIR ${PySide6_INCLUDE_DIRS} CACHE INTERNAL "")
            set(PYSIDE_LIBRARY ${PySide6_LIBRARIES} CACHE INTERNAL "")
            set(PYSIDE_FOUND TRUE CACHE BOOL OFF)
            set(PYSIDE_MAJOR_VERSION 6 CACHE INTERNAL 6)
        endif()
    endif()

endif()