fix Qt error

This commit is contained in:
Putta Khunchalee 2022-06-07 17:29:34 +07:00
parent c7f5e79037
commit 94a63991e5
2 changed files with 24 additions and 16 deletions

View File

@ -53,6 +53,10 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
lfs: true lfs: true
- name: Install Ubuntu packages
run: |
sudo apt-get update
sudo apt-get install -y qt5-default
- name: Run CMake - name: Run CMake
run: cmake -B _Build/_Linux -S source -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1 run: cmake -B _Build/_Linux -S source -D CMAKE_BUILD_TYPE=Release -D KYTY_FINAL=1
- name: Build - name: Build

View File

@ -45,17 +45,19 @@ endif()
add_dependencies(launcher KytyGitVersion) add_dependencies(launcher KytyGitVersion)
find_program(QT_WINDEPLOYQT NAMES windeployqt PATHS "${Qt5_DIR}/../../../bin")
if(NOT QT_WINDEPLOYQT)
message(FATAL_ERROR "Could not find windeployqt")
endif()
set(launcher_name "launcher") set(launcher_name "launcher")
set_target_properties(launcher PROPERTIES OUTPUT_NAME ${launcher_name}) set_target_properties(launcher PROPERTIES OUTPUT_NAME ${launcher_name})
install(TARGETS launcher DESTINATION .) install(TARGETS launcher DESTINATION .)
if(WIN32)
find_program(QT_WINDEPLOYQT NAMES windeployqt PATHS "${Qt5_DIR}/../../../bin")
if(NOT QT_WINDEPLOYQT)
message(FATAL_ERROR "Could not find windeployqt")
endif()
install(CODE " install(CODE "
execute_process( execute_process(
COMMAND ${QT_WINDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${launcher_name}.exe\" COMMAND ${QT_WINDEPLOYQT} \"\${CMAKE_INSTALL_PREFIX}/${launcher_name}.exe\"
@ -67,6 +69,8 @@ install(CODE "
--no-translations --no-translations
) )
") ")
endif()
qt5_create_translation(QM_FILES ${launcher_src} ${launcher_forms} ${launcher_ts} OPTIONS -I ${CMAKE_SOURCE_DIR}/launcher/include) qt5_create_translation(QM_FILES ${launcher_src} ${launcher_forms} ${launcher_ts} OPTIONS -I ${CMAKE_SOURCE_DIR}/launcher/include)