From 20948522ea142dae6faaba3bf3593d1eaa444c37 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Tue, 7 Mar 2017 14:10:24 +0000 Subject: [PATCH] Install macOS binaries in to bundle --- CMakeLists.txt | 12 +++++++----- src/cmd/synergyc/CMakeLists.txt | 10 ++-------- src/cmd/synergys/CMakeLists.txt | 11 +++-------- src/cmd/syntool/CMakeLists.txt | 10 ++-------- src/gui/CMakeLists.txt | 4 ++++ 5 files changed, 18 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de66b653..ad84b8df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -371,17 +371,19 @@ macro(configure_files srcDir destDir) message (STATUS "Configuring file ${templateFile}") configure_file (${sourceTemplateFilePath} ${destDir}/${templateFile} @ONLY) endforeach (templateFile) - endmacro (configure_files) if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - configure_files (${CMAKE_CURRENT_SOURCE_DIR}/dist/macos/bundle ${CMAKE_BINARY_DIR}/bundle) - include (BundleUtilities) - verify_app (${CMAKE_BINARY_DIR}/bundle/Synergy.app) + set (SYNERGY_BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dist/macos/bundle) + set (SYNERGY_BUNDLE_DIR ${CMAKE_BINARY_DIR}/bundle) + set (SYNERGY_BUNDLE_APP_DIR ${SYNERGY_BUNDLE_DIR}/Synergy.app) + set (SYNERGY_BUNDLE_BINARY_DIR ${SYNERGY_BUNDLE_APP_DIR}/Contents/MacOS) + + configure_files (${SYNERGY_BUNDLE_SOURCE_DIR} ${SYNERGY_BUNDLE_DIR}) elseif(WIN32 AND NOT UNIX) configure_files (${CMAKE_CURRENT_SOURCE_DIR}/dist/wix ${CMAKE_BINARY_DIR}/installer) endif() option(SYNERGY_BUILD_LEGACY_SERVICE "Build the legacy service (synergyd)" ON) - add_subdirectory(src) + diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt index bc0a1063..0cff7a9d 100644 --- a/src/cmd/synergyc/CMakeLists.txt +++ b/src/cmd/synergyc/CMakeLists.txt @@ -60,12 +60,6 @@ add_executable(synergyc ${sources}) target_link_libraries(synergyc arch base client common io mt net ipc platform server synlib ${libs} ${OPENSSL_LIBS}) -if (WIN32) -else () - if (CONF_CPACK) - install(TARGETS - synergyc - COMPONENT core - DESTINATION bin) - endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install (TARGETS synergyc DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) endif() diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt index 099c721a..3acd59bc 100644 --- a/src/cmd/synergys/CMakeLists.txt +++ b/src/cmd/synergys/CMakeLists.txt @@ -60,12 +60,7 @@ add_executable(synergys ${sources}) target_link_libraries(synergys arch base client common io mt net ipc platform server synlib ${libs} ${OPENSSL_LIBS}) -if (WIN32) -else () - if (CONF_CPACK) - install(TARGETS - synergys - COMPONENT core - DESTINATION bin) - endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install (TARGETS synergys DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) endif() + diff --git a/src/cmd/syntool/CMakeLists.txt b/src/cmd/syntool/CMakeLists.txt index 48afb365..9eadc29b 100644 --- a/src/cmd/syntool/CMakeLists.txt +++ b/src/cmd/syntool/CMakeLists.txt @@ -31,12 +31,6 @@ add_executable(syntool ${sources}) target_link_libraries(syntool synlib arch base client common io ipc mt net platform server ${libs} ${OPENSSL_LIBS}) -if (WIN32) -else () - if (CONF_CPACK) - install(TARGETS - syntool - COMPONENT core - DESTINATION bin) - endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install (TARGETS syntool DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 310be005..c1755ae8 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -38,3 +38,7 @@ if (WIN32) target_link_libraries (synergy ${DNSSD_LIB}) set_target_properties (synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") endif() + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install (TARGETS synergy DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) +endif()