Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

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?

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

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
151 views
Welcome To Ask or Share your Answers For Others

1 Answer

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).

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

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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...