I'm trying to cmake a project which calls
find_package(Shiboken REQUIRED)
cmake complains about
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "FindShiboken.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Shiboken",
but CMake did not find one.
Could not find a package configuration file provided by "Shiboken" with any
of the following names:
ShibokenConfig.cmake
shiboken-config.cmake
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?
CMake searches for a file called Find<package>. cmake in the CMAKE_MODULE_PATH followed by the CMake installation. If the file is found, it is read and processed by CMake. It is responsible for finding the package, checking the version, and producing any needed messages.
Config-file Packages A config-file package is a set of files provided by upstreams for downstreams to use. CMake searches in a number of locations for package configuration files, as described in the find_package() documentation.
CMake ships with its own set of built-in find_package scripts, and their location is in the default CMAKE_MODULE_PATH. The more normal use case for dependent projects that have been CMakeified would be to use CMake's external_project command and then include the Use[Project]. cmake file from the subproject.
One of Shiboken's contributors answered my question through email and I confirmed it's working.
The solution:
cmake .. -G"MinGW Makefiles" -DShiboken_DIR=C:\shiboken\lib\cmake\Shiboken-1.1.2
Note: I copied C:\Program Files\shiboken to C:\shiboken because cmake complains about "C:\Program Files" (maybe caused by the space in it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With