I'd like you to try pasting the following text into a google search, so you can appreciate how widespread the warning is, 257 results from lots of different projects:<br><br><br>CMake Warning: Manually-specified variables were not used by the project: CMAKE_TOOLCHAIN_FILE<br>
<br><br>Most of these projects are not going to incorporate workarounds. The warning is confusing to lots of users, and they're already unsure of the while crosscompiling thing, so seeing a warning adds uncertainty that they're doing it right. Adding a workaround into the target project is not always possible since you might not have commit access or are compiling a previously released, stable version.<br>
<br>Pat<br><br><br><br><div class="gmail_quote">On Wed, Feb 6, 2013 at 10:51 PM, David Cole <span dir="ltr"><<a href="mailto:dlrdave@aol.com" target="_blank">dlrdave@aol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="black" face="arial">If you don't want to see the warning, then <font>also pass in --no-warn-unused-cl<font>i on the command line.<br>
<br>
</font><font> --no-warn-unused-cli = Don't warn about command line options.</font><br>
</font><font color="black" face="arial">
</font></font><div><font color="black" face="arial"><font color="black" face="arial"> <br>
<font>But that suppresses the warning <font>for all unreferenced variables.<br>
<br>
<font>Or... add<font>:<br>
<br>
</font> message<font>(STATUS "CMAKE_TOOLCHAIN<font>_FILE='${CMAKE_TOOLCHAIN_FILE}'</font>")</font></font><br>
</font></font></font></font>
</div>
<div> <br>
<font>to the project<font>'s CMakeLists.txt file so </font></font>the <font>v<font>ariable is always referenced.</font></font><br>
</div>
<div> <br>
<font>The point is: CMAKE_<font>TOOLCHAI<font>N_FILE is only read on the first configure. After that point, all toolchain stuff is cached and the file is unnecessary for subsequent configures.<br>
<br>
</font></font></font><font>That bu<font>g should just be closed as "won<font>'t fix" because it's not a bug. It's the intended behavior, and there are multiple ways to avoid the legitimate warning.<br>
<br>
<br>
<font>Just my opinion,<br>
<font>D<br>
<br>
<br>
</font></font></font></font></font><br>
</div>
<div style="font-size:10pt;font-family:arial,helvetica"><div><div class="h5">-----Original Message-----<br>
From: Pat Marion <<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>><br>
To: Michael Wild <<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>><br>
Cc: cmake <<a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a>><br>
Sent: Wed, Feb 6, 2013 7:23 am<br>
Subject: Re: [CMake] Passing CMAKE_TOOLCHAIN_FILE on command line causes CMake warning<br>
<br>
<div>
That's a pretty messy workaround though, I think. ExternalProject_Add passes in lots of variables, including ones that do not typically change, like CMAKE_CXX_COMPILER. Why impose a special requirement on the CMAKE_TOOLCHAIN_FILE variable? Would a patch to avoid the warning be a welcome change, or is there a reason the warning should remain?<br>
<br>
Pat<br>
<br>
<div class="gmail_quote">On Wed, Feb 6, 2013 at 9:52 PM, Michael Wild <span dir="ltr"><<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi<br>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>On Wed, Feb 6, 2013 at 11:59 AM, Pat Marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm emailing about <a href="http://public.kitware.com/Bug/view.php?id=13093" target="_blank">bug 13093</a> in the backlog. I found <a href="http://www.cmake.org/pipermail/cmake/2011-February/042556.html" target="_blank">comments by Brad</a> that suggest it's a legitimate warning, but I'm not sure how a project could avoid the warning.</blockquote>
</div>
<div><br>
By not specifying the toolchain file, for instance? If you have the problem in conjunction with ExternalProject_Add, check whether the CMakeCache.txt file exists in the build tree of the external project. If not, include the flag, otherwise drop it. <br>
<br>
My 2c<span><font color="#888888"><br>
<br>
Michael<br>
</font></span></div>
</div>
</div>
</div>
</blockquote></div>
<br>
</div>
</div></div><div style="font-size:12px;font-family:Tahoma,Verdana,Arial,Sans-Serif;margin:0px">
<pre style="font-size:9pt"><tt>--
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>
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>
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>
Follow this link to subscribe/unsubscribe:
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a>
</tt></pre>
</div>
</div>
</blockquote></div><br>