Fix macdeployqt.

This is based off of the instructions found here: https://riptutorial.com/qt/example/24133/integrating-with-cmake
This commit is contained in:
C.W. Betts 2022-03-17 21:21:31 -06:00 committed by Megamouse
parent ff34a73fbd
commit 39201e5042

View File

@ -132,6 +132,10 @@ if(USE_PRECOMPILED_HEADERS)
endif()
endif()
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
# Copy icons to executable directory
if(APPLE)
add_custom_command(TARGET rpcs3 POST_BUILD
@ -143,7 +147,7 @@ if(APPLE)
${CMAKE_SOURCE_DIR}/bin/GuiConfigs $<TARGET_FILE_DIR:rpcs3>/../Resources/GuiConfigs
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/bin/git $<TARGET_FILE_DIR:rpcs3>/../Resources/git
COMMAND "${Qt5_DIR}/../../../bin/macdeployqt" "${PROJECT_BINARY_DIR}/bin/rpcs3.app")
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "${PROJECT_BINARY_DIR}/bin/rpcs3.app")
elseif(UNIX)
add_custom_command(TARGET rpcs3 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory