Skip to content

Commit

Permalink
Merge pull request #1442 from Itay-Lifshitz/cmakebuild
Browse files Browse the repository at this point in the history
Bugfix on AppImage.
  • Loading branch information
mcallegari committed Jul 29, 2023
2 parents 0d125fc + 4d785d9 commit 1df3d3d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
11 changes: 6 additions & 5 deletions create-appimage-cmake.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
#
# Script to create a self contained AppImage
# Script to create a self contained AppImage using CMake
# Requires wget and chrpath
# Export QTDIR before running this, like:
# export QTDIR=/home/user/Qt5.9.4/5.9.4/gcc_64
# If you want to use the official Qt packages, please export QTDIR before running this, like:
# export QTDIR=/home/user/Qt/5.15.2/gcc_64
# Or you can use the system Qt libraries instead by not specifying QTDIR.

# Exit on error
set -e
Expand All @@ -26,7 +27,7 @@ else
cmake -DCMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/cmake/Qt5" -Dqmlui=ON -Dappimage=ON -DINSTALL_ROOT=$TARGET_DIR ..
fi

NUM_CPUS=`nproc` || true
NUM_CPUS=$(nproc) || true
if [ -z "$NUM_CPUS" ]; then
NUM_CPUS=8
fi
Expand All @@ -41,7 +42,7 @@ make install

strip $TARGET_DIR/usr/bin/qlcplus-qml
# see variables.pri, where to find the LIBSDIR
find $TARGET_DIR/usr/lib/ -name libqlcplusengine.so.1.0.0 -exec strip -v {} \;
find $TARGET_DIR/usr/lib/ -name 'libqlcplusengine.so*' -exec strip -v {} \;

# FIXME: no rpath or runpath tag found.
chrpath -r "../lib" $TARGET_DIR/usr/bin/qlcplus-qml || true
Expand Down
2 changes: 1 addition & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project(engine)
project(engine VERSION 1.0.0)

pkg_check_modules(FFTW3 IMPORTED_TARGET fftw3)

Expand Down
26 changes: 21 additions & 5 deletions platforms/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ endif()
# install(FILES ../Sample.qxw DESTINATION ${INSTALLROOT}/${DATADIR})

if(appimage)
get_filename_component(QT_LIBS_PATH ${QT_DIR}/../../../lib ABSOLUTE)
get_filename_component(QT_PLUGINS_PATH ${QT_LIBS_PATH}/../plugins ABSOLUTE)
get_filename_component(QT_QML_PATH ${QT_LIBS_PATH}/../qml ABSOLUTE)
if (QT_DIR STREQUAL "/usr/lib/x86_64-linux-gnu/cmake/Qt5")
set(QT_LIBS_PATH "/usr/lib/x86_64-linux-gnu")
set(QT_PLUGINS_PATH "/usr/lib/x86_64-linux-gnu/qt5/plugins")
set(QT_QML_PATH "/usr/lib/x86_64-linux-gnu/qt5/qml")
else()
get_filename_component(QT_LIBS_PATH ${QT_DIR}/../../../lib ABSOLUTE)
get_filename_component(QT_PLUGINS_PATH ${QT_LIBS_PATH}/../plugins ABSOLUTE)
get_filename_component(QT_QML_PATH ${QT_LIBS_PATH}/../qml ABSOLUTE)
endif()
message("QT_LIBS_PATH ${QT_LIBS_PATH}")
message("QT_PLUGINS_PATH ${QT_PLUGINS_PATH}")
message("QT_QML_PATH ${QT_QML_PATH}")
# Qt dependencies
file(GLOB qtdeps_FILES "${QT_LIBS_PATH}//libicu*")
file(GLOB qtdeps_FILES "${QT_LIBS_PATH}/libicu*")
install(
FILES ${qtdeps_FILES}
DESTINATION ${INSTALLROOT}/${LIBSDIR}
Expand Down Expand Up @@ -82,7 +91,14 @@ if(appimage)
${QT_LIBS_PATH}/libQt5Gamepad.so.5
${QT_LIBS_PATH}/libQt5PrintSupport.so.5)
endif()
install(FILES ${qtlibs_FILES} DESTINATION ${INSTALLROOT}/${LIBSDIR})

set(_resolved_qtlibs_FILES "")
foreach (_file ${qtlibs_FILES})
file(GLOB _files "${_file}*")
list(FILTER _files EXCLUDE REGEX ".debug")
list (APPEND _resolved_qtlibs_FILES "${_files}")
endforeach()
install(FILES ${_resolved_qtlibs_FILES} DESTINATION ${INSTALLROOT}/${LIBSDIR})

# Qt plugins
install(
Expand Down
6 changes: 3 additions & 3 deletions platforms/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ set(qtdeps_files
"${SYS_LIBS_PATH}/libintl-8.dll"
"${SYS_LIBS_PATH}/libpcre2-8-0.dll"
"${SYS_LIBS_PATH}/libpcre2-16-0.dll"
# "${SYS_LIBS_PATH}/libpcre-1.dll"
"${SYS_LIBS_PATH}/libpcre-1.dll"
"${SYS_LIBS_PATH}/libpng16-16.dll"
"${SYS_LIBS_PATH}/libjpeg-8.dll"
# "${SYS_LIBS_PATH}/libspeex-1.dll"
"${SYS_LIBS_PATH}/libspeex-1.dll"
"${SYS_LIBS_PATH}/libzstd.dll"
"${SYS_LIBS_PATH}/libbrotlidec.dll"
"${SYS_LIBS_PATH}/libbrotlicommon.dll"
Expand All @@ -49,7 +49,7 @@ set(qtdeps_files
if(Qt5_MAJOR_VERSION GREATER 5)
list(APPEND qtdeps_files "${SYS_LIBS_PATH}/libb2-1.dll")
endif()
install(FILES ${qtdeps_files} DESTINATION ${qtdeps_path})
install(FILES ${qtdeps_files} OPTIONAL DESTINATION ${qtdeps_path})

set(qtlibs_path "${INSTALLROOT}/${LIBSDIR}")
set(qtlibs_files
Expand Down
2 changes: 1 addition & 1 deletion qmake2cmake.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Qt will be installed in the `Qt` directory in the user `home` directory i.e. `~/
If you want to use the Debian Qt packages instead of the official Qt packages, you will need to install it by running the following command in Ubuntu.

```bash
sudo apt install -y qtcreator qtbase5-dev qt5-qmake
sudo apt install -y qtcreator qtbase5-dev qt5-qmake qt3d5-dev qtdeclarative5-dev qttools5-dev qt3d-defaultgeometryloader-plugin qml-module-qt3d qml-module-qtmultimedia
```

for installing Qt5 packages or
Expand Down

0 comments on commit 1df3d3d

Please sign in to comment.