I am trying to set up Github Actions for a C++ code base with Qt5 dependency and CMake as a build system.
Being novice with Github Actions, I started with the cmake-multi-platform template, where I inserted the following step before cmake is called :
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
dir: '${{ github.workspace }}/extern/'
install-deps: 'true'
archives: 'qtbase'
cache: 'true'
cache-key-prefix: 'install-qt-action'
I also added an env
key to the configuration step:
- name: Configure CMake
env:
CMAKE_PREFIX_PATH: ${{env.Qt5_DIR}}
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
This was eventually enough to have CMake configuration run without errors.
The compilation step fails with the following messages
/usr/bin/ld: warning: libicui18n.so.56, needed by /home/runner/work/pptranspog/pptranspog/extern/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5.15.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicuuc.so.56, needed by /home/runner/work/pptranspog/pptranspog/extern/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5.15.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicudata.so.56, needed by /home/runner/work/pptranspog/pptranspog/extern/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5.15.2, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /home/runner/work/pptranspog/pptranspog/extern/Qt/5.15.2/gcc_64/lib/libQt5Core.so.5.15.2: undefined reference to `ucol_open_56'
...
followed by a string of undefined references to ICU functions called by the Qt5 library.
I assumed that setting install-deps
to true
when installing Qt should have installed all its dependencies. That is apparently not the case.
What would be the recommended solution in this situation?
It suffices to add icu
to the list of archives in the Install Qt
step:
archives: 'qtbase icu'