[PySide] how to make cmake find a package configuration file

ZHONG Zhu Zhu.Zhong at alcatel-sbell.com.cn
Wed Jan 9 10:27:43 CET 2013


thank you Andy! I'll follow your guide and have a try.

-----Original Message-----
From: Andy Kittner [mailto:andkit at gmx.de] 
Sent: Wednesday, January 09, 2013 5:23 PM
To: ZHONG Zhu
Cc: pyside at qt-project.org
Subject: Re: [PySide] how to make cmake find a package configuration file

On 09.01.2013 09:55, ZHONG Zhu wrote:
> Cool, that works! Thank you Andy!
> Believe I'm very close to complete compiling this http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial
>
> Do you happen to know how I can get "find_package(PySide REQUIRED)" pass the cmake?
>
> I installed PySide with a Windows binary installer. It's located under python at D:\Python27\Lib\site-packages\PySide
> so there is no FindPySide.cmake or PySideConfig.cmake available.
Hmm I don't think the binary installer bundles the required headers, 
libs, etc. to build pyside-bindings. Last time I played with it I build 
pyside from source using the setup scripts from here:
   https://github.com/PySide/pyside-setup

You need either git or you can copy the required modules into the 
sources/ directory.

Then `python setup.py build` should build everything.
Afterwards there should be a directory there called install or 
pyside_install or something like that where you will find the required 
cmake files.

Oh, and I remember I needed to change some backslashes to forward 
slashes in at least one of those .cmake files because otherwise I got 
syntax errors from cmake. It's been quite a while so it may be fixed 
already, or maybe it was just a quirk of my cmake version.

PS: sorry for not replying to the list, hit the wrong button :/

Regards,
Andy
>
>
> -----Original Message-----
> From: Andy Kittner [mailto:andkit at gmx.de]
> Sent: Wednesday, January 09, 2013 4:42 PM
> To: ZHONG Zhu
> Subject: Re: [PySide] how to make cmake find a package configuration file
>
> On 09.01.2013 09:00, ZHONG Zhu wrote:
> [...]
>>     Add the installation prefix of "Shiboken" to CMAKE_PREFIX_PATH or set
>>     "Shiboken_DIR" to a directory containing one of the above files.  If
>>     "Shiboken" provides a separate development package or SDK, be sure it has
>>     been installed.
>> I do have Shiboken compiled and installed to C:\Program Files\shiboken. And I can see there are cmake files like ShibokenConfig.cmake, ShibokenConfig-python2.7.cmake, ShibokenConfigVersion.cmake under folder C:\Program Files\shiboken\lib\cmake\Shiboken-1.1.2
>> how do I let the cmake know it should search for ShibokenConfig.cmake in that folder?
>
> IIRC you need to add the parameter
> "-DShiboken_DIR=C:\Program Files\shiboken\lib\cmake\Shiboken-1.1.2" when
> you call cmake (with the quotes due to the space in the path).
>
>
> Regards,
> Andy
>



More information about the PySide mailing list