2020-10-07 10:36:04 +00:00
|
|
|
if(APPLE OR (WIN32 AND NOT STATIC))
|
|
|
|
add_custom_target(deploy)
|
|
|
|
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
|
|
|
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
|
|
|
|
|
|
|
if(APPLE AND NOT IOS)
|
|
|
|
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
|
|
|
|
add_custom_command(TARGET deploy
|
|
|
|
POST_BUILD
|
2022-05-01 23:19:12 +00:00
|
|
|
COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$<TARGET_FILE_DIR:wowlet>/../.." -always-overwrite -qmldir="${CMAKE_SOURCE_DIR}"
|
2020-10-07 10:36:04 +00:00
|
|
|
COMMENT "Running macdeployqt..."
|
|
|
|
)
|
|
|
|
|
|
|
|
# workaround for a Qt bug that requires manually adding libqsvg.dylib to bundle
|
|
|
|
find_file(_qt_svg_dylib "libqsvg.dylib" PATHS "${CMAKE_PREFIX_PATH}/plugins/imageformats" NO_DEFAULT_PATH)
|
|
|
|
if(_qt_svg_dylib)
|
|
|
|
add_custom_command(TARGET deploy
|
|
|
|
POST_BUILD
|
2021-02-22 06:51:09 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${_qt_svg_dylib} $<TARGET_FILE_DIR:wowlet>/../PlugIns/imageformats/
|
2022-05-01 23:19:12 +00:00
|
|
|
COMMENT "Copying libqsvg.dylib"
|
2020-10-07 10:36:04 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
2022-05-01 23:19:12 +00:00
|
|
|
endif()
|