xT: figure out basic packaging
This commit is contained in:
parent
509cb9f4dd
commit
ed5ac1815b
2
liberty
2
liberty
@ -1 +1 @@
|
|||||||
Subproject commit 32cbb152660566042ac25b00de4b19b1c90c0f5c
|
Subproject commit 1930f138d4836f8ed9613a17bfe09dc53441618a
|
@ -47,6 +47,11 @@ foreach (icon xT xT-highlighted)
|
|||||||
list (APPEND icon_rsrc_list "${icon_png}")
|
list (APPEND icon_rsrc_list "${icon_png}")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set (MACOSX_BUNDLE_ICON_FILE xT.icns)
|
||||||
|
icon_to_icns ("${PROJECT_SOURCE_DIR}/xT.svg"
|
||||||
|
"${MACOSX_BUNDLE_ICON_FILE}" icon_icns)
|
||||||
|
else ()
|
||||||
# The largest size is mainly for an appropriately sized Windows icon
|
# The largest size is mainly for an appropriately sized Windows icon
|
||||||
set (icon_base "${PROJECT_BINARY_DIR}/icons")
|
set (icon_base "${PROJECT_BINARY_DIR}/icons")
|
||||||
set (icon_png_list)
|
set (icon_png_list)
|
||||||
@ -69,6 +74,7 @@ if (WIN32)
|
|||||||
set_property (SOURCE "${resource_file}"
|
set_property (SOURCE "${resource_file}"
|
||||||
APPEND PROPERTY OBJECT_DEPENDS ${icon_ico})
|
APPEND PROPERTY OBJECT_DEPENDS ${icon_ico})
|
||||||
endif ()
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Build the main executable and link it
|
# Build the main executable and link it
|
||||||
find_program (awk_EXECUTABLE awk ${find_program_REQUIRE})
|
find_program (awk_EXECUTABLE awk ${find_program_REQUIRE})
|
||||||
@ -86,14 +92,51 @@ add_custom_command (OUTPUT xC-proto.cpp
|
|||||||
add_custom_target (xC-proto DEPENDS ${PROJECT_BINARY_DIR}/xC-proto.cpp)
|
add_custom_target (xC-proto DEPENDS ${PROJECT_BINARY_DIR}/xC-proto.cpp)
|
||||||
|
|
||||||
list (APPEND project_sources "${root}/liberty/tools/lxdrgen-cpp-qt.cpp")
|
list (APPEND project_sources "${root}/liberty/tools/lxdrgen-cpp-qt.cpp")
|
||||||
qt_add_executable (xT xT.cpp ${project_config} ${project_sources})
|
qt_add_executable (xT
|
||||||
|
xT.cpp ${project_config} ${project_sources} "${icon_icns}")
|
||||||
add_dependencies (xT xC-proto)
|
add_dependencies (xT xC-proto)
|
||||||
qt_add_resources (xT "rsrc" PREFIX / FILES "${beep}" ${icon_rsrc_list})
|
qt_add_resources (xT "rsrc" PREFIX / FILES "${beep}" ${icon_rsrc_list})
|
||||||
target_link_libraries (xT PRIVATE Qt6::Widgets Qt6::Network Qt6::Multimedia)
|
target_link_libraries (xT PRIVATE Qt6::Widgets Qt6::Network Qt6::Multimedia)
|
||||||
set_target_properties (xT PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON)
|
set_target_properties (xT PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER name.janouch.xT)
|
||||||
|
|
||||||
# At least with MinGW, this is a fully independent portable executable
|
# https://stackoverflow.com/questions/79079161 and resolved in Qt Creator 16.
|
||||||
# TODO(p): Figure this out once it builds.
|
set (QT_QML_GENERATE_QMLLS_INI ON)
|
||||||
|
|
||||||
|
# The files to be installed
|
||||||
|
include (GNUInstallDirs)
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
install (TARGETS xT DESTINATION .)
|
install (TARGETS xT DESTINATION .)
|
||||||
set (CPACK_GENERATOR ZIP)
|
elseif (APPLE OR WIN32)
|
||||||
|
# TODO(p): Consider whether or not to use MSYS2.
|
||||||
|
install (TARGETS xT DESTINATION .)
|
||||||
|
# XXX: QTBUG-127075, which can be circumvented by manually running
|
||||||
|
# macdeployqt on xT.app before the install.
|
||||||
|
qt_generate_deploy_app_script (TARGET xT OUTPUT_SCRIPT deploy_xT)
|
||||||
|
install (SCRIPT "${deploy_xT}")
|
||||||
|
else ()
|
||||||
|
install (TARGETS xT DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
install (FILES ../LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||||
|
|
||||||
|
install (FILES xT.svg
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps)
|
||||||
|
install (DIRECTORY ${icon_base}
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATADIR})
|
||||||
|
install (FILES xT.desktop
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# CPack
|
||||||
|
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
|
||||||
|
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
|
||||||
|
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/../LICENSE")
|
||||||
|
set (CPACK_GENERATOR "TGZ;ZIP")
|
||||||
|
set (CPACK_PACKAGE_FILE_NAME
|
||||||
|
"${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||||
|
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
|
||||||
|
set (CPACK_SOURCE_IGNORE_FILES "/build;/CMakeLists.txt.user")
|
||||||
|
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||||
|
|
||||||
include (CPack)
|
include (CPack)
|
||||||
|
Loading…
Reference in New Issue
Block a user