# Deskflow -- mouse and keyboard sharing utility # Copyright (C) 2024 - 2025 Chris Rizzitello # Copyright (C) 2024 Symless Ltd. # # This package is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # found in the file LICENSE that should have accompanied this file. # # This package is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . if(APPLE) set(target Deskflow) else() set(target deskflow) endif() #setup our bundle plist file set(BUNDLE_EXECUTABLE_NAME "${target}") set(BUNDLE_BUNDLE_NAME "${target}") set(BUNDLE_DISPLAY_NAME "${target}") set(BUNDLE_GUI_IDENTIFIER "org.deskflow.deskflow") set(BUNDLE_ICON_FILE ${target}.icns) set(BUNDLE_INFO_STRING "${CMAKE_PROJECT_DESCRIPTION}") set(BUNDLE_COPYRIGHT "${CMAKE_PROJECT_COPYRIGHT}") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../res/deskflow.plist.in ${CMAKE_CURRENT_BINARY_DIR}/deskflow.plist @ONLY ) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) if(WIN32) set(EXE_DESCRIPTION "${CMAKE_PROJECT_DESCRIPTION}\\n Control and configure deskflow") set(EXE_ICON "IDI_ICON1 ICON DISCARDABLE \"${CMAKE_SOURCE_DIR}/src/apps/res/deskflow.ico\" ") configure_file(${CMAKE_SOURCE_DIR}/src/apps/res/rc_template.rc.in deskflow.rc) set(platform_extra deskflow.rc) elseif(APPLE) set(platform_extra ../res/Deskflow.icns ${PROJECT_SOURCE_DIR}/LICENSE ${PROJECT_SOURCE_DIR}/LICENSE_EXCEPTION) set_source_files_properties(${platform_extra} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif() add_executable(${target} WIN32 MACOSX_BUNDLE ${platform_extra} ../res/deskflow.qrc Action.cpp Action.h DataDownloader.cpp DataDownloader.h Hotkey.cpp Hotkey.h KeySequence.cpp KeySequence.h main.cpp MainWindow.cpp MainWindow.h MainWindow.ui ProcessorArch.h QUtility.cpp QUtility.h ScreenSetupModel.cpp ScreenSetupModel.h ServerConfig.cpp ServerConfig.h SetupWizard.cpp SetupWizard.h VersionChecker.cpp VersionChecker.h dialogs/AboutDialog.cpp dialogs/AboutDialog.h dialogs/AboutDialog.ui dialogs/ActionDialog.cpp dialogs/ActionDialog.h dialogs/ActionDialog.ui dialogs/AddClientDialog.cpp dialogs/AddClientDialog.h dialogs/AddClientDialog.ui dialogs/HotkeyDialog.cpp dialogs/HotkeyDialog.h dialogs/HotkeyDialog.ui dialogs/ScreenSettingsDialog.cpp dialogs/ScreenSettingsDialog.h dialogs/ScreenSettingsDialog.ui dialogs/ServerConfigDialog.cpp dialogs/ServerConfigDialog.h dialogs/ServerConfigDialog.ui dialogs/SettingsDialog.cpp dialogs/SettingsDialog.h dialogs/SettingsDialog.ui widgets/ClientStateLabel.cpp widgets/ClientStateLabel.h widgets/KeySequenceWidget.cpp widgets/KeySequenceWidget.h widgets/ScreenSetupView.cpp widgets/ScreenSetupView.h widgets/ServerStateLabel.cpp widgets/ServerStateLabel.h widgets/TrashScreenWidget.cpp widgets/TrashScreenWidget.h ) target_link_libraries( ${target} gui Qt6::Core Qt6::Widgets Qt6::Network) if(WIN32) set_target_properties(${target} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") install( TARGETS ${target} RUNTIME_DEPENDENCY_SET guiDeps DESTINATION . ) install(RUNTIME_DEPENDENCY_SET guiDeps PRE_EXCLUDE_REGEXES "api-ms-win-.*" "ext-ms-.*" "^hvsifiletrust\\.dll$" POST_EXCLUDE_REGEXES ".*system32.*" RUNTIME DESTINATION . ) add_custom_command( TARGET ${target} POST_BUILD COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network $ ) elseif(APPLE) set_target_properties(${target} PROPERTIES INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/deskflow.plist" ) install(TARGETS ${target} BUNDLE DESTINATION .) else() install(TARGETS ${target} DESTINATION bin) endif()