From: Michael Schuster Date: Sat, 6 Jun 2020 17:53:48 +0000 (+0200) Subject: macOS: Build nextcloudcmd after gui and run macdeployqt with the -executable option X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~176^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e6389959ce2d94525cedcb093a37f11c0e524cb0;p=nextcloud-desktop.git macOS: Build nextcloudcmd after gui and run macdeployqt with the -executable option - src/CMakeLists.txt: Switch build order to build cmd before gui - src/gui/CMakeLists.txt: Use the -executable option for a combined run of macdeployqt Signed-off-by: Michael Schuster --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cb83e784a..c74c66535 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,8 +51,8 @@ set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/theme CACHE STRING "" FORCE) add_subdirectory(csync) add_subdirectory(libsync) if (NOT BUILD_LIBRARIES_ONLY) - add_subdirectory(gui) add_subdirectory(cmd) + add_subdirectory(gui) if (WITH_CRASHREPORTER) add_subdirectory(3rdparty/libcrashreporter-qt) diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index e0655d0c1..abb36205f 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -32,6 +32,7 @@ if(NOT BUILD_LIBRARIES_ONLY) target_include_directories(${cmd_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer) endif() +# OSX: Copy nextcloudcmd to app bundle, src/gui will run macdeployqt if(BUILD_OWNCLOUD_OSX_BUNDLE) add_custom_command(TARGET ${cmd_NAME} POST_BUILD COMMAND "cp" diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index ed17270cb..cb8738581 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -388,16 +388,21 @@ install(TARGETS ${APPLICATION_EXECUTABLE} #FIXME: find a nice solution to make the second if(BUILD_OWNCLOUD_OSX_BUNDLE) unnecessary # currently it needs to be done because the code right above needs to be executed no matter # if building a bundle or not and the install_qt4_executable needs to be called afterwards +# +# OSX: Run macdeployqt for src/gui and for src/cmd using the -executable option if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY) get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY) find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}") + set(cmd_NAME ${APPLICATION_EXECUTABLE}cmd) + add_custom_command(TARGET ${APPLICATION_EXECUTABLE} POST_BUILD COMMAND "${MACDEPLOYQT_EXECUTABLE}" "$/../.." -qmldir=${CMAKE_SOURCE_DIR}/src/gui -always-overwrite + -executable="$/${cmd_NAME}" COMMENT "Running macdeployqt..." ) endif()