diff --git a/.gitignore b/.gitignore index 3ea4ec2..2d40faf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ build/ deploy/ setup/ -app/ +tmp/ _CPack_Packages/ *.app diff --git a/CMakeLists.txt b/CMakeLists.txt index c9293d7..c35a234 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ elseif (UNIX) endif() # Set USE_CPACK option. -set(USE_CPACK OFF) +set(USE_CPACK ON) # Install the application for the target platform. if (WIN32) diff --git a/cmake/installUbuntu.cmake b/cmake/installUbuntu.cmake index ef2dce5..7341384 100644 --- a/cmake/installUbuntu.cmake +++ b/cmake/installUbuntu.cmake @@ -5,8 +5,44 @@ else() set(CMAKE_INSTALL_PREFIX "" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) endif() -# Install RUNTIME targets and dependencies. -install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME_DEPENDENCIES DESTINATION "${CMAKE_INSTALL_PREFIX}/opt/${CMAKE_PROJECT_NAME}/bin/" ) +# Install target RUNTIME. +install(TARGETS ${CMAKE_PROJECT_NAME} RUNTIME_DEPENDENCY_SET RunTimeDependencySet RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/opt/${CMAKE_PROJECT_NAME}/bin/" ) + +# Install target RUNTIME dependencies. +install(RUNTIME_DEPENDENCY_SET RunTimeDependencySet DESTINATION "${CMAKE_INSTALL_PREFIX}/opt/${CMAKE_PROJECT_NAME}/lib/") + +# Get Qt6 lib directory. +get_target_property(Qt6_LIB_DIR Qt6::Core LOCATION) +get_filename_component(Qt6_LIB_DIR ${Qt6_LIB_DIR} DIRECTORY) + +# Install Qt6 missing libraries. +file(GLOB LIBWAYLAND "${Qt6_LIB_DIR}/libQt6Wayland*") +install(FILES ${LIBWAYLAND} DESTINATION "${CMAKE_INSTALL_PREFIX}/opt/${CMAKE_PROJECT_NAME}/lib/") +file(GLOB LIBXCB_FILES "${Qt6_LIB_DIR}/libQt6Xcb*") +install(FILES ${LIBXCB} DESTINATION "${CMAKE_INSTALL_PREFIX}/opt/${CMAKE_PROJECT_NAME}/lib/") + +# Get Qt6 plugins directory. +set(Qt6_PLUGINS_DIR "${Qt6_LIB_DIR}/../plugins") + +# Install the Qt6 plugins. +LIST(APPEND Qt6_PLUGINS_LIST + "xcbglintegrations" + "wayland-shell-integration" + "wayland-graphics-integration-client" + "wayland-decoration-client" + "tls" + "networkinformation" + "imageformats" + "iconengines" + "generic" + "platforms" +) +foreach(PLUGIN ${Qt6_PLUGINS_LIST}) + install(DIRECTORY "${Qt6_PLUGINS_DIR}/${PLUGIN}" + DESTINATION "${CMAKE_INSTALL_PREFIX}/opt/${CMAKE_PROJECT_NAME}/plugins" + USE_SOURCE_PERMISSIONS + PATTERN "*.debug" EXCLUDE) +endforeach() # Install app script file # Cope app script file directly to usr/local/bin sometimes run into permission issues, diff --git a/package/ubuntu/app.sh b/package/ubuntu/app.sh index 4488fc8..5d2390d 100644 --- a/package/ubuntu/app.sh +++ b/package/ubuntu/app.sh @@ -3,9 +3,13 @@ appname="visParaflow" # Set LD_LIBRARY_PATH. -LD_LIBRARY_PATH=/opt/$appname/bin +LD_LIBRARY_PATH=/opt/$appname/lib export LD_LIBRARY_PATH +# Set QT_PLUGIN_PATH. +QT_PLUGIN_PATH=/opt/$appname/plugins +export QT_PLUGIN_PATH + # Set QT_QPA_PLATFORM to xcb or wayland. export QT_QPA_PLATFORM=wayland diff --git a/package/ubuntu/make-app.sh b/package/ubuntu/make-app.sh index c821ab7..1771660 100755 --- a/package/ubuntu/make-app.sh +++ b/package/ubuntu/make-app.sh @@ -18,32 +18,34 @@ fi setupdir="../../setup/ubuntu" mkdir -p $setupdir -# Define the staging package directory -pkgdir="app" +# Define the staging directory +tmpdir="app" -# Delete the old staging package directory. -rm -rf $pkgdir -echo "The old staging package directory has been deleted." +# Delete the old staging directory. +rm -rf $tmpdir +echo "The old staging directory has been deleted." # Create the destination directory -mkdir -p $pkgdir/DEBIAN -mkdir -p $pkgdir/opt/$appname/bin -mkdir -p $pkgdir/usr/share/applications -mkdir -p $pkgdir/usr/share/icons/hicolor/48x48/apps -echo "The staging package directories have been created." +mkdir -p $tmpdir/DEBIAN +mkdir -p $tmpdir/opt/$appname/bin +mkdir -p $tmpdir/opt/$appname/lib +mkdir -p $tmpdir/opt/$appname/plugins +mkdir -p $tmpdir/usr/share/applications +mkdir -p $tmpdir/usr/share/icons/hicolor/48x48/apps +echo "The staging direcotry has been created." # Copy the DEBIAN control files. -cp -r debian/* $pkgdir/DEBIAN/ -echo "The DEBIAN control files have been copied to the staging package directory." +cp -r debian/* $tmpdir/DEBIAN/ +echo "The DEBIAN control files have been copied to the staging directory." # Copy the deployed files. -cp -r $depdir/* $pkgdir/ -echo "The deployed files have been copied to the staging package directory." +cp -r $depdir/* $tmpdir/ +echo "The deployed files have been copied to the staging directory." # Create the DEBIAN package. -dpkg-deb --build $pkgdir $setupdir/$appname-$verison.deb +dpkg-deb --build $tmpdir $setupdir/$appname-$verison.deb echo "The DEBIAN package has been created." -# Delete the staging package directory. -rm -rf $pkgdir -echo "The staging package directory has been deleted." +# Delete the staging directory. +rm -rf $tmpdir +echo "The staging directory has been deleted."