From c41e3d8e7ae657a30a9c16894778f0e54351f7cb Mon Sep 17 00:00:00 2001 From: xiphon Date: Thu, 10 Sep 2020 10:37:06 +0000 Subject: [PATCH] cmake: cross-compilation to Windows - find MinGW prefixed windres --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0eeb4e43..279f73ae 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -79,7 +79,8 @@ if(MINGW) set(ICON_RC ${CMAKE_CURRENT_BINARY_DIR}/icon.rc) set(ICON_RES ${CMAKE_CURRENT_BINARY_DIR}/icon.o) file(WRITE ${ICON_RC} "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"") - add_custom_command(OUTPUT ${ICON_RES} COMMAND windres ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC}) + find_program(Qt5_WINDRES_EXECUTABLE NAMES windres x86_64-w64-mingw32-windres REQUIRED CMAKE_FIND_ROOT_PATH_BOTH) + add_custom_command(OUTPUT ${ICON_RES} COMMAND ${Qt5_WINDRES_EXECUTABLE} ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC}) list(APPEND RESOURCES ${ICON_RES}) endif()