From 47d1726f926c3f22ffec403858410cfdd59b83e6 Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Fri, 26 Apr 2019 13:38:49 +0300 Subject: [PATCH] [screenshots] Build standalone desktop app with fixed Qt dependencies. --- qt/CMakeLists.txt | 10 +++++++++- tools/unix/build_omim.sh | 22 +++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt index 04122aef9c..adf97d9a46 100644 --- a/qt/CMakeLists.txt +++ b/qt/CMakeLists.txt @@ -289,7 +289,7 @@ if (BUILD_DESIGNER) foreach(BUNDLE ${BUNDLE_FOLDER} ${BUNDLES}) execute_process( COMMAND \"${QT_PATH}/bin/macdeployqt\" \"\${BUNDLE}\" - COMMAND python \"${OMIM_ROOT}/tools/macdeployqtfix/macdeployqtfix.py\" -q -nl \"\${BUNDLE}\" \"${QT_PATH}\" + COMMAND find \"\${BUNDLE}/Contents/MacOS\" -type f -exec python \"${OMIM_ROOT}/tools/macdeployqtfix/macdeployqtfix.py\" -q -nl {} \"${QT_PATH}\" \\; ) endforeach() foreach(BUNDLE ${BUNDLES}) @@ -305,6 +305,14 @@ if (BUILD_DESIGNER) set(CPACK_DMG_VOLUME_NAME ${BUNDLE_NAME}) set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/res/designer.icns) include(CPack) +elseif (BUILD_STANDALONE) + add_custom_command(TARGET desktop POST_BUILD + COMMAND "${QT_PATH}/bin/macdeployqt" ${BUNDLE_FOLDER} + COMMAND python "${OMIM_ROOT}/tools/macdeployqtfix/macdeployqtfix.py" -q -nl ${BUNDLE_FOLDER}/Contents/MacOS/${BUNDLE_NAME} ${QT_PATH} + COMMAND echo "Fixing Qt dependencies finished." + VERBATIM + COMMENT "Fixing Qt dependencies for standalone desktop app" + ) endif() add_subdirectory(qt_common) diff --git a/tools/unix/build_omim.sh b/tools/unix/build_omim.sh index d62a05365b..c50f6ddacf 100755 --- a/tools/unix/build_omim.sh +++ b/tools/unix/build_omim.sh @@ -9,8 +9,9 @@ OPT_DESIGNER= OPT_GCC= OPT_TARGET= OPT_PATH= +OPT_STANDALONE= -while getopts ":cdrsgtp:" opt; do +while getopts ":cdrstagp:" opt; do case $opt in d) OPT_DEBUG=1 @@ -28,6 +29,9 @@ while getopts ":cdrsgtp:" opt; do t) OPT_DESIGNER=1 ;; + a) + OPT_STANDALONE=1 + ;; g) OPT_GCC=1 ;; @@ -36,13 +40,14 @@ while getopts ":cdrsgtp:" opt; do ;; *) echo "This tool builds omim" - echo "Usage: $0 [-d] [-r] [-c] [-s] [-t] [-g] [-p PATH] [target1 target2 ...]" + echo "Usage: $0 [-d] [-r] [-c] [-s] [-t] [-a] [-g] [-p PATH] [target1 target2 ...]" echo echo -e "-d\tBuild omim-debug" echo -e "-r\tBuild omim-release" echo -e "-c\tClean before building" echo -e "-s\tSkip desktop app building" echo -e "-t\tBuild designer tool (only for MacOS X platform)" + echo -e "-a\tBuild standalone desktop app (only for MacOS X platform)" echo -e "-g\tForce use GCC (only for MacOS X platform)" echo -e "-p\tDirectory for built binaries" echo "By default both configurations is built." @@ -55,6 +60,10 @@ done echo "Can't skip desktop and build designer tool simultaneously" && exit 2 +[ -n "$OPT_STANDALONE" -a -n "$OPT_SKIP_DESKTOP" ] && +echo "Can't skip desktop and build standalone desktop app simultaneously" && +exit 2 + OPT_TARGET=${@:$OPTIND} # By default build everything @@ -96,6 +105,8 @@ if [ "$(uname -s)" == "Darwin" ]; then else [ -n "$OPT_DESIGNER" ] \ && echo "Designer tool supported only on MacOS X platform" && exit 2 + [ -n "$OPT_STANDALONE" ] \ + && echo "Standalone desktop app supported only on MacOS X platform" && exit 2 PROCESSES=$(nproc) fi @@ -115,7 +126,12 @@ build() cd "$DIRNAME" TMP_FILE="build_error.log" if [ -z "$OPT_DESIGNER" ]; then - "$CMAKE" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" ${CMAKE_CONFIG:-} + if [ -n "$OPT_STANDALONE" ]; then + "$CMAKE" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" \ + -DBUILD_STANDALONE:bool=True ${CMAKE_CONFIG:-} + else + "$CMAKE" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" ${CMAKE_CONFIG:-} + fi echo "" if ! make $OPT_TARGET -j $PROCESSES 2> "$TMP_FILE"; then echo '--------------------'