<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">LOL...just found it...<br><br>Apparently, if CMAKE_FIND_ROOT_PATH_MODE_PACKAGE is set to ONLY, that will negate any PATHS setting in find_package().<br><br>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.<br><div><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Steven Boswell<br></span></div><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Steven Boswell II
<ulatekh@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> "cmake@cmake.org" <cmake@cmake.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, May 18, 2013 5:28 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [CMake] How can find_package fail?<br> </font> </div> <div class="y_msg_container"><br>
<div id="yiv2030801260"><div><div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:12pt;"><div>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.</div><div><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">Admittedly, I'm trying to do something complex, though the part that's failing seems really simple.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">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).</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">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</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">find_package(Automoc4 QUIET NO_MODULE)</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">to say</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times,
serif;background-color:transparent;font-style:normal;">find_package(Automoc4 QUIET NO_MODULE PATHS "${HOST_PREFIX_PATH}")</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">and I've passed the value of HOST_PREFIX_PATH on the cmake command line as "/usr/lib/automoc4".</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">My machine has a /usr/lib/automoc4/Automoc4Config.cmake file.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">But find_package() consistently fails! Is there
any explanation why?</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">I added the line</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">message (STATUS "Got here /usr/lib/automoc4/Automoc4Config.cmake")</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">to /usr/lib/automoc4/Automoc4Config.cmake, so that I could make sure whether it is/isn't getting called. It's not.<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times,
serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">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.</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">Any ideas?<br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;">Steven Boswell</div><div style="color:rgb(0, 0, 0);font-size:16px;font-family:times new roman, new york, times, serif;background-color:transparent;font-style:normal;"><br></div></div></div></div><br>--<br><br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br><br></div> </div> </div> </div></body></html>