[CMake] Passing CMAKE_TOOLCHAIN_FILE on command line causes CMake warning

David Cole dlrdave at aol.com
Wed Feb 6 07:51:39 EST 2013


If you don't want to see the warning, then also pass in --no-warn-unused-cli on the command line.

  --no-warn-unused-cli        = Don't warn about command line options.

 
But that suppresses the warning for all unreferenced variables.

Or... add:

  message(STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'")

 
to the project's CMakeLists.txt file so the variable is always referenced.

 
The point is: CMAKE_TOOLCHAIN_FILE is only read on the first configure. After that point, all toolchain stuff is cached and the file is unnecessary for subsequent configures.

That bug should just be closed as "won't fix" because it's not a bug. It's the intended behavior, and there are multiple ways to avoid the legitimate warning.


Just my opinion,
D




-----Original Message-----
From: Pat Marion <pat.marion at kitware.com>
To: Michael Wild <themiwi at gmail.com>
Cc: cmake <cmake at cmake.org>
Sent: Wed, Feb 6, 2013 7:23 am
Subject: Re: [CMake] Passing CMAKE_TOOLCHAIN_FILE on command line causes CMake warning


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?

Pat


On Wed, Feb 6, 2013 at 9:52 PM, Michael Wild <themiwi at gmail.com> wrote:

Hi




On Wed, Feb 6, 2013 at 11:59 AM, Pat Marion <pat.marion at kitware.com> wrote:

Hi,

I'm emailing about bug 13093 in the backlog.  I found comments by Brad that suggest it's a legitimate warning, but I'm not sure how a project could avoid the warning.


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. 

My 2c

Michael





 
--

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

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130206/9fde1662/attachment-0001.htm>


More information about the CMake mailing list