Cannot build project after Qt update to 5.11.3

Martin Omacht's Avatar

Martin Omacht

18 Feb, 2019 04:39 PM

After AppVeyor updated Qt 5.11.2 to Qt 5.11.3 my builds are failing and I don't know how to fix it. Before the update I made the mistake to point to the C:\Qt\5.11.2\ directory so after the update the directory did not exist. So I changed the directory to the mapped C:\Qt\5.11\, but the build is still failing. Before the update it was working fine.

The error I get:

-- The C compiler identification is GNU 5.3.0
-- Check for working C compiler: C:/Qt/Tools/mingw530_32/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Tools/mingw530_32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: C:/Python27/python.exe (found version "2.7.15") 
CMake Error at CMakeLists.txt:38 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.
  Could not find a package configuration file provided by "Qt5" with any of
  the following names:
  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
See also "C:/projects/projectelf/build/CMakeFiles/CMakeOutput.log".
Command exited with code 1

Here is my appveyor.yml:

version: 1.0.{build}

image: Visual Studio 2015 configuration: Debug platform: x64

environment: QTDIR: C:\Qt\5.11\mingw53_32

install: - set PATH=%PATH%;%QTDIR%\bin;C:\Qt\Tools\mingw530_32\bin - set CC=C:\Qt\Tools\mingw530_32\bin\gcc.exe - set CXX=C:\Qt\Tools\mingw530_32\bin\g++.exe - set Qt5_DIR=%QTDIR%\lib\cmake\Qt5 - set PATH=%PATH:C:\Program Files\Git\usr\bin=% # trick to remove sh.exe

before_build: - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Debug -G"CodeBlocks - MinGW Makefiles" ..

build_script: - mingw32-make

test_script: - set CTEST_OUTPUT_ON_FAILURE=1 - set GTEST_COLOR=1 - mingw32-make test

I am setting the Qt5_DIR direcotry and CMake still can't find the needed files.

Can someone help me fix this? Thanks

  1. Support Staff 1 Posted by Owen McDonnell on 18 Feb, 2019 10:14 PM

    Owen McDonnell's Avatar

    Can you try adding the same path that you have assigned to QTDIR to another environment variable CMAKE_PREFIX_PATH as suggested in the error.

  2. 2 Posted by Martin Omacht on 18 Feb, 2019 10:57 PM

    Martin Omacht's Avatar

    I have tried to assign the path to the variable CMAKE_PREFIX_PATH as you suggested like this cmake -DCMAKE_PREFIX_PATH=C:\Qt\5.11\mingw53_32\lib\cmake\Qt5 and it works, then I tried to assign it from the environmental variable Qt5_DIR like this: cmake -DCMAKE_PREFIX_PATH=%Qt5_DIR% and it did not work again even though the variable should contain the same path. So I printed all the environmental variables using SET command and found that the variables do not have the expected value, but instead they are still pointing to the old 5.11.2 direcotry:


    Seems like some kind of bug?

    Thanks for the suggestion, I will use the CMAKE_PREFIX_PATH variable until this is resolved.

    I attached the log file from the build with printed environmental variables so you can see, that the variables are set to 5.11 directory, but still point to the 5.11.2 directory.

  3. Support Staff 3 Posted by Owen McDonnell on 19 Feb, 2019 12:12 AM

    Owen McDonnell's Avatar

    Perhaps you have that environment variable set in the UI (environment variables set in the UI will overwrite those in the config file as described here)

  4. Ilya Finkelshteyn closed this discussion on 21 Apr, 2019 09:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac