What version of cmake are you using? And since you are cross-compiling, what does your toolchain file for cmake look like? &nbsp;Did you add a find path in that file for your powerpc libs?<br>The spec file only applies on qmake generated makefiles, which is not happening when using cmake.<br>And you do not need to build your own qmake.<br><br>Clint<br><br>----- Reply message -----<br>From: &quot;Daniel Näslund&quot; &lt;dannas@dannas.name&gt;<br>Date: Mon, Jul 18, 2011 12:12 am<br>Subject: [CMake] How pass a -spec parameter to FindQt4.cmake?<br>To: &lt;cmake@cmake.org&gt;<br><br>Hi!<br><br>I&#39;m trying to cross-compile a Qt-application for the powerpc platform.<br>CMake looks for the Qt libraries in the wrong place - it finds the host<br>libraries instead of the target libraries:<br><br> &nbsp; &nbsp;Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as /usr/lib<br> &nbsp; &nbsp;Warning: But QtCore couldn&#39;t be found. &nbsp;Qt must NOT be installed<br>correctly, or it wasn&#39;t found for cross compiling.<br> &nbsp; &nbsp;CMake Error at /usr/share/cmake-2.8/Modules/FindQt4.cmake:642 (MESSAGE):<br> &nbsp; &nbsp; &nbsp;Could NOT find QtCore. &nbsp;Check /tmp/tmp8VJ3jw/CMakeFiles/CMakeError.log for<br> &nbsp; &nbsp; &nbsp;more details.<br> &nbsp; &nbsp;Call Stack (most recent call first):<br> &nbsp; &nbsp; &nbsp;CMakeLists.txt:60 (find_package)<br><br>My powerpc libs are located in /opt/env/ppc/usr/lib.<br><br>When I read FindQt4.cmake I see that CMake uses QMake for finding out<br>where the Qt libs reside using &quot;qmake -query&quot;.<br><br>Is there an easy way to let CMake tell QMake about what platform we want<br>to build for? I&#39;ve tried...<br><br>...Using an environment variable<br> &nbsp; &nbsp;$ QMAKESPEC=qws/linux-powerpc-g++ cmake<br><br>...Using a shell wrappper<br> &nbsp; &nbsp;$ cat &lt;&lt;END &gt; ~/bin/qmake<br> &nbsp; &nbsp;#!/bin/sh<br><br> &nbsp; &nbsp;qmake -spec qws/linux-ppc-g++ -query $*<br> &nbsp; &nbsp;END<br> &nbsp; &nbsp;$ cmake<br><br>The environment variable didn&#39;t make any difference and the shell wrapper<br>failed since qmake didn&#39;t allow the -spec and -query flag to be passed<br>simultaneously.<br><br>All of the three resources below suggests that compiling my own version<br>of qmake is the way to go but to me it sounds a bit counter-intuitive;<br>why would cmake not allow me to pass a -spec parameter to qmake?<br><br><a href="http://www.linuxjournal.com/content/cross-compiling-qt">http://www.linuxjournal.com/content/cross-compiling-qt</a><br><a href="http://www.cmake.org/pipermail/cmake/2010-June/037239.html">http://www.cmake.org/pipermail/cmake/2010-June/037239.html</a><br><a href="http://www.trinitydesktop.org/docs/qt4/qt-embedded-crosscompiling.html">http://www.trinitydesktop.org/docs/qt4/qt-embedded-crosscompiling.html</a><br><br>--<br><br>Thanks,<br>Daniel Näslund<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">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">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">http://www.cmake.org/mailman/listinfo/cmake</a><br><br><br>