title: Build Qt/cmake based project in GitHub Actions
body: <p>I'm using Qt 5.12.11 in my project. As I wanted to use the software both on linux and win, I selected gcc compiler (I use MSYS2, so gcc is 10.3.0). The local build is ok both for linux and win, but the build via GitHub Actions fails on finding the qt (no matter if I set CMAKE_PREFIX_PATH or Qt5_DIR or not).</p>
  <p>So this is where I'm stuck for a while. Has anyone encountered such problems or have any ideas on it?</p>
  <p>github action looks like</p>
  <pre><code>name: Build
  
  on:
    push:
      branches: [ master ]
    pull_request:
      branches: [ master ]
  
  env:
    BUILD_TYPE: Release
  
  jobs:
    build:
      runs-on: windows-latest
      defaults:
          run:
              shell: msys2 {0}
  
      steps:
        - uses: msys2/setup-msys2@v2
          with:
              install: mingw-w64-x86_64-toolchain
              msystem: mingw64
              release: false
  
        - name: Install Qt
          uses: jurplel/install-qt-action@v2
          with:
            version: '5.12.11'
            host: 'windows'
            target: 'desktop'
            arch: 'win64_mingw73'
            dir: '${{github.workspace}}/qt/'
            install-deps: 'true'
  
        - name: List files in Qt
          run: find ${{env.Qt5_Dir}}
  
        - uses: actions/checkout@v2
  
        - name: Configure CMake
          run: cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH=&quot;${{env.Qt5_Dir}}/lib/cmake/&quot; -DQt5_DIR=${{env.Qt5_Dir}}/lib/cmake/Qt5/ -G &quot;CodeBlocks - MinGW Makefiles&quot; -B '${{github.workspace}}'/build
  
        - name: Build
          run: cmake --build '${{github.workspace}}'/build --target RePr
  
  </code></pre>
  <p>I've also tried <code>-DCMAKE_PREFIX_PATH=&quot;${{env.Qt5_Dir}}/lib/cmake/Qt5/&quot;</code> but it didn't help. :( if I set the CMAKE_PREFIX_PATH directly from the cmakelists I observe the same behavior.</p>
  <p>CMakeLists on which it fails is quite simple and usual (it's a nested package that uses qt, so don't be confused about different cmakelists project and build target)</p>
  <pre><code>cmake_minimum_required(VERSION 3.14)
  project(RePr_controller)
  
  set(CMAKE_CXX_STANDARD 17)
  set(CMAKE_AUTOMOC ON)
  set(CMAKE_AUTORCC ON)
  set(CMAKE_AUTOUIC ON)
  
  set(QT_VERSION 5)
  set(REQUIRED_LIBS Core Gui Widgets)
  set(REQUIRED_LIBS_QUALIFIED Qt5::Core Qt5::Gui Qt5::Widgets)
  
  add_library(${PROJECT_NAME} main_window.cpp main_window.h main_window.ui resources/resources.qrc)
  add_dependencies(${PROJECT_NAME} FacadeLib)
  target_link_libraries(${PROJECT_NAME} FacadeLib Utils)
  
  find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} REQUIRED)
  target_link_libraries(${PROJECT_NAME} ${REQUIRED_LIBS_QUALIFIED})
  </code></pre>
  <p>Messaging the CMAKE_PREFIX_PATH directly from the cmakelists returns</p>
  <pre><code>D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64/lib/cmake/
  </code></pre>
  <p>qt5 is here</p>
  <pre><code>D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64/lib/cmake/Qt5/Qt5Config.cmake
  </code></pre>
  <p>finally, I got this message from configuring step</p>
  <pre><code>cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=&quot;D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64/lib/cmake/&quot; -DQt5_DIR=D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64/lib/cmake/Qt5/ -G &quot;CodeBlocks - MinGW Makefiles&quot; -B 'D:\a\RePr\RePr'/build
    shell: D:\a\_temp\msys\msys2.CMD {0}
    env:
      BUILD_TYPE: Release
      MSYSTEM: MINGW64
      pythonLocation: C:\hostedtoolcache\windows\Python\3.9.6\x64
      Qt5_Dir: D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64
      QT_PLUGIN_PATH: D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64/plugins
      QML2_IMPORT_PATH: D:/a/RePr/RePr/qt/Qt/5.12.11/mingw73_64/qml
  -- The C compiler identification is GNU 10.3.0
  -- The CXX compiler identification is GNU 10.3.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  
  CMake Error at Controller/CMakeLists.txt:17 (find_package):
    By not providing &quot;FindQt5.cmake&quot; in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by &quot;Qt5&quot;, but
  -- Configuring incomplete, errors occurred!
  See also &quot;D:/a/RePr/RePr/build/CMakeFiles/CMakeOutput.log&quot;.
    CMake did not find one.
  
    Could not find a package configuration file provided by &quot;Qt5&quot; with any of
    the following names:
  
      Qt5Config.cmake
      qt5-config.cmake
  
    Add the installation prefix of &quot;Qt5&quot; to CMAKE_PREFIX_PATH or set &quot;Qt5_DIR&quot;
    to a directory containing one of the above files.  If &quot;Qt5&quot; provides a
    separate development package or SDK, be sure it has been installed.
  
  
  Error: Process completed with exit code 1.
  </code></pre>