CMAKE_TOOLCHAIN_FILE was not used by the project

后端 未结 4 2092
醉话见心
醉话见心 2020-12-15 02:46

Cmake gives this warning when building one third-party script:

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHA         


        
4条回答
  •  执念已碎
    2020-12-15 03:07

    This is the standard warning gives you when you're giving it a command line option it's not using. That is giving -DFOO=bar to cmake when the CMakeLists.txt doesn't use FOO variable.

    Now, that's a bit of a special case here: CMAKE_TOOLCHAIN_FILE is used by CMake the first time you're configuring your build, but as you can't change the toolchain for an already configured build, it's ignored every other time, thus the warning.

    As @Answeror said, you can safely ignore the warning, but if it really bother you, you can hide it by giving --no-warn-unused-cli to cmake.

提交回复
热议问题