Skip to content

Commit

Permalink
Merge pull request #4 from cielavenir/macOSPackaging
Browse files Browse the repository at this point in the history
update macOS packaging
  • Loading branch information
thayakawa-gh committed Aug 20, 2022
2 parents db529c0 + 416417c commit 3f758ae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 13 additions & 1 deletion SlackLogViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE QT_NO_KEYWORDS)
target_link_libraries(
${PROJECT_NAME}
PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Concurrent Qt5::Network Qt5::WebEngineWidgets QuaZip::QuaZip)


if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_libraries(
${PROJECT_NAME}
PRIVATE -static-libstdc++ -static-libgcc)
endif()

install(TARGETS ${PROJECT_NAME}
EXPORT ${MY_PACKAGE_NAME}Targets
BUNDLE DESTINATION ./
Expand Down Expand Up @@ -89,6 +95,12 @@ endif()

deploy_qt(${PROJECT_NAME})

if(APPLE)
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND plutil -replace NSHighResolutionCapable -bool true ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents/Info.plist)
endif()

string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)

#copy quazip dll
Expand Down
6 changes: 6 additions & 0 deletions SlackLogViewer/DeployQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if(WIN32)
--$<IF:$<CONFIG:Debug>,debug,release> --qmldir ${CMAKE_SOURCE_DIR}
--no-quick-import --no-translations --no-system-d3d-compiler --no-compiler-runtime
--no-webkit2 --no-angle --no-opengl-sw)")
elseif(APPLE)
find_program(DEPLOYQT NAMES macdeployqt HINTS "${_qt_bin_path}")
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${DEPLOYQT} ${CMAKE_BINARY_DIR}/${PROJ_NAME}.app $<IF:$<CONFIG:Debug>,-use-debug-lib,>)
install(CODE "execute_process(COMMAND ${DEPLOYQT} ${CMAKE_BINARY_DIR}/${PROJ_NAME}.app $<IF:$<CONFIG:Debug>,-use-debug-lib,>")
endif()


Expand Down

0 comments on commit 3f758ae

Please sign in to comment.