LOL...just found it...
Apparently, if CMAKE_FIND_ROOT_PATH_MODE_PACKAGE is set to ONLY, that will
negate any PATHS setting in find_package().
I humbly request that the documentation (e.g.
http://www.cmake.org/cmake/help/v2.8.11/cmake.html) be improved to make this
clear.
Steven Boswell
________________________________
From: Steven Boswell II <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Saturday, May 18, 2013 5:28 PM
Subject: [CMake] How can find_package fail?
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
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake