CMake ExternalProject_Add警告时停止执行 [英] CMake ExternalProject_Add Stop Executing on Warning

查看:193
本文介绍了CMake ExternalProject_Add警告时停止执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一系列ExternalPorject_Add来通过CMake静态下载,配置,构建和安装QT5。一切顺利,直到配置脚本。 Qt5配置脚本在静态编译时发出以下警告,此后,将忽略构建和安装步骤:

I am using a series of ExternalPorject_Add's to download, configure, build, and install QT5 statically using CMake. Everything goes well until the configure script. The Qt5 configure script issues the following warning when compiling statically, after which, the build and install steps are ignored:

CUSTOMBUILD : warning : Using static linking will disable the use of plugins.
           Make sure you compile ALL needed modules into the library.

我最后的ExternaProject_Add如下(还有其他人将下载步骤分解为另一个目标):

My final ExternaProject_Add is as follows (there are other's to break the download step into a different target):

  ExternalProject_Add(qt5_build
    DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND ""
    SOURCE_DIR ${QT5_REPO_PATH}
    CONFIGURE_COMMAND configure ${QT5_CONFIGURE}
    BUILD_COMMAND nmake BUILD_IN_SOURCE 1
    INSTALL_COMMAND nmake install
  )

是否有任何想法让项目忽略警告(警告甚至是导致警告停止的原因吗?)并继续进行构建和安装步骤?

Are there any thoughts on how to get the project to ignore the warnings (is the warning even what is causing it to stop?) and continue with the build and install steps?

我目前正在Windows上运行(在跨平台安装程序上运行),并且将Visual Studio 2013生成器与cmake一起使用。

I am currently running on windows (working on a cross-platform installer), and using the visual studio 2013 generator with cmake.

谢谢!

推荐答案

我遇到了与您相同的问题。事实证明,它与警告甚至退出代码都没有关系(在这种情况下)。

I had the same problem as you. It turns out it has nothing to do with the warnings or even the exit code (in this case).

发生这种情况是因为 configure 文件是一个批处理文件,Visual Studio在另一个批处理文件中执行配置生成步骤。

It happens because the configure file is a batch file and Visual Studio is executing the configure build steps in another batch file.

这意味着,如果您在 configure前面不使用关键字 call ,您将分支到 configure.bat ,并且永不返回并执行Visual Studio配置步骤中的其余步骤。

This means that if you don't use the keyword call in front of configure, you will branch off to the configure.bat and never return and execute the remaining steps in the Visual Studio configure step.

要解决此问题,您可以执行以下操作:

To fix this you can do:

ExternalProject_Add(qt5_build
    DOWNLOAD_COMMAND "" UPDATE_COMMAND "" PATCH_COMMAND ""
    SOURCE_DIR ${QT5_REPO_PATH}
    CONFIGURE_COMMAND call configure.bat ${QT5_CONFIGURE}
    BUILD_COMMAND nmake BUILD_IN_SOURCE 1
    INSTALL_COMMAND nmake install)

这篇关于CMake ExternalProject_Add警告时停止执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆