[CMake] How can find_package fail?

Steven Boswell II ulatekh at yahoo.com
Sat May 18 20:28:07 EDT 2013


Hello all...I've used cmake a lot in the past, and it's done very well for me...but I'm afraid I've run into a brick wall.

Admittedly, I'm trying to do something complex, though the part that's failing seems really simple.

I know that cmake doesn't handle multiple toolchains very well.  The 
problem is that I'm trying to build a MinGW version of the phonon 
package from Fedora Core 18, i.e. cross-compile.  Most of the find_* 
commands need to look at the cross-compile cmake environment, and they 
are, but there's at least one exception -- it needs to run the host's 
automoc tool (to preprocess Qt/KDE files).

If you want to follow along in the phonon source code, I'm in phonon-4.6.0/cmake/FindAutomoc4.cmake; I've modified the line
find_package(Automoc4 QUIET NO_MODULE)
to say
find_package(Automoc4 QUIET NO_MODULE PATHS "${HOST_PREFIX_PATH}")
and I've passed the value of HOST_PREFIX_PATH on the cmake command line as "/usr/lib/automoc4".
My machine has a /usr/lib/automoc4/Automoc4Config.cmake file.

But find_package() consistently fails!  Is there any explanation why?

I added the line
message (STATUS "Got here /usr/lib/automoc4/Automoc4Config.cmake")
to /usr/lib/automoc4/Automoc4Config.cmake, so that I could make sure whether it is/isn't getting called.  It's not.


Out of desperation, I even ran "restorecon -Rv /usr", since SELinux 
contexts tend to lead to mysterious errors like this, but it found 
nothing relevant.

Any ideas?


Steven Boswell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130518/ef04830e/attachment.htm>


More information about the CMake mailing list