1diff --git a/CMakeLists.txt b/CMakeLists.txt
2index 0c0568a..f12d50e 100644
3--- a/CMakeLists.txt
4+++ b/CMakeLists.txt
5@@ -105,15 +105,17 @@ macro(pyside_config option output_var)
6 endmacro()
7
8 # Query for the shiboken generator path, Python path, include paths and linker flags.
9+find_package(Shiboken6 REQUIRED)
10+find_package(PySide6 REQUIRED)
11 pyside_config(--shiboken-module-path shiboken_module_path)
12-pyside_config(--shiboken-generator-path shiboken_generator_path)
13-pyside_config(--pyside-path pyside_path)
14-pyside_config(--pyside-include-path pyside_include_dir 1)
15+set(shiboken_generator_path "" CACHE PATH "Path where shiboken6 executable can be found")
16+set(pyside_path "" CACHE PATH "pyside share path, where typesystems dir can be found")
17+get_target_property(pyside_include_dir PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES)
18 pyside_config(--python-include-path python_include_dir)
19-pyside_config(--shiboken-generator-include-path shiboken_include_dir 1)
20-pyside_config(--shiboken-module-shared-libraries-cmake shiboken_shared_libraries 0)
21+get_target_property(shiboken_include_dir Shiboken6::libshiboken INTERFACE_INCLUDE_DIRECTORIES)
22+get_target_property(shiboken_shared_libraries Shiboken6::libshiboken IMPORTED_LOCATION_RELEASE)
23 pyside_config(--python-link-flags-cmake python_linking_data 0)
24-pyside_config(--pyside-shared-libraries-cmake pyside_shared_libraries 0)
25+get_target_property(pyside_shared_libraries PySide6::pyside6 IMPORTED_LOCATION_RELEASE)
26
27 set(shiboken_path "${shiboken_generator_path}/shiboken6${CMAKE_EXECUTABLE_SUFFIX}")
28 if(NOT EXISTS ${shiboken_path})
29diff --git a/setup.py b/setup.py
30index 802821b..f522818 100644
31--- a/setup.py
32+++ b/setup.py
33@@ -88,7 +88,9 @@ setuptools.setup(
34 "-DBUILD_STATIC:BOOL=ON",
35 "-DADS_VERSION=4.3.0",
36 f"-DPython3_ROOT_DIR={Path(sys.prefix)}",
37- f"-DPython_EXECUTABLE={Path(sys.executable)}"
38+ f"-DPython_EXECUTABLE={Path(sys.executable)}",
39+ "-Dshiboken_generator_path=@shiboken6@/bin",
40+ "-Dpyside_path=@pyside6@/share/PySide6"
41 ],
42 py_limited_api=True
43 ),