-1

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!

T. Waters
  • 3
  • 4
  • What about **googling** for warning message? You may found several resources describing possible problems.. – Tsyvarev Dec 22 '15 at 22:49
  • alas...google has failed me in finding a way to get ExternalProject to ignore warnings :) – T. Waters Dec 22 '15 at 23:03
  • `ExternalProject_Add` ignores warning and error **messages**: Only **result of the script** affects on its behaviour. And given warning (like any other one) unlikely generates non-zero result of the script. BTW, you can always try to configure/build/install external project manually, and see what will be happen. Or you can see into the remaining build log. – Tsyvarev Dec 22 '15 at 23:14

2 Answers2

2

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

The configure script was returning a non-zero result causing the subsequent steps to fail, even though the warning really is non-fatal. I've stepped away from using ExternalProject and just implemented the same functionality using add_custom_target.

T. Waters
  • 3
  • 4
  • But `add_custom_target` also checks return value of its COMMAND arguments. How it helps in comparision with `ExternalProject_Add`? – Tsyvarev Dec 23 '15 at 11:02
  • I had to break it into two separate custom targets...first with the configure, second with the build/install commands. – T. Waters Dec 23 '15 at 18:36