From c8d9707857b6a648d7cb94e85dfa44d219640857 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Tue, 2 Jul 2024 11:23:56 +0100 Subject: [PATCH] Re-implement packaging for GitHub workflows (Linux) (#7361) * Reorganize CMake Packaging module * Match if statements to function order * Cleanup root, res, and doc dirs * Move deps to requirements.txt file * Reorganize and format CMake files * Rename changelog lint * Add reccomended extension * Workflow to lint CMake files * Move CMake lint to script * Try lighter dep * Use venv * Add --format arg * Format all CMake files * Convert bash script to Python * Set CMake line ending format * Restore formatting * Add pyyaml dep * Remove unused arg * Rename config file * Remove comment * Repair copyrights (broken by defualt cmake-format) * Restore 3rd party copyright * Break up libs config into smaller macros * Better macro name * Load config after venv * Make intentional noop clearer * Only use upload step if required (make skip clearer) * Use CPack for deb and rpm packaging * Add upload step for Linux * Remove cpack dep, doesn't exist * Roll back presets version * Fixed distro like match * Update ChangeLog * Legacy checkout for some distros * All distros support v4 * Trying out newer Linux distros * Install Git on Docker images * Install without actions (not available before checkout) * Delete useless action * Install Python * Support for Arch and OpenSUSE * Add Arch and OpenSUSE to deps * Name steps * Full OpenSUSE names * Mark Git dir safe * Add pkgconf * Legacy CMake for Debian 11 * Add OpenSSL to OpenSUSE * Drop OpenSUSE Leap (no C++20 support) * Skip packaging for Arch and OpenSUSE (for now) * Shorten Arch/OpenSUSE names * Clearer step name * SImpler bootstrap * Shell not needed * Update apt * Don't check return code * Simplify python deps commands * Add STGZ/.sh package type * Prevent input prompt * Only config git safe dir when needed * Try cache v4 * Safe dir for Ubuntu * Safe dir for Arch * All Docker images seem to need safe dir config * Refactor env var getters * Make Ubuntu build extra packages * Condense bootstep to single step * Fixed var name * Fixed bootstrap logic * Simplify logic for upload condition (Windows and macOS) * Make package/upload condition easier to understand * Add Manjaro * Generic names for Linux .tar.gz and .sh packages * Add Manjaro deps * Swap macOS matrix entries * Add Red Hat UBI * Remove RHEL subscription manager * Throw on unsupported package distro * Conditionally install pip and venv * Remove extra pip arg * Add config for RHEL * Install EPEL for RHEL * Back-out RHEL as EPEL requires subscription * Restore Python deps logic * Fixed bug: Packacking run twice * Testing arm32v7 and arm64v8 * Revert "Testing arm32v7 and arm64v8" This reverts commit cb3caf188d2b79ed083a62fc091de295f9889f3d. * Re-add icon and shortcut file for Linux to package * Support OpenSUSE RPM build * Check return code * Add `rpm-build` for OpenSUSE * Reorg packages * Remove busybox-which * Add --non-interactive * Move --non-interactive to correct position * Experiment with makepkg * Check and print package commands * Make distro version optional * Use 8 cores to build * Default to distro name only * Fixed bad PKGBUILD filename * Use 4-part version for Arch * Remove comma from conflicts * Use .tar.gz from cwd * Generate checksum for Arch * Fixed file extension * Use shell to print output * Don't use shell * Gaurd against bad cmd_utils.run * Fixed bad import * Use list command * Fixed unable to run list commands * Use source file name * Simplify PKGBUILD to use make install * Change install prefix * Use DESTDIR * Copy .desktop and .png to build dir * Restore original `install(FILES...` * Improving comments * Fixed: makepkg runs from `src` by default * Move error after command print * Remove shell arg * Package as a user instead of root (makepkg can't run as root) * Fixed codesign runs in shell * Allow list commands in shell on windows * Don't use sudo on arch * Install sudo on Arch * Fixed typo * Fix ownership of build directory for package user * Improve example .env * Change to depend on libstdc++6 * Add TODO * Fixed Fedora version * Remove libstdc++ deps (names vary between distros) * Roll back to Fedora 40 and 39 * Improve comment * Remove unneccesary default --- .env.example | 6 + .github/actions/dist-upload/action.yml | 6 + .github/workflows/ci.yml | 144 +++-- ...check-changelog.yml => lint-changelog.yml} | 21 +- .github/workflows/lint-cmake-files.yml | 23 + .vscode/extensions.json | 3 +- CMakeLists.txt | 396 +------------ ChangeLog | 1 + README.md | 2 +- cmake-format.yaml | 5 + cmake/CodeCoverage.cmake | 530 +++++++++--------- cmake/Definitions.cmake | 99 ++++ cmake/Libraries.cmake | 370 ++++++++++++ cmake/Packaging.cmake | 213 ++++--- cmake/Version.cmake | 100 ++-- config.yml => config.yaml | 54 +- debian/compat | 1 - debian/control | 17 - debian/copyright | 5 - debian/rules | 5 - debian/source/format | 1 - debian/source/lintian-overrides | 2 - doc/QtCodeStyle.xml | 234 -------- doc/org.synergy-foss.org.synergyc.plist | 20 - doc/org.synergy-foss.org.synergys.plist | 22 - doc/synergyc.man | 84 --- doc/synergys.man | 88 --- res/Readme.txt | 12 - res/dist/arch/PKGBUILD.in | 33 ++ .../dist/flatpak}/flatpak-desktop.patch | 0 .../dist/flatpak}/synergy-business.yml | 0 .../dist/flatpak}/synergy-enterprise.yml | 0 {flatpak => res/dist/flatpak}/synergy.yml | 0 res/{ => dist/linux}/synergy.desktop | 2 +- res/dist/rpm/synergy-business.spec.in | 32 -- res/dist/rpm/synergy-enterprise.spec.in | 32 -- res/dist/rpm/synergy.spec.in | 32 -- res/dist/wix/Product.wxs | 6 +- res/dist/wix/SynergyWelcome.wxs | 2 +- res/{ => dist/wix/images}/banner.png | Bin .../wix/images}/common_background.png | Bin res/{ => dist/wix/images}/dialog.png | Bin .../wix/images}/welcome_background.png | Bin res/synergy.png | Bin 0 -> 22516 bytes res/synergy2.desktop | 11 - scripts/github_env.py | 3 +- scripts/install_deps.py | 14 +- scripts/lib/cmd_utils.py | 20 +- scripts/lib/config.py | 11 +- scripts/lib/env.py | 134 +++-- scripts/lib/linux.py | 87 +++ scripts/lib/mac.py | 16 +- scripts/lib/windows.py | 8 +- scripts/lint_cmake_files.py | 51 ++ scripts/package.py | 36 +- scripts/requirements.txt | 4 + src/CMakeLists.txt | 24 +- src/cmd/CMakeLists.txt | 20 +- src/cmd/synergy-core/CMakeLists.txt | 46 +- src/cmd/synergyc/CMakeLists.txt | 84 +-- src/cmd/synergyd/CMakeLists.txt | 32 +- src/cmd/synergys/CMakeLists.txt | 85 +-- src/cmd/syntool/CMakeLists.txt | 37 +- src/gui/CMakeLists.txt | 150 +++-- src/lib/CMakeLists.txt | 10 +- src/lib/arch/CMakeLists.txt | 42 +- src/lib/base/CMakeLists.txt | 18 +- src/lib/client/CMakeLists.txt | 18 +- src/lib/common/CMakeLists.txt | 14 +- src/lib/io/CMakeLists.txt | 14 +- src/lib/ipc/CMakeLists.txt | 26 +- src/lib/mt/CMakeLists.txt | 14 +- src/lib/net/CMakeLists.txt | 41 +- src/lib/platform/CMakeLists.txt | 63 ++- src/lib/server/CMakeLists.txt | 18 +- src/lib/shared/CMakeLists.txt | 14 +- src/lib/synergy/CMakeLists.txt | 74 +-- src/test/CMakeLists.txt | 26 +- src/test/integtests/CMakeLists.txt | 61 +- src/test/unittests/CMakeLists.txt | 65 ++- 80 files changed, 2013 insertions(+), 1981 deletions(-) rename .github/workflows/{check-changelog.yml => lint-changelog.yml} (62%) create mode 100644 .github/workflows/lint-cmake-files.yml create mode 100644 cmake-format.yaml create mode 100644 cmake/Definitions.cmake create mode 100644 cmake/Libraries.cmake rename config.yml => config.yaml (52%) delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100755 debian/rules delete mode 100644 debian/source/format delete mode 100644 debian/source/lintian-overrides delete mode 100644 doc/QtCodeStyle.xml delete mode 100644 doc/org.synergy-foss.org.synergyc.plist delete mode 100644 doc/org.synergy-foss.org.synergys.plist delete mode 100644 doc/synergyc.man delete mode 100644 doc/synergys.man delete mode 100644 res/Readme.txt create mode 100644 res/dist/arch/PKGBUILD.in rename {flatpak => res/dist/flatpak}/flatpak-desktop.patch (100%) rename {flatpak => res/dist/flatpak}/synergy-business.yml (100%) rename {flatpak => res/dist/flatpak}/synergy-enterprise.yml (100%) rename {flatpak => res/dist/flatpak}/synergy.yml (100%) rename res/{ => dist/linux}/synergy.desktop (81%) delete mode 100644 res/dist/rpm/synergy-business.spec.in delete mode 100644 res/dist/rpm/synergy-enterprise.spec.in delete mode 100644 res/dist/rpm/synergy.spec.in rename res/{ => dist/wix/images}/banner.png (100%) rename res/{ => dist/wix/images}/common_background.png (100%) rename res/{ => dist/wix/images}/dialog.png (100%) rename res/{ => dist/wix/images}/welcome_background.png (100%) create mode 100644 res/synergy.png delete mode 100644 res/synergy2.desktop create mode 100644 scripts/lib/linux.py create mode 100755 scripts/lint_cmake_files.py create mode 100644 scripts/requirements.txt diff --git a/.env.example b/.env.example index 0501fdd9b..bc8eb65c7 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,12 @@ # Packaging (optional) # +# [Linux] Build extra packages (self-extracting tar.gz and tar.gz) +# LINUX_EXTRA_PACKAGES=true + +# [Linux] Run the package command as a different user (requires sudo) +# LINUX_PACKAGE_USER=build + # [Windows] Base64 encoded PFX code signing certificate # WINDOWS_PFX_CERTIFICATE="very-long-base64-encoded-string" diff --git a/.github/actions/dist-upload/action.yml b/.github/actions/dist-upload/action.yml index 15eb1ac22..3145d40d8 100644 --- a/.github/actions/dist-upload/action.yml +++ b/.github/actions/dist-upload/action.yml @@ -26,6 +26,12 @@ runs: using: "composite" steps: + - if: ${{ inputs.use_gdrive == inputs.use_github }} + run: | + echo "Either 'use_github' or 'use_gdrive' must be true (and not both)" + exit 1 + shell: bash + - if: ${{ inputs.use_gdrive == 'true' && !inputs.package-version }} run: | echo "Input 'package-version' is required when uploading to Google Drive" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31b696363..e676c2ec2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ on: env: SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }} + ENABLE_PACKAGING: ${{ !github.event.pull_request.draft }} UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }} UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }} @@ -43,7 +44,7 @@ jobs: - name: Cache Qt id: cache-qt - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ env.QT_BASE_DIR }} key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }} @@ -61,20 +62,20 @@ jobs: run: cmake -B build --preset=windows-release - name: Build - run: cmake --build build + run: cmake --build build -j8 - name: Test run: ./build/bin/unittests - name: Package - if: ${{ !github.event.pull_request.draft }} + if: ${{ env.ENABLE_PACKAGING == 'true' }} run: python ./scripts/package.py env: WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }} WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }} - name: Upload - if: + if: ${{ env.ENABLE_PACKAGING == 'true' }} uses: ./.github/actions/dist-upload with: use_github: ${{ env.UPLOAD_TO_GITHUB }} @@ -97,13 +98,6 @@ jobs: strategy: matrix: runtime: - - name: "macos-10-intel" - timeout: 20 - os: "macos-14-large" - arch: x64 - target: "10.14" - shell: "bash" - - name: "macos-11-arm64" timeout: 10 os: "macos-14" @@ -111,6 +105,13 @@ jobs: target: "11" shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}" + - name: "macos-10-intel" + timeout: 20 + os: "macos-14-large" + arch: x64 + target: "10.14" + shell: "bash" + steps: - name: Checkout uses: actions/checkout@v4 @@ -126,13 +127,13 @@ jobs: run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) - name: Build - run: cmake --build build + run: cmake --build build -j8 - name: Test run: ./build/bin/unittests - name: Package - if: ${{ !github.event.pull_request.draft }} + if: ${{ env.ENABLE_PACKAGING == 'true' }} run: ./scripts/package.py env: APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }} @@ -143,7 +144,7 @@ jobs: APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - name: Upload - if: + if: ${{ env.ENABLE_PACKAGING == 'true' }} uses: ./.github/actions/dist-upload with: use_github: ${{ env.UPLOAD_TO_GITHUB }} @@ -160,52 +161,84 @@ jobs: name: linux-${{ matrix.distro.name }} container: ${{ matrix.distro.container }} + env: + # Prevent apt prompting for input. + DEBIAN_FRONTEND: noninteractive + strategy: matrix: distro: - - name: centos-8 - container: symless/synergy-core:centos8 + - name: ubuntu-24.04 + container: ubuntu:24.04 runs-on: ubuntu-latest - legacy-cmake: true - - - name: debian-11 - container: symless/synergy-core:debian11 - runs-on: ubuntu-latest - legacy-cmake: true - - - name: debian-12 - container: symless/synergy-core:debiansid - runs-on: ubuntu-latest - - - name: fedora-37 - container: symless/synergy-core:fedora37 - runs-on: ubuntu-latest - legacy-cmake: true - - - name: fedora-38 - container: symless/synergy-core:fedora38 - runs-on: ubuntu-latest - legacy-cmake: true - - - name: ubuntu-20.04 - container: symless/synergy-core:ubuntu20.04 - runs-on: ubuntu-latest - legacy-cmake: true + install-deps-apt: true + extra-packages: true - name: ubuntu-22.04 - container: symless/synergy-core:ubuntu22.04 + container: ubuntu:22.04 runs-on: ubuntu-latest + install-deps-apt: true - - name: ubuntu-24.04 - runs-on: ubuntu-24.04 + - name: debian-12 + container: debian:12 + runs-on: ubuntu-latest + install-deps-apt: true + + - name: debian-11 + container: debian:11 + runs-on: ubuntu-latest + install-deps-apt: true + legacy-cmake: true + + - name: fedora-40 + container: fedora:40 + runs-on: ubuntu-latest + install-deps-dnf: true + + - name: fedora-39 + container: fedora:39 + runs-on: ubuntu-latest + install-deps-dnf: true + + - name: opensuse + container: opensuse/tumbleweed:latest + runs-on: ubuntu-latest + install-deps-zypper: true + + - name: arch + container: archlinux:latest + runs-on: ubuntu-latest + install-deps-pacman: true + package-user: build + + - name: manjaro + container: manjarolinux/base:latest + runs-on: ubuntu-latest + install-deps-pacman: true + package-user: build steps: - # Use @v3 since some older Linux distro versions don't support @v4 + - name: Bootstrap + run: | + if [ "${{ matrix.distro.install-deps-apt }}" = "true" ]; then + apt update && apt install -y git python3 + elif [ "${{ matrix.distro.install-deps-dnf }}" = "true" ]; then + dnf install -y git python3 + elif [ "${{ matrix.distro.install-deps-pacman }}" = "true" ]; then + pacman -Syu --noconfirm git python sudo + useradd -m build + elif [ "${{ matrix.distro.install-deps-zypper }}" = "true" ]; then + zypper install -y git python3 + fi + - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" + - name: Config Git safe dir + run: git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Install dependencies run: ./scripts/install_deps.py @@ -219,11 +252,26 @@ jobs: run: cmake -B build -DCMAKE_BUILD_TYPE=Release - name: Build - run: cmake --build build + run: cmake --build build -j8 - name: Test run: ./build/bin/unittests - name: Package - if: ${{ !github.event.pull_request.draft }} + if: ${{ !matrix.distro.skip-package && env.ENABLE_PACKAGING == 'true' }} + env: + LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }} + LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }} run: ./scripts/package.py + + - name: Upload + if: ${{ !matrix.distro.skip-package && env.ENABLE_PACKAGING == 'true' }} + uses: ./.github/actions/dist-upload + with: + use_github: ${{ env.UPLOAD_TO_GITHUB }} + use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }} + github-target-filename: "synergy-${{ matrix.distro.name }}" + gdrive-target-base-dir: "synergy1/personal" + gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }} + gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }} + package-version: ${{ env.SYNERGY_VERSION }} diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/lint-changelog.yml similarity index 62% rename from .github/workflows/check-changelog.yml rename to .github/workflows/lint-changelog.yml index 045dcde5e..2b51ffc8e 100644 --- a/.github/workflows/check-changelog.yml +++ b/.github/workflows/lint-changelog.yml @@ -5,37 +5,28 @@ # file with configuration. For more information, see: # https://github.com/actions/labeler/blob/master/README.md -name: "Check ChangeLog" +name: "Lint ChangeLog" on: pull_request: - branches: [master] jobs: - check-changelog: + lint-changelog: if: ${{ !github.event.pull_request.draft }} runs-on: ubuntu-latest timeout-minutes: 10 steps: - - name: Get changed files + - name: Get changes id: file_changes uses: trilom/file-changes-action@v1.2.4 with: output: "," - - name: echo changes - run: | - echo Files - echo '${{ steps.file_changes.outputs.files}}' - echo Modified - echo '${{ steps.file_changes.outputs.files_modified}}' - echo Added - echo '${{ steps.file_changes.outputs.files_added}}' - echo Removed - echo '${{ steps.file_changes.outputs.files_removed}}' + - name: Show modified + run: echo '${{ steps.file_changes.outputs.files_modified}}' - - name: List files + - name: Check run: | if [[ "${{ steps.file_changes.outputs.files_modified}}" == *"ChangeLog"* ]]; then echo "ChangeLog has been updated" diff --git a/.github/workflows/lint-cmake-files.yml b/.github/workflows/lint-cmake-files.yml new file mode 100644 index 000000000..ebee5d289 --- /dev/null +++ b/.github/workflows/lint-cmake-files.yml @@ -0,0 +1,23 @@ +# Runs + +name: "Lint CMake files" +on: + pull_request: + +jobs: + lint-cmake-files: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + python3 -m venv build/python + source build/python/bin/activate + pip install cmake_format pyyaml + + - name: Lint CMake files + run: ./scripts/lint_cmake_files.py diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ae8529463..5d8d7df0a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,6 +4,7 @@ "twxs.cmake", "llvm-vs-code-extensions.vscode-clangd", "ms-vscode.cpptools", - "vadimcn.vscode-lldb" + "vadimcn.vscode-lldb", + "cheshirekow.cmake-format" ] } diff --git a/CMakeLists.txt b/CMakeLists.txt index e28171e37..c3ba38851 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,393 +14,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -cmake_minimum_required (VERSION 3.5) -project (synergy-core C CXX) - -include (cmake/Version.cmake) -set_version() - -# use response files so that ninja can compile on windows, -# otherwise you get an error when linking qt: -# "The input line is too long." -set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) -set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) -set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@") -set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@") -set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "") - -if (DEFINED ENV{SYNERGY_BUILD_MINIMAL}) - option (SYNERGY_BUILD_GUI "Build the GUI" OFF) - option (SYNERGY_BUILD_INSTALLER "Build the installer" OFF) -else() - option (SYNERGY_BUILD_GUI "Build the GUI" ON) - option (SYNERGY_BUILD_INSTALLER "Build the installer" ON) -endif() - -if (DEFINED ENV{SYNERGY_NO_TESTS}) - option (BUILD_TESTS "Override building of tests" OFF) -else() - option (BUILD_TESTS "Override building of tests" ON) - option (ENABLE_COVERAGE "Build with coverage") -endif() - -if (DEFINED ENV{SYNERGY_UNIFIED_CORE}) - option (UNIFIED_CORE "Build a single core binary" ON) -else() - option (UNIFIED_CORE "Build a single core binary" OFF) -endif() - -if ($ENV{SYNERGY_ENTERPRISE}) - option (SYNERGY_ENTERPRISE "Build Enterprise" ON) -else() - option (SYNERGY_ENTERPRISE "Build Enterprise" OFF) -endif() - -if ($ENV{SYNERGY_BUSINESS}) - option (SYNERGY_BUSINESS "Build Business" ON) -else() - option (SYNERGY_BUSINESS "Build Business" OFF) -endif() - -if (SYNERGY_DEVELOPER_MODE) - add_definitions (-DSYNERGY_DEVELOPER_MODE=1) -endif() - -if (SYNERGY_ENTERPRISE) - add_definitions (-DSYNERGY_ENTERPRISE=1) -endif() - -if (SYNERGY_BUSINESS) - add_definitions(-DSYNERGY_BUSINESS=1) -endif() - -set (CMAKE_CXX_STANDARD 20) -set (CMAKE_CXX_EXTENSIONS OFF) -set (CMAKE_CXX_STANDARD_REQUIRED ON) -set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") - -if (ENABLE_COVERAGE) - # Add Code Coverage - include(cmake/CodeCoverage.cmake) - append_coverage_compiler_flags() - setup_target_for_coverage_gcovr_xml( - NAME coverage - EXECUTABLE unittests - BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src" - EXCLUDE "ext/*") - -endif() - -if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - add_definitions (-DNDEBUG) -endif() - -# TODO: Find out why we need these, and remove them -if (COMMAND cmake_policy) - cmake_policy (SET CMP0003 NEW) - cmake_policy (SET CMP0005 NEW) -endif() - -# Add headers to source list -if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") - set (SYNERGY_ADD_HEADERS FALSE) -else() - set (SYNERGY_ADD_HEADERS TRUE) -endif() - -set (libs) -include_directories (BEFORE SYSTEM ${PROJECT_SOURCE_DIR}/ext/googletest/googletest/include) - -if (UNIX) - if (NOT APPLE) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - endif() - - # For config.h, detect the libraries, functions, etc. - include (CheckIncludeFiles) - include (CheckLibraryExists) - include (CheckFunctionExists) - include (CheckTypeSize) - include (CheckIncludeFileCXX) - include (CheckSymbolExists) - include (CheckCSourceCompiles) - - check_include_file_cxx (istream HAVE_ISTREAM) - check_include_file_cxx (ostream HAVE_OSTREAM) - check_include_file_cxx (sstream HAVE_SSTREAM) - - check_include_files (inttypes.h HAVE_INTTYPES_H) - check_include_files (locale.h HAVE_LOCALE_H) - check_include_files (memory.h HAVE_MEMORY_H) - check_include_files (stdlib.h HAVE_STDLIB_H) - check_include_files (strings.h HAVE_STRINGS_H) - check_include_files (string.h HAVE_STRING_H) - check_include_files (sys/select.h HAVE_SYS_SELECT_H) - check_include_files (sys/socket.h HAVE_SYS_SOCKET_H) - check_include_files (sys/stat.h HAVE_SYS_STAT_H) - check_include_files (sys/time.h HAVE_SYS_TIME_H) - check_include_files (sys/utsname.h HAVE_SYS_UTSNAME_H) - check_include_files (unistd.h HAVE_UNISTD_H) - check_include_files (wchar.h HAVE_WCHAR_H) - - check_function_exists (getpwuid_r HAVE_GETPWUID_R) - check_function_exists (gmtime_r HAVE_GMTIME_R) - check_function_exists (nanosleep HAVE_NANOSLEEP) - check_function_exists (poll HAVE_POLL) - check_function_exists (sigwait HAVE_POSIX_SIGWAIT) - check_function_exists (strftime HAVE_STRFTIME) - check_function_exists (vsnprintf HAVE_VSNPRINTF) - check_function_exists (inet_aton HAVE_INET_ATON) - - # For some reason, the check_function_exists macro doesn't detect - # the inet_aton on some pure Unix platforms (e.g. sunos5). So we - # need to do a more detailed check and also include some extra libs. - if (NOT HAVE_INET_ATON) - set (CMAKE_REQUIRED_LIBRARIES nsl) - - check_c_source_compiles ( - "#include \n int main() { inet_aton (0, 0); }" - HAVE_INET_ATON_ADV) - - set (CMAKE_REQUIRED_LIBRARIES) - - if (HAVE_INET_ATON_ADV) - # Override the previous fail. - set (HAVE_INET_ATON 1) - - # Assume that both nsl and socket will be needed, - # it seems safe to add socket on the back of nsl, - # since socket only ever needed when nsl is needed. - list (APPEND libs nsl socket) - endif() - - endif() - - check_type_size (char SIZEOF_CHAR) - check_type_size (int SIZEOF_INT) - check_type_size (long SIZEOF_LONG) - check_type_size (short SIZEOF_SHORT) - - # pthread is used on both Linux and Mac - check_library_exists ("pthread" pthread_create "" HAVE_PTHREAD) - if (HAVE_PTHREAD) - list (APPEND libs pthread) - else() - message (FATAL_ERROR "Missing library: pthread") - endif() - - - if (APPLE) - set (CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1") - - if(NOT CMAKE_OSX_DEPLOYMENT_TARGET) - set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) - endif() - - if(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 11.0) - set(SYNERGY_OSX_DEPLOYMENT_TARGET 1100) - elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.15) - set(SYNERGY_OSX_DEPLOYMENT_TARGET 1015) - elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.14) - set(SYNERGY_OSX_DEPLOYMENT_TARGET 1014) - else() - set(SYNERGY_OSX_DEPLOYMENT_TARGET 1013) - endif() - add_compile_definitions(OSX_DEPLOYMENT_TARGET=${SYNERGY_OSX_DEPLOYMENT_TARGET}) - - find_library (lib_ScreenSaver ScreenSaver) - find_library (lib_IOKit IOKit) - find_library (lib_ApplicationServices ApplicationServices) - find_library (lib_Foundation Foundation) - find_library (lib_Carbon Carbon) - - list (APPEND libs - ${lib_ScreenSaver} - ${lib_IOKit} - ${lib_ApplicationServices} - ${lib_Foundation} - ${lib_Carbon} - ) - - if(SYNERGY_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 1014) - find_library (lib_UserNotifications UserNotifications) - list (APPEND libs - ${lib_UserNotifications} - ) - endif() - - else() # not-apple - - # add include dir for bsd (posix uses /usr/include/) - set (CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include") - - set (XKBlib "X11/Xlib.h;X11/XKBlib.h") - set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h") - check_type_size ("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H) - set (HAVE_X11_EXTENSIONS_XRANDR_H "${X11_EXTENSIONS_XRANDR_H}") - set (CMAKE_EXTRA_INCLUDE_FILES) - - check_include_files ("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H) - check_include_files ("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H) - check_include_files ("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H) - check_include_files ("X11/extensions/XKB.h" HAVE_XKB_EXTENSION) - check_include_files ("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H) - check_include_files ("${XKBlib}" HAVE_X11_XKBLIB_H) - check_include_files ("X11/extensions/XInput2.h" HAVE_XI2) - - if (HAVE_X11_EXTENSIONS_DPMS_H) - # Assume that function prototypes declared, when include exists. - set (HAVE_DPMS_PROTOTYPES 1) - endif() - - if (NOT HAVE_X11_XKBLIB_H) - message (FATAL_ERROR "Missing header: " ${XKBlib}) - endif() - - check_library_exists ("SM;ICE" IceConnectionNumber "" HAVE_ICE) - check_library_exists ("Xext;X11" DPMSQueryExtension "" HAVE_Xext) - check_library_exists ("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst) - check_library_exists ("Xinerama" XineramaQueryExtension "" HAVE_Xinerama) - check_library_exists ("Xi" XISelectEvents "" HAVE_Xi) - check_library_exists ("Xrandr" XRRQueryExtension "" HAVE_Xrandr) - - if (HAVE_ICE) - - # Assume we have SM if we have ICE. - set (HAVE_SM 1) - list (APPEND libs SM ICE) - - endif() - - if (!X11_xkbfile_FOUND) - message (FATAL_ERROR "Missing library: xkbfile") - endif() - - if (HAVE_Xtst) - - # Xtxt depends on X11. - set (HAVE_X11) - list (APPEND libs Xtst X11 xkbfile) - - else() - - message (FATAL_ERROR "Missing library: Xtst") - - endif() - - if (HAVE_Xext) - list (APPEND libs Xext) - endif() - - if (HAVE_Xinerama) - list (APPEND libs Xinerama) - else (HAVE_Xinerama) - if (HAVE_X11_EXTENSIONS_XINERAMA_H) - set (HAVE_X11_EXTENSIONS_XINERAMA_H 0) - message (WARNING "Old Xinerama implementation detected, disabled") - endif() - endif() - - if (HAVE_Xrandr) - list (APPEND libs Xrandr) - endif() - - # this was outside of the linux scope, - # not sure why, moving it back inside. - if (HAVE_Xi) - list (APPEND libs Xi) - endif() - - endif() - - # For config.h, set some static values; it may be a good idea to make - # these values dynamic for non-standard UNIX compilers. - set (ACCEPT_TYPE_ARG3 socklen_t) - set (HAVE_CXX_BOOL 1) - set (HAVE_CXX_CASTS 1) - set (HAVE_CXX_EXCEPTIONS 1) - set (HAVE_CXX_MUTABLE 1) - set (HAVE_CXX_STDLIB 1) - set (HAVE_PTHREAD_SIGNAL 1) - set (SELECT_TYPE_ARG1 int) - set (SELECT_TYPE_ARG234 " (fd_set *)") - set (SELECT_TYPE_ARG5 " (struct timeval *)") - set (STDC_HEADERS 1) - set (TIME_WITH_SYS_TIME 1) - set (HAVE_SOCKLEN_T 1) - - # For config.h, save the results based on a template (config.h.in). - configure_file (res/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/lib/config.h) - - add_definitions (-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H) - - if (APPLE) - add_definitions (-DWINAPI_CARBON=1 -D_THREAD_SAFE) - else() - add_definitions (-DWINAPI_XWINDOWS=1) - endif() - -elseif (WIN32) - - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2") - - list (APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi) - - add_definitions ( - /DWIN32 - /D_WINDOWS - /D_CRT_SECURE_NO_WARNINGS - /DSYNERGY_VERSION=\"${SYNERGY_VERSION}\" - /D_XKEYCHECK_H - ) - - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/res/win/version.rc.in - ${CMAKE_BINARY_DIR}/src/version.rc - @ONLY) - -endif() - -# -# OpenSSL -# -# Apple has to use static libraries because -# "Use of the Apple-provided OpenSSL libraries by apps is strongly discouraged." -# https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html -if(APPLE OR DEFINED ENV{SYNERGY_STATIC_OPENSSL}) - set(OPENSSL_USE_STATIC_LIBS TRUE) -endif() -find_package(OpenSSL REQUIRED) - -# -# Check submodules -# -find_package(Git QUIET) -if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") -# Update submodules as needed - option(GIT_SUBMODULE "Check submodules during build" ON) - if(GIT_SUBMODULE) - message(STATUS "Submodule update") - execute_process( - COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMODULE_RESULT) - if(NOT GIT_SUBMODULE_RESULT EQUAL "0") - message(FATAL_ERROR "Git submodule update failed: ${GIT_SUBMODULE_RESULT}") - endif() - endif() -endif() - -# -# Google Test -# -if(BUILD_TESTS AND NOT EXISTS "${PROJECT_SOURCE_DIR}/ext/googletest/CMakeLists.txt") - message(FATAL_ERROR "Git submodule for Google Test is missing") -endif() +cmake_minimum_required(VERSION 3.5) +project(synergy-core C CXX) +include(cmake/Version.cmake) +include(cmake/Definitions.cmake) +include(cmake/Libraries.cmake) include(cmake/Packaging.cmake) + +set_version() +configure_definitions() +configure_libs() configure_packaging() -add_subdirectory (src) +add_subdirectory(src) diff --git a/ChangeLog b/ChangeLog index 99369c6f4..4a3d442ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -36,6 +36,7 @@ Enhancements: - #7354 Re-implement CI auto version increment for packaging - #7353 Re-implement packaging for GitHub workflows (macOS) - #7360 Re-implement packaging for GitHub workflows (Windows) +- #7361 Re-implement packaging for GitHub workflows (Linux) # 1.14.6 diff --git a/README.md b/README.md index 916edabdd..48876d158 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ cmake -B build --preset=linux-release **Build:** ``` -cmake --build build +cmake --build build -j8 ``` **Test:** diff --git a/cmake-format.yaml b/cmake-format.yaml new file mode 100644 index 000000000..203bdb80f --- /dev/null +++ b/cmake-format.yaml @@ -0,0 +1,5 @@ +format: + line_ending: "auto" + +markup: + first_comment_is_literal: true diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake index 2edaeccbc..0f3ff8abf 100644 --- a/cmake/CodeCoverage.cmake +++ b/cmake/CodeCoverage.cmake @@ -116,322 +116,334 @@ include(CMakeParseArguments) # Check prereqs -find_program( GCOV_PATH gcov ) -find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl) -find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat ) -find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test) -find_program( CPPFILT_PATH NAMES c++filt ) +find_program(GCOV_PATH gcov) +find_program(LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl) +find_program(GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat) +find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test) +find_program(CPPFILT_PATH NAMES c++filt) if(NOT GCOV_PATH) - message(FATAL_ERROR "gcov not found! Aborting...") + message(FATAL_ERROR "gcov not found! Aborting...") endif() # NOT GCOV_PATH if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") - if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3) - message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") - endif() + if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3) + message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...") + endif() elseif(NOT CMAKE_COMPILER_IS_GNUCXX) - if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang") - # Do nothing; exit conditional without error if true - elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") - # Do nothing; exit conditional without error if true - else() - message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") - endif() + if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang") + # Do nothing; exit conditional without error if true + elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + # Do nothing; exit conditional without error if true + else() + message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...") + endif() endif() -set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage" - CACHE INTERNAL "") +set(COVERAGE_COMPILER_FLAGS + "-g -fprofile-arcs -ftest-coverage" + CACHE INTERNAL "") set(CMAKE_Fortran_FLAGS_COVERAGE - ${COVERAGE_COMPILER_FLAGS} - CACHE STRING "Flags used by the Fortran compiler during coverage builds." - FORCE ) + ${COVERAGE_COMPILER_FLAGS} + CACHE STRING "Flags used by the Fortran compiler during coverage builds." + FORCE) set(CMAKE_CXX_FLAGS_COVERAGE - ${COVERAGE_COMPILER_FLAGS} - CACHE STRING "Flags used by the C++ compiler during coverage builds." - FORCE ) + ${COVERAGE_COMPILER_FLAGS} + CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE) set(CMAKE_C_FLAGS_COVERAGE - ${COVERAGE_COMPILER_FLAGS} - CACHE STRING "Flags used by the C compiler during coverage builds." - FORCE ) + ${COVERAGE_COMPILER_FLAGS} + CACHE STRING "Flags used by the C compiler during coverage builds." FORCE) set(CMAKE_EXE_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used for linking binaries during coverage builds." - FORCE ) + "" + CACHE STRING "Flags used for linking binaries during coverage builds." + FORCE) set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE - "" - CACHE STRING "Flags used by the shared libraries linker during coverage builds." - FORCE ) + "" + CACHE STRING + "Flags used by the shared libraries linker during coverage builds." + FORCE) mark_as_advanced( - CMAKE_Fortran_FLAGS_COVERAGE - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_C_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE ) + CMAKE_Fortran_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE + CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE) if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading") + message( + WARNING + "Code coverage results with an optimised (non-Debug) build may be misleading" + ) endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug" -if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") - link_libraries(gcov) +if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL + "GNU") + link_libraries(gcov) endif() -# Defines a target for running and collection code coverage information -# Builds dependencies, runs the given executable and outputs reports. -# NOTE! The executable should always have a ZERO as exit code otherwise -# the coverage generation will not complete. +# Defines a target for running and collection code coverage information Builds +# dependencies, runs the given executable and outputs reports. NOTE! The +# executable should always have a ZERO as exit code otherwise the coverage +# generation will not complete. # -# setup_target_for_coverage_lcov( -# NAME testrunner_coverage # New target name -# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR -# DEPENDENCIES testrunner # Dependencies to build first -# BASE_DIRECTORY "../" # Base directory for report -# # (defaults to PROJECT_SOURCE_DIR) -# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative -# # to BASE_DIRECTORY, with CMake 3.4+) -# NO_DEMANGLE # Don't demangle C++ symbols -# # even if c++filt is found -# ) +# setup_target_for_coverage_lcov( NAME testrunner_coverage # +# New target name EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in +# PROJECT_BINARY_DIR DEPENDENCIES testrunner # Dependencies +# to build first BASE_DIRECTORY "../" # Base directory +# for report # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" +# "src/dir2/*" # Patterns to exclude (can be relative # to +# BASE_DIRECTORY, with CMake 3.4+) NO_DEMANGLE # +# Don't demangle C++ symbols # even if c++filt is found ) function(setup_target_for_coverage_lcov) - set(options NO_DEMANGLE) - set(oneValueArgs BASE_DIRECTORY NAME) - set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS) - cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(options NO_DEMANGLE) + set(oneValueArgs BASE_DIRECTORY NAME) + set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS + GENHTML_ARGS) + cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) - if(NOT LCOV_PATH) - message(FATAL_ERROR "lcov not found! Aborting...") - endif() # NOT LCOV_PATH + if(NOT LCOV_PATH) + message(FATAL_ERROR "lcov not found! Aborting...") + endif() # NOT LCOV_PATH - if(NOT GENHTML_PATH) - message(FATAL_ERROR "genhtml not found! Aborting...") - endif() # NOT GENHTML_PATH + if(NOT GENHTML_PATH) + message(FATAL_ERROR "genhtml not found! Aborting...") + endif() # NOT GENHTML_PATH - # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(${Coverage_BASE_DIRECTORY}) - get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() - set(BASEDIR ${PROJECT_SOURCE_DIR}) + # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR + if(${Coverage_BASE_DIRECTORY}) + get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) + else() + set(BASEDIR ${PROJECT_SOURCE_DIR}) + endif() + + # Collect excludes (CMake 3.4+: Also compute absolute paths) + set(LCOV_EXCLUDES "") + foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} + ${COVERAGE_LCOV_EXCLUDES}) + if(CMAKE_VERSION VERSION_GREATER 3.4) + get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) endif() + list(APPEND LCOV_EXCLUDES "${EXCLUDE}") + endforeach() + list(REMOVE_DUPLICATES LCOV_EXCLUDES) - # Collect excludes (CMake 3.4+: Also compute absolute paths) - set(LCOV_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) - get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() - list(APPEND LCOV_EXCLUDES "${EXCLUDE}") - endforeach() - list(REMOVE_DUPLICATES LCOV_EXCLUDES) + # Conditional arguments + if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE}) + set(GENHTML_EXTRA_ARGS "--demangle-cpp") + endif() - # Conditional arguments - if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE}) - set(GENHTML_EXTRA_ARGS "--demangle-cpp") - endif() + # Setup target + add_custom_target( + ${Coverage_NAME} + # Cleanup lcov + COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} + -directory . -b ${BASEDIR} --zerocounters + # Create baseline to make sure untouched files show up in the report + COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d + . -b ${BASEDIR} -o ${Coverage_NAME}.base + # Run tests + COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} + # Capturing lcov counters and generating report + COMMAND + ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . + -b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture + # add baseline counters + COMMAND + ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a + ${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file + ${Coverage_NAME}.total + # filter collected data to final coverage report + COMMAND + ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove + ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file + ${Coverage_NAME}.info + # Generate HTML output + COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o + ${Coverage_NAME} ${Coverage_NAME}.info + # Set output files as GENERATED (will be removed on 'make clean') + BYPRODUCTS ${Coverage_NAME}.base ${Coverage_NAME}.capture + ${Coverage_NAME}.total ${Coverage_NAME}.info + ${Coverage_NAME} # report directory + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${Coverage_DEPENDENCIES} + VERBATIM # Protect arguments to commands + COMMENT + "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." + ) - # Setup target - add_custom_target(${Coverage_NAME} + # Show where to find the lcov info report + add_custom_command( + TARGET ${Coverage_NAME} + POST_BUILD + COMMAND ; + COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info.") - # Cleanup lcov - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . -b ${BASEDIR} --zerocounters - # Create baseline to make sure untouched files show up in the report - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b ${BASEDIR} -o ${Coverage_NAME}.base - - # Run tests - COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} - - # Capturing lcov counters and generating report - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture - # add baseline counters - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total - # filter collected data to final coverage report - COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info - - # Generate HTML output - COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o ${Coverage_NAME} ${Coverage_NAME}.info - - # Set output files as GENERATED (will be removed on 'make clean') - BYPRODUCTS - ${Coverage_NAME}.base - ${Coverage_NAME}.capture - ${Coverage_NAME}.total - ${Coverage_NAME}.info - ${Coverage_NAME} # report directory - - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM # Protect arguments to commands - COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report." - ) - - # Show where to find the lcov info report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND ; - COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info." - ) - - # Show info where to find the report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND ; - COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." - ) + # Show info where to find the report + add_custom_command( + TARGET ${Coverage_NAME} + POST_BUILD + COMMAND ; + COMMENT + "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." + ) endfunction() # setup_target_for_coverage_lcov -# Defines a target for running and collection code coverage information -# Builds dependencies, runs the given executable and outputs reports. -# NOTE! The executable should always have a ZERO as exit code otherwise -# the coverage generation will not complete. +# Defines a target for running and collection code coverage information Builds +# dependencies, runs the given executable and outputs reports. NOTE! The +# executable should always have a ZERO as exit code otherwise the coverage +# generation will not complete. # -# setup_target_for_coverage_gcovr_xml( -# NAME ctest_coverage # New target name -# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR -# DEPENDENCIES executable_target # Dependencies to build first -# BASE_DIRECTORY "../" # Base directory for report -# # (defaults to PROJECT_SOURCE_DIR) -# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative -# # to BASE_DIRECTORY, with CMake 3.4+) -# ) +# setup_target_for_coverage_gcovr_xml( NAME ctest_coverage # +# New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in +# PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to +# build first BASE_DIRECTORY "../" # Base directory for report +# # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" "src/dir2/*" # +# Patterns to exclude (can be relative # to BASE_DIRECTORY, with CMake 3.4+) ) function(setup_target_for_coverage_gcovr_xml) - set(options NONE) - set(oneValueArgs BASE_DIRECTORY NAME) - set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) - cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(options NONE) + set(oneValueArgs BASE_DIRECTORY NAME) + set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) + cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) - if(NOT GCOVR_PATH) - message(FATAL_ERROR "gcovr not found! Aborting...") - endif() # NOT GCOVR_PATH + if(NOT GCOVR_PATH) + message(FATAL_ERROR "gcovr not found! Aborting...") + endif() # NOT GCOVR_PATH - # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(${Coverage_BASE_DIRECTORY}) - get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() - set(BASEDIR ${PROJECT_SOURCE_DIR}) + # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR + if(${Coverage_BASE_DIRECTORY}) + get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) + else() + set(BASEDIR ${PROJECT_SOURCE_DIR}) + endif() + + # Collect excludes (CMake 3.4+: Also compute absolute paths) + set(GCOVR_EXCLUDES "") + foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} + ${COVERAGE_GCOVR_EXCLUDES}) + if(CMAKE_VERSION VERSION_GREATER 3.4) + get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) endif() + list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") + endforeach() + list(REMOVE_DUPLICATES GCOVR_EXCLUDES) - # Collect excludes (CMake 3.4+: Also compute absolute paths) - set(GCOVR_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) - get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() - list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") - endforeach() - list(REMOVE_DUPLICATES GCOVR_EXCLUDES) + # Combine excludes to several -e arguments + set(GCOVR_EXCLUDE_ARGS "") + foreach(EXCLUDE ${GCOVR_EXCLUDES}) + list(APPEND GCOVR_EXCLUDE_ARGS "-e") + list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") + endforeach() - # Combine excludes to several -e arguments - set(GCOVR_EXCLUDE_ARGS "") - foreach(EXCLUDE ${GCOVR_EXCLUDES}) - list(APPEND GCOVR_EXCLUDE_ARGS "-e") - list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") - endforeach() + add_custom_target( + ${Coverage_NAME} + # Run tests + ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} + # Running gcovr + COMMAND ${GCOVR_PATH} --sonarqube -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS} + --object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}.xml + BYPRODUCTS ${Coverage_NAME}.xml + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${Coverage_DEPENDENCIES} + VERBATIM # Protect arguments to commands + COMMENT "Running gcovr to produce Cobertura code coverage report.") - add_custom_target(${Coverage_NAME} - # Run tests - ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} - - # Running gcovr - COMMAND ${GCOVR_PATH} --sonarqube - -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS} - --object-directory=${PROJECT_BINARY_DIR} - -o ${Coverage_NAME}.xml - BYPRODUCTS ${Coverage_NAME}.xml - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM # Protect arguments to commands - COMMENT "Running gcovr to produce Cobertura code coverage report." - ) - - # Show info where to find the report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND ; - COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml." - ) + # Show info where to find the report + add_custom_command( + TARGET ${Coverage_NAME} + POST_BUILD + COMMAND ; + COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml.") endfunction() # setup_target_for_coverage_gcovr_xml -# Defines a target for running and collection code coverage information -# Builds dependencies, runs the given executable and outputs reports. -# NOTE! The executable should always have a ZERO as exit code otherwise -# the coverage generation will not complete. +# Defines a target for running and collection code coverage information Builds +# dependencies, runs the given executable and outputs reports. NOTE! The +# executable should always have a ZERO as exit code otherwise the coverage +# generation will not complete. # -# setup_target_for_coverage_gcovr_html( -# NAME ctest_coverage # New target name -# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR -# DEPENDENCIES executable_target # Dependencies to build first -# BASE_DIRECTORY "../" # Base directory for report -# # (defaults to PROJECT_SOURCE_DIR) -# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative -# # to BASE_DIRECTORY, with CMake 3.4+) -# ) +# setup_target_for_coverage_gcovr_html( NAME ctest_coverage # +# New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in +# PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to +# build first BASE_DIRECTORY "../" # Base directory for report +# # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" "src/dir2/*" # +# Patterns to exclude (can be relative # to BASE_DIRECTORY, with CMake 3.4+) ) function(setup_target_for_coverage_gcovr_html) - set(options NONE) - set(oneValueArgs BASE_DIRECTORY NAME) - set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) - cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + set(options NONE) + set(oneValueArgs BASE_DIRECTORY NAME) + set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES) + cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) - if(NOT GCOVR_PATH) - message(FATAL_ERROR "gcovr not found! Aborting...") - endif() # NOT GCOVR_PATH + if(NOT GCOVR_PATH) + message(FATAL_ERROR "gcovr not found! Aborting...") + endif() # NOT GCOVR_PATH - # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR - if(${Coverage_BASE_DIRECTORY}) - get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) - else() - set(BASEDIR ${PROJECT_SOURCE_DIR}) + # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR + if(${Coverage_BASE_DIRECTORY}) + get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE) + else() + set(BASEDIR ${PROJECT_SOURCE_DIR}) + endif() + + # Collect excludes (CMake 3.4+: Also compute absolute paths) + set(GCOVR_EXCLUDES "") + foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} + ${COVERAGE_GCOVR_EXCLUDES}) + if(CMAKE_VERSION VERSION_GREATER 3.4) + get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) endif() + list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") + endforeach() + list(REMOVE_DUPLICATES GCOVR_EXCLUDES) - # Collect excludes (CMake 3.4+: Also compute absolute paths) - set(GCOVR_EXCLUDES "") - foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES}) - if(CMAKE_VERSION VERSION_GREATER 3.4) - get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR}) - endif() - list(APPEND GCOVR_EXCLUDES "${EXCLUDE}") - endforeach() - list(REMOVE_DUPLICATES GCOVR_EXCLUDES) + # Combine excludes to several -e arguments + set(GCOVR_EXCLUDE_ARGS "") + foreach(EXCLUDE ${GCOVR_EXCLUDES}) + list(APPEND GCOVR_EXCLUDE_ARGS "-e") + list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") + endforeach() - # Combine excludes to several -e arguments - set(GCOVR_EXCLUDE_ARGS "") - foreach(EXCLUDE ${GCOVR_EXCLUDES}) - list(APPEND GCOVR_EXCLUDE_ARGS "-e") - list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}") - endforeach() + add_custom_target( + ${Coverage_NAME} + # Run tests + ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} + # Create folder + COMMAND ${CMAKE_COMMAND} -E make_directory + ${PROJECT_BINARY_DIR}/${Coverage_NAME} + # Running gcovr + COMMAND + ${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS} + --object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}/index.html + BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + DEPENDS ${Coverage_DEPENDENCIES} + VERBATIM # Protect arguments to commands + COMMENT "Running gcovr to produce HTML code coverage report.") - add_custom_target(${Coverage_NAME} - # Run tests - ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS} - - # Create folder - COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME} - - # Running gcovr - COMMAND ${GCOVR_PATH} --html --html-details - -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS} - --object-directory=${PROJECT_BINARY_DIR} - -o ${Coverage_NAME}/index.html - - BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - DEPENDS ${Coverage_DEPENDENCIES} - VERBATIM # Protect arguments to commands - COMMENT "Running gcovr to produce HTML code coverage report." - ) - - # Show info where to find the report - add_custom_command(TARGET ${Coverage_NAME} POST_BUILD - COMMAND ; - COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." - ) + # Show info where to find the report + add_custom_command( + TARGET ${Coverage_NAME} + POST_BUILD + COMMAND ; + COMMENT + "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report." + ) endfunction() # setup_target_for_coverage_gcovr_html function(append_coverage_compiler_flags) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE) - message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}") + set(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" + PARENT_SCOPE) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" + PARENT_SCOPE) + set(CMAKE_Fortran_FLAGS + "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" + PARENT_SCOPE) + message( + STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}") endfunction() # append_coverage_compiler_flags diff --git a/cmake/Definitions.cmake b/cmake/Definitions.cmake new file mode 100644 index 000000000..52de6e045 --- /dev/null +++ b/cmake/Definitions.cmake @@ -0,0 +1,99 @@ +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# +# 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 . + +macro(configure_definitions) + + set(CMAKE_CXX_STANDARD 20) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + + configure_ninja() + configure_options() + + if(SYNERGY_ENTERPRISE) + add_definitions(-DSYNERGY_ENTERPRISE=1) + endif() + + if(SYNERGY_BUSINESS) + add_definitions(-DSYNERGY_BUSINESS=1) + endif() + + if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-DNDEBUG) + endif() + + # TODO: Find out why we need these, and remove them if we don't + if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) + cmake_policy(SET CMP0005 NEW) + endif() + + # Add headers to source list + if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles") + set(SYNERGY_ADD_HEADERS FALSE) + else() + set(SYNERGY_ADD_HEADERS TRUE) + endif() +endmacro() + +macro(configure_ninja) + # use response files so that ninja can compile on windows, otherwise you get + # an error when linking qt: "The input line is too long." + set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) + set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) + set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@") + set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@") + set(CMAKE_NINJA_FORCE_RESPONSE_FILE + 1 + CACHE INTERNAL "") +endmacro() + +macro(configure_options) + if(DEFINED ENV{SYNERGY_BUILD_MINIMAL}) + option(SYNERGY_BUILD_GUI "Build the GUI" OFF) + option(SYNERGY_BUILD_INSTALLER "Build the installer" OFF) + else() + option(SYNERGY_BUILD_GUI "Build the GUI" ON) + option(SYNERGY_BUILD_INSTALLER "Build the installer" ON) + endif() + + if(DEFINED ENV{SYNERGY_NO_TESTS}) + option(BUILD_TESTS "Override building of tests" OFF) + else() + option(BUILD_TESTS "Override building of tests" ON) + option(ENABLE_COVERAGE "Build with coverage") + endif() + + if(DEFINED ENV{SYNERGY_UNIFIED_CORE}) + option(UNIFIED_CORE "Build a single core binary" ON) + else() + option(UNIFIED_CORE "Build a single core binary" OFF) + endif() + + if($ENV{SYNERGY_ENTERPRISE}) + option(SYNERGY_ENTERPRISE "Build Enterprise" ON) + else() + option(SYNERGY_ENTERPRISE "Build Enterprise" OFF) + endif() + + if($ENV{SYNERGY_BUSINESS}) + option(SYNERGY_BUSINESS "Build Business" ON) + else() + option(SYNERGY_BUSINESS "Build Business" OFF) + endif() +endmacro() diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake new file mode 100644 index 000000000..ea74869b2 --- /dev/null +++ b/cmake/Libraries.cmake @@ -0,0 +1,370 @@ +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# +# 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 . + +macro(configure_libs) + + set(libs) + if(UNIX) + configure_unix_libs() + elseif(WIN32) + configure_windows_libs() + endif() + + configure_openssl() + update_submodules() + configure_test_libs() + +endmacro() + +# +# Unix (Mac, Linux, BSD, etc) +# +macro(configure_unix_libs) + + if(NOT APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + endif() + + # For config.h, detect the libraries, functions, etc. + include(CheckIncludeFiles) + include(CheckLibraryExists) + include(CheckFunctionExists) + include(CheckTypeSize) + include(CheckIncludeFileCXX) + include(CheckSymbolExists) + include(CheckCSourceCompiles) + + check_include_file_cxx(istream HAVE_ISTREAM) + check_include_file_cxx(ostream HAVE_OSTREAM) + check_include_file_cxx(sstream HAVE_SSTREAM) + + check_include_files(inttypes.h HAVE_INTTYPES_H) + check_include_files(locale.h HAVE_LOCALE_H) + check_include_files(memory.h HAVE_MEMORY_H) + check_include_files(stdlib.h HAVE_STDLIB_H) + check_include_files(strings.h HAVE_STRINGS_H) + check_include_files(string.h HAVE_STRING_H) + check_include_files(sys/select.h HAVE_SYS_SELECT_H) + check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) + check_include_files(sys/stat.h HAVE_SYS_STAT_H) + check_include_files(sys/time.h HAVE_SYS_TIME_H) + check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H) + check_include_files(unistd.h HAVE_UNISTD_H) + check_include_files(wchar.h HAVE_WCHAR_H) + + check_function_exists(getpwuid_r HAVE_GETPWUID_R) + check_function_exists(gmtime_r HAVE_GMTIME_R) + check_function_exists(nanosleep HAVE_NANOSLEEP) + check_function_exists(poll HAVE_POLL) + check_function_exists(sigwait HAVE_POSIX_SIGWAIT) + check_function_exists(strftime HAVE_STRFTIME) + check_function_exists(vsnprintf HAVE_VSNPRINTF) + check_function_exists(inet_aton HAVE_INET_ATON) + + # For some reason, the check_function_exists macro doesn't detect the + # inet_aton on some pure Unix platforms (e.g. sunos5). So we need to do a more + # detailed check and also include some extra libs. + if(NOT HAVE_INET_ATON) + set(CMAKE_REQUIRED_LIBRARIES nsl) + + check_c_source_compiles( + "#include \n int main() { inet_aton (0, 0); }" + HAVE_INET_ATON_ADV) + + set(CMAKE_REQUIRED_LIBRARIES) + + if(HAVE_INET_ATON_ADV) + # Override the previous fail. + set(HAVE_INET_ATON 1) + + # Assume that both nsl and socket will be needed, it seems safe to add + # socket on the back of nsl, since socket only ever needed when nsl is + # needed. + list(APPEND libs nsl socket) + endif() + + endif() + + check_type_size(char SIZEOF_CHAR) + check_type_size(int SIZEOF_INT) + check_type_size(long SIZEOF_LONG) + check_type_size(short SIZEOF_SHORT) + + # pthread is used on both Linux and Mac + check_library_exists("pthread" pthread_create "" HAVE_PTHREAD) + if(HAVE_PTHREAD) + list(APPEND libs pthread) + else() + message(FATAL_ERROR "Missing library: pthread") + endif() + + if(APPLE) + configure_mac_libs() + else() + configure_xorg_libs() + endif() + + # For config.h, set some static values; it may be a good idea to make these + # values dynamic for non-standard UNIX compilers. + set(ACCEPT_TYPE_ARG3 socklen_t) + set(HAVE_CXX_BOOL 1) + set(HAVE_CXX_CASTS 1) + set(HAVE_CXX_EXCEPTIONS 1) + set(HAVE_CXX_MUTABLE 1) + set(HAVE_CXX_STDLIB 1) + set(HAVE_PTHREAD_SIGNAL 1) + set(SELECT_TYPE_ARG1 int) + set(SELECT_TYPE_ARG234 " (fd_set *)") + set(SELECT_TYPE_ARG5 " (struct timeval *)") + set(STDC_HEADERS 1) + set(TIME_WITH_SYS_TIME 1) + set(HAVE_SOCKLEN_T 1) + + # For config.h, save the results based on a template (config.h.in). + configure_file(res/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/lib/config.h) + + add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H) + +endmacro() + +# +# Apple macOS +# +macro(configure_mac_libs) + + set(CMAKE_CXX_FLAGS + "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1" + ) + + if(NOT CMAKE_OSX_DEPLOYMENT_TARGET) + set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0) + endif() + + if(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 11.0) + set(SYNERGY_OSX_DEPLOYMENT_TARGET 1100) + elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.15) + set(SYNERGY_OSX_DEPLOYMENT_TARGET 1015) + elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.14) + set(SYNERGY_OSX_DEPLOYMENT_TARGET 1014) + else() + set(SYNERGY_OSX_DEPLOYMENT_TARGET 1013) + endif() + + add_compile_definitions( + OSX_DEPLOYMENT_TARGET=${SYNERGY_OSX_DEPLOYMENT_TARGET}) + + find_library(lib_ScreenSaver ScreenSaver) + find_library(lib_IOKit IOKit) + find_library(lib_ApplicationServices ApplicationServices) + find_library(lib_Foundation Foundation) + find_library(lib_Carbon Carbon) + + list( + APPEND + libs + ${lib_ScreenSaver} + ${lib_IOKit} + ${lib_ApplicationServices} + ${lib_Foundation} + ${lib_Carbon}) + + if(SYNERGY_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 1014) + find_library(lib_UserNotifications UserNotifications) + list(APPEND libs ${lib_UserNotifications}) + endif() + + add_definitions(-DWINAPI_CARBON=1 -D_THREAD_SAFE) + +endmacro() + +# +# X.org/X11 for Linux, BSD, etc +# +macro(configure_xorg_libs) + + # Add include dir for BSD (posix uses /usr/include/) + set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include") + + set(XKBlib "X11/Xlib.h;X11/XKBlib.h") + set(CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h") + check_type_size("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H) + set(HAVE_X11_EXTENSIONS_XRANDR_H "${X11_EXTENSIONS_XRANDR_H}") + set(CMAKE_EXTRA_INCLUDE_FILES) + + check_include_files("${XKBlib};X11/extensions/dpms.h" + HAVE_X11_EXTENSIONS_DPMS_H) + check_include_files("X11/extensions/Xinerama.h" + HAVE_X11_EXTENSIONS_XINERAMA_H) + check_include_files("${XKBlib};X11/extensions/XKBstr.h" + HAVE_X11_EXTENSIONS_XKBSTR_H) + check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION) + check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H) + check_include_files("${XKBlib}" HAVE_X11_XKBLIB_H) + check_include_files("X11/extensions/XInput2.h" HAVE_XI2) + + if(HAVE_X11_EXTENSIONS_DPMS_H) + # Assume that function prototypes declared, when include exists. + set(HAVE_DPMS_PROTOTYPES 1) + endif() + + if(NOT HAVE_X11_XKBLIB_H) + message(FATAL_ERROR "Missing header: " ${XKBlib}) + endif() + + check_library_exists("SM;ICE" IceConnectionNumber "" HAVE_ICE) + check_library_exists("Xext;X11" DPMSQueryExtension "" HAVE_Xext) + check_library_exists("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst) + check_library_exists("Xinerama" XineramaQueryExtension "" HAVE_Xinerama) + check_library_exists("Xi" XISelectEvents "" HAVE_Xi) + check_library_exists("Xrandr" XRRQueryExtension "" HAVE_Xrandr) + + if(HAVE_ICE) + + # Assume we have SM if we have ICE. + set(HAVE_SM 1) + list(APPEND libs SM ICE) + + endif() + + if(!X11_xkbfile_FOUND) + message(FATAL_ERROR "Missing library: xkbfile") + endif() + + if(HAVE_Xtst) + + # Xtxt depends on X11. + set(HAVE_X11) + list(APPEND libs Xtst X11 xkbfile) + + else() + + message(FATAL_ERROR "Missing library: Xtst") + + endif() + + if(HAVE_Xext) + list(APPEND libs Xext) + endif() + + if(HAVE_Xinerama) + list(APPEND libs Xinerama) + else(HAVE_Xinerama) + if(HAVE_X11_EXTENSIONS_XINERAMA_H) + set(HAVE_X11_EXTENSIONS_XINERAMA_H 0) + message(WARNING "Old Xinerama implementation detected, disabled") + endif() + endif() + + if(HAVE_Xrandr) + list(APPEND libs Xrandr) + endif() + + # this was outside of the linux scope, not sure why, moving it back inside. + if(HAVE_Xi) + list(APPEND libs Xi) + endif() + + add_definitions(-DWINAPI_XWINDOWS=1) + +endmacro() + +# +# Windows +# +macro(configure_windows_libs) + + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2") + + list( + APPEND + libs + Wtsapi32 + Userenv + Wininet + comsuppw + Shlwapi) + + add_definitions(/DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS + /DSYNERGY_VERSION=\"${SYNERGY_VERSION}\" /D_XKEYCHECK_H) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/res/win/version.rc.in + ${CMAKE_BINARY_DIR}/src/version.rc @ONLY) + +endmacro() + +macro(configure_openssl) + # Apple has to use static libraries because "Use of the Apple-provided OpenSSL + # libraries by apps is strongly discouraged." + # https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html + if(APPLE OR DEFINED ENV{SYNERGY_STATIC_OPENSSL}) + set(OPENSSL_USE_STATIC_LIBS TRUE) + endif() + + find_package(OpenSSL REQUIRED) +endmacro() + +macro(configure_test_libs) + + if(BUILD_TESTS AND NOT EXISTS + "${PROJECT_SOURCE_DIR}/ext/googletest/CMakeLists.txt") + message(FATAL_ERROR "Git submodule for Google Test is missing") + endif() + + if(ENABLE_COVERAGE) + include(cmake/CodeCoverage.cmake) + append_coverage_compiler_flags() + setup_target_for_coverage_gcovr_xml( + NAME + coverage + EXECUTABLE + unittests + BASE_DIRECTORY + "${PROJECT_SOURCE_DIR}/src" + EXCLUDE + "ext/*") + endif() + + include_directories(BEFORE SYSTEM + ${PROJECT_SOURCE_DIR}/ext/googletest/googletest/include) +endmacro() + +macro(update_submodules) + + find_package(Git QUIET) + + if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") + + option(GIT_SUBMODULE "Check submodules during build" ON) + + if(GIT_SUBMODULE) + + message(STATUS "Submodule update") + execute_process( + COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMODULE_RESULT) + + if(NOT GIT_SUBMODULE_RESULT EQUAL "0") + message( + FATAL_ERROR "Git submodule update failed: ${GIT_SUBMODULE_RESULT}") + endif() + + endif() + endif() + +endmacro() diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index bd4331df3..511acd606 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -18,103 +18,168 @@ # If enabled, configure packaging based on OS. # macro(configure_packaging) - if (${SYNERGY_BUILD_INSTALLER}) - if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - configure_macos_packaging() - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - configure_windows_packaging() - elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly") - configure_linux_packaging() - endif() - else() - message (STATUS "Not configuring installer") + + if(${SYNERGY_BUILD_INSTALLER}) + set(CPACK_PACKAGE_NAME "synergy") + set(CPACK_PACKAGE_CONTACT "Synergy ") + set(CPACK_PACKAGE_DESCRIPTION "Mouse and keyboard sharing utility") + set(CPACK_PACKAGE_VENDOR "Symless") + + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + configure_windows_packaging() + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + configure_macos_packaging() + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly") + configure_linux_packaging() endif() + + include(CPack) + else() + message(STATUS "Not configuring installer") + endif() + +endmacro() + +# +# Windows installer +# +macro(configure_windows_packaging) + + message(STATUS "Configuring Windows installer") + + set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION_MS}) + set(QT_PATH $ENV{CMAKE_PREFIX_PATH}) + + find_openssl_dir_win32(OPENSSL_PATH) + + configure_files(${CMAKE_CURRENT_SOURCE_DIR}/res/dist/wix + ${CMAKE_BINARY_DIR}/installer) + endmacro() # # macOS app bundle # macro(configure_macos_packaging) - if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set (CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks") - set (SYNERGY_BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/res/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}) - endif() -endmacro() -function(find_openssl_dir_win32 result) - execute_process( - COMMAND where openssl - OUTPUT_VARIABLE OPENSSL_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + message(STATUS "Configuring macOS app bundle") - # It's possible that there are multiple OpenSSL installations on the system, - # which is the case on GitHub runners. - # For now we'll pick the first one, but that's probably not very robust. - # Maybe our choco config could install to a specific location? - string(REGEX REPLACE "\r?\n" ";" OPENSSL_PATH_LIST ${OPENSSL_PATH}) - message(STATUS "Found OpenSSL binaries at: ${OPENSSL_PATH_LIST}") + set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION}) - list(GET OPENSSL_PATH_LIST 0 OPENSSL_FIRST_PATH) - message(STATUS "First OpenSSL binary: ${OPENSSL_FIRST_PATH}") + set(CMAKE_INSTALL_RPATH + "@loader_path/../Libraries;@loader_path/../Frameworks") + set(SYNERGY_BUNDLE_SOURCE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}/res/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) - get_filename_component(OPENSSL_BIN_DIR ${OPENSSL_FIRST_PATH} DIRECTORY) - message(STATUS "OpenSSL bin dir: ${OPENSSL_BIN_DIR}") - - get_filename_component(OPENSSL_DIR ${OPENSSL_BIN_DIR} DIRECTORY) - message(STATUS "OpenSSL install root dir: ${OPENSSL_DIR}") + configure_files(${SYNERGY_BUNDLE_SOURCE_DIR} ${SYNERGY_BUNDLE_DIR}) - set(${result} ${OPENSSL_DIR} PARENT_SCOPE) -endfunction() - -# -# Windows installer -# -macro(configure_windows_packaging) - find_openssl_dir_win32(OPENSSL_PATH) - set(QT_PATH $ENV{CMAKE_PREFIX_PATH}) - configure_files (${CMAKE_CURRENT_SOURCE_DIR}/res/dist/wix ${CMAKE_BINARY_DIR}/installer) endmacro() # # Linux packages (including BSD and DragonFly) # macro(configure_linux_packaging) - configure_files (${CMAKE_CURRENT_SOURCE_DIR}/res/dist/rpm ${CMAKE_BINARY_DIR}/rpm) - install(FILES res/synergy.svg DESTINATION share/icons/hicolor/scalable/apps) - install(FILES res/synergy.desktop DESTINATION share/applications) + + message(STATUS "Configuring Linux packaging") + + set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION_LINUX}) + set(CPACK_GENERATOR "DEB;RPM;TGZ;STGZ") + + set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Synergy ") + set(CPACK_DEBIAN_PACKAGE_SECTION "utils") + + set(CPACK_RPM_PACKAGE_LICENSE "GPLv2") + set(CPACK_RPM_PACKAGE_GROUP "Applications/System") + + # The default for CMake seems to be /usr/local, which seems uncommon. While + # the default /usr/local prefix causes the app to appear on Debian and Fedora, + # it doesn't seem to appear on Arch Linux. Setting the prefix to /usr seems to + # work on a wider variety of distros, and that also seems to be where most + # apps install to. + set(CMAKE_INSTALL_PREFIX /usr) + + install(FILES res/dist/linux/synergy.desktop DESTINATION share/applications) + install(FILES res/synergy.png DESTINATION share/pixmaps) + + # Prepare PKGBUILD for Arch Linux + configure_file(res/dist/arch/PKGBUILD.in ${CMAKE_BINARY_DIR}/PKGBUILD @ONLY) + endmacro() # # Same as the `configure_file` command but for directories recursively. # -macro (configure_files srcDir destDir) - message (STATUS "Configuring directory ${destDir}") - make_directory (${destDir}) +macro(configure_files srcDir destDir) - file (GLOB_RECURSE sourceFiles RELATIVE ${srcDir} ${srcDir}/*) - file (GLOB_RECURSE templateFiles LIST_DIRECTORIES false RELATIVE ${srcDir} ${srcDir}/*.in) - list (REMOVE_ITEM sourceFiles ${templateFiles}) + message(STATUS "Configuring directory ${destDir}") + make_directory(${destDir}) - foreach (sourceFile ${sourceFiles}) - set (sourceFilePath ${srcDir}/${sourceFile}) - if (IS_DIRECTORY ${sourceFilePath}) - message (STATUS "Copying directory ${sourceFile}") - make_directory (${destDir}/${sourceFile}) - else() - message (STATUS "Copying file ${sourceFile}") - configure_file (${sourceFilePath} ${destDir}/${sourceFile} COPYONLY) - endif() - endforeach (sourceFile) + file( + GLOB_RECURSE sourceFiles + RELATIVE ${srcDir} + ${srcDir}/*) + file( + GLOB_RECURSE templateFiles + LIST_DIRECTORIES false + RELATIVE ${srcDir} + ${srcDir}/*.in) + list(REMOVE_ITEM sourceFiles ${templateFiles}) - foreach (templateFile ${templateFiles}) - set (sourceTemplateFilePath ${srcDir}/${templateFile}) - string (REGEX REPLACE "\.in$" "" templateFile ${templateFile}) - message (STATUS "Configuring file ${templateFile}") - configure_file (${sourceTemplateFilePath} ${destDir}/${templateFile} @ONLY) - endforeach (templateFile) -endmacro (configure_files) + foreach(sourceFile ${sourceFiles}) + set(sourceFilePath ${srcDir}/${sourceFile}) + if(IS_DIRECTORY ${sourceFilePath}) + message(STATUS "Copying directory ${sourceFile}") + make_directory(${destDir}/${sourceFile}) + else() + message(STATUS "Copying file ${sourceFile}") + configure_file(${sourceFilePath} ${destDir}/${sourceFile} COPYONLY) + endif() + + endforeach(sourceFile) + + foreach(templateFile ${templateFiles}) + + set(sourceTemplateFilePath ${srcDir}/${templateFile}) + string(REGEX REPLACE "\.in$" "" templateFile ${templateFile}) + message(STATUS "Configuring file ${templateFile}") + configure_file(${sourceTemplateFilePath} ${destDir}/${templateFile} @ONLY) + + endforeach(templateFile) + +endmacro(configure_files) + +# +# Find the OpenSSL directory on Windows based on the location of the first +# `openssl` binary found. +# +function(find_openssl_dir_win32 result) + + execute_process( + COMMAND where openssl + OUTPUT_VARIABLE OPENSSL_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # It's possible that there are multiple OpenSSL installations on the system, + # which is the case on GitHub runners. For now we'll pick the first one, but + # that's probably not very robust. Maybe our choco config could install to a + # specific location? + string(REGEX REPLACE "\r?\n" ";" OPENSSL_PATH_LIST ${OPENSSL_PATH}) + message(STATUS "Found OpenSSL binaries at: ${OPENSSL_PATH_LIST}") + + list(GET OPENSSL_PATH_LIST 0 OPENSSL_FIRST_PATH) + message(STATUS "First OpenSSL binary: ${OPENSSL_FIRST_PATH}") + + get_filename_component(OPENSSL_BIN_DIR ${OPENSSL_FIRST_PATH} DIRECTORY) + message(STATUS "OpenSSL bin dir: ${OPENSSL_BIN_DIR}") + + get_filename_component(OPENSSL_DIR ${OPENSSL_BIN_DIR} DIRECTORY) + message(STATUS "OpenSSL install root dir: ${OPENSSL_DIR}") + + set(${result} + ${OPENSSL_DIR} + PARENT_SCOPE) + +endfunction() diff --git a/cmake/Version.cmake b/cmake/Version.cmake index 4a05f8d38..cbf8c9da6 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -18,41 +18,77 @@ # On Windows, we also set a special 4-digit MSI version number. macro(set_version) - set (SYNERGY_VERSION $ENV{SYNERGY_VERSION}) + set(SYNERGY_VERSION $ENV{SYNERGY_VERSION}) + string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION) + + if(NOT SYNERGY_VERSION) + file(READ "${CMAKE_SOURCE_DIR}/VERSION" SYNERGY_VERSION) string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION) + endif() - if (NOT SYNERGY_VERSION) - file(READ "${CMAKE_SOURCE_DIR}/VERSION" SYNERGY_VERSION) - string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION) - endif() + message(STATUS "Version number (semver): " ${SYNERGY_VERSION}) + add_definitions(-DSYNERGY_VERSION="${SYNERGY_VERSION}") - message (STATUS "Version number: " ${SYNERGY_VERSION}) - add_definitions (-DSYNERGY_VERSION="${SYNERGY_VERSION}") - - # Useful for copyright (e.g. in macOS bundle .plist.in and Windows version .rc file) - string(TIMESTAMP SYNERGY_BUILD_YEAR "%Y") + # Useful for copyright (e.g. in macOS bundle .plist.in and Windows version .rc + # file) + string(TIMESTAMP SYNERGY_BUILD_YEAR "%Y") - # MSI requires a 4-digit number and doesn't accept semver. - if (WIN32) - string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ "${SYNERGY_VERSION}") - set(VERSION_MAJOR "${CMAKE_MATCH_1}") - set(VERSION_MINOR "${CMAKE_MATCH_2}") - set(VERSION_PATCH "${CMAKE_MATCH_3}") - - # Find the revision number, which is the number after the 'r'. - string(REGEX MATCH "r([0-9]+)$" _ "${SYNERGY_VERSION}") - set(VERSION_REVISION "${CMAKE_MATCH_1}") - if (NOT VERSION_REVISION) - set(VERSION_REVISION "0") - endif() - - # Dot-separated version number for MSI and Windows version .rc file. - set(SYNERGY_VERSION_MS "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_REVISION}") - message (STATUS "Version number for Microsoft (dots): " ${SYNERGY_VERSION_MS}) - - # CSV version number for Windows version .rc file. - set(SYNERGY_VERSION_MS_CSV "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}") - message (STATUS "Version number for Microsoft (CSV): " ${SYNERGY_VERSION_MS_CSV}) - endif() + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set_windows_version() + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set_linux_version() + endif() + +endmacro() + +macro(set_four_part_version) + + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ "${SYNERGY_VERSION}") + set(VERSION_MAJOR "${CMAKE_MATCH_1}") + set(VERSION_MINOR "${CMAKE_MATCH_2}") + set(VERSION_PATCH "${CMAKE_MATCH_3}") + + # Find the revision number, which is the number after the 'r'. + string(REGEX MATCH "r([0-9]+)$" _ "${SYNERGY_VERSION}") + set(VERSION_REVISION "${CMAKE_MATCH_1}") + if(NOT VERSION_REVISION) + set(VERSION_REVISION "0") + endif() + + set(SYNERGY_VERSION_FOUR_PART + "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_REVISION}") + +endmacro() + +# MSI requires a 4-digit number and doesn't accept semver. +macro(set_windows_version) + + set_four_part_version() + + # Dot-separated version number for MSI and Windows version .rc file. + set(SYNERGY_VERSION_MS ${SYNERGY_VERSION_FOUR_PART}) + message(STATUS "Version number for (Microsoft 4-part): " + ${SYNERGY_VERSION_MS}) + + # CSV version number for Windows version .rc file. + set(SYNERGY_VERSION_MS_CSV + "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}") + message(STATUS "Version number for (Microsoft CSV): " + ${SYNERGY_VERSION_MS_CSV}) +endmacro() + +macro(set_linux_version) + + # Replace the first occurrence of '-' with '~' for Linux versioning; the '-' + # char is reserved for use at at the end of the version string to indicate a + # package revision. Debian has always used this convention, but support for + # this was also introduced in RPM 4.10.0. + string(REGEX REPLACE "-" "~" SYNERGY_VERSION_LINUX "${SYNERGY_VERSION}") + message(STATUS "Version number (DEB/RPM): ${SYNERGY_VERSION_LINUX}") + + # Arch does not support SemVer or DEB/RPM version format, so use the four-part + # version format which funnily enough is what Microsoft requires for MSI. + set_four_part_version() + message(STATUS "Version number (4-part): ${SYNERGY_VERSION_FOUR_PART}") endmacro() diff --git a/config.yml b/config.yaml similarity index 52% rename from config.yml rename to config.yaml index 51b8a4337..c89e89b7a 100644 --- a/config.yml +++ b/config.yaml @@ -17,11 +17,11 @@ config: dependencies: command: brew bundle --file=Brewfile - # arch, opensuse, etc, patches welcome! :) linux: debian: &debian dependencies: - command: sudo apt-get update; sudo apt-get install -y \ + command: sudo apt-get update; \ + sudo apt-get install -y \ cmake \ make \ g++ \ @@ -29,35 +29,69 @@ config: libx11-dev \ libxtst-dev \ libssl-dev \ - pkg-config \ libglib2.0-dev \ libgdk-pixbuf-2.0-dev \ libnotify-dev \ libxkbfile-dev \ qtbase5-dev \ qttools5-dev \ - libgtk-3-dev \ - rpm + libgtk-3-dev ubuntu: <<: *debian fedora: &fedora dependencies: - command: sudo dnf check-update; sudo dnf install -y \ + command: sudo dnf check-update; \ + sudo dnf install -y \ cmake \ make \ gcc-c++ \ openssl-devel \ - libXtst-devel \ glib2-devel \ gdk-pixbuf2-devel \ + libXtst-devel \ libnotify-devel \ + libxkbfile-devel \ qt5-qtbase-devel \ qt5-qttools-devel \ - libxkbfile-devel \ gtk3-devel \ rpm-build - centos: - <<: *fedora + opensuse-tumbleweed: &opensuse-tumbleweed + dependencies: + command: sudo zypper refresh; \ + sudo zypper --non-interactive remove busybox-which; \ + sudo zypper install -y \ + cmake \ + make \ + gcc-c++ \ + openssl-devel \ + glib2-devel \ + gdk-pixbuf-devel \ + libXtst-devel \ + libnotify-devel \ + libxkbfile-devel \ + libqt5-qtbase-devel \ + libqt5-qttools-devel \ + gtk3-devel \ + rpm-build + + arch: &arch + dependencies: + command: sudo pacman -Syu --noconfirm \ + base-devel \ + cmake \ + gcc \ + openssl \ + glib2 \ + gdk-pixbuf2 \ + libxtst \ + libnotify \ + libxkbfile \ + qt5-base \ + qt5-tools \ + gtk3 + + manjaro: + <<: *arch diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144f..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index e1b4cd012..000000000 --- a/debian/control +++ /dev/null @@ -1,17 +0,0 @@ -Source: synergy -Section: utils -Priority: optional -Standards-Version: 3.9.7 -Homepage: https://www.symless.com/ -Maintainer: Symless - -Package: synergy -Architecture: any -Section: utils -Priority: optional -Depends: ${shlibs:Depends}, - ${misc:Depends} -Description: Keyboard and mouse sharing solution - Synergy allows you to share one mouse and keyboard between multiple computers. - Work seamlessly across Windows, macOS and Linux. -Homepage: https://symless.com/synergy diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index f9a5f5219..000000000 --- a/debian/copyright +++ /dev/null @@ -1,5 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Synergy -Source: https://www.symless.com/synergy -Disclaimer: This package is not part of the Debian project as it contains closed source proprietary components -Copyright: Copyright (C) 2012-2017 Symless Ltd diff --git a/debian/rules b/debian/rules deleted file mode 100755 index d4d5a171a..000000000 --- a/debian/rules +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/make -f - -%: - dh $@ --buildsystem=cmake --builddirectory=build --parallel - diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db8f..000000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides deleted file mode 100644 index ab1240797..000000000 --- a/debian/source/lintian-overrides +++ /dev/null @@ -1,2 +0,0 @@ -file-without-copyright-information -binary-without-manpage diff --git a/doc/QtCodeStyle.xml b/doc/QtCodeStyle.xml deleted file mode 100644 index b07d20da2..000000000 --- a/doc/QtCodeStyle.xml +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - CodeStyleData - - false - false - true - false - false - false - true - false - true - false - false - false - true - true - false - true - false - false - false - 4 - true - false - 2 - false - 4 - - - - DisplayName - Synergy - - - - - - - - CodeStyleData - - false - false - true - false - false - false - true - false - true - false - false - false - true - true - false - true - false - false - false - 4 - true - false - 2 - false - 4 - - - - DisplayName - Synergy - - - - - - - - CodeStyleData - - false - false - true - false - false - false - true - false - true - false - false - false - true - true - false - true - false - false - false - 4 - true - false - 2 - false - 4 - - - - DisplayName - Synergy - - - - - - - - CodeStyleData - - false - false - true - false - false - false - true - false - true - false - false - false - true - true - false - true - false - false - false - 4 - true - false - 2 - false - 4 - - - - DisplayName - Synergy - - - - - - - - CodeStyleData - - false - false - true - false - false - false - true - false - true - false - false - false - true - true - false - true - false - false - false - 4 - true - false - 2 - false - 4 - - - - DisplayName - Synergy - - - - - - - - CodeStyleData - - false - false - true - false - false - false - true - false - true - false - false - false - true - true - false - true - false - false - false - 4 - true - false - 2 - false - 4 - - - - DisplayName - Synergy - - diff --git a/doc/org.synergy-foss.org.synergyc.plist b/doc/org.synergy-foss.org.synergyc.plist deleted file mode 100644 index 385ad74b3..000000000 --- a/doc/org.synergy-foss.org.synergyc.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Label - org.symless.com.synergyc.plist - OnDemand - - ProgramArguments - - /usr/bin/synergyc - - 192.168.0.2 - - RunAtLoad - - - diff --git a/doc/org.synergy-foss.org.synergys.plist b/doc/org.synergy-foss.org.synergys.plist deleted file mode 100644 index 116615d1f..000000000 --- a/doc/org.synergy-foss.org.synergys.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Label - org.symless.com.synergys.plist - OnDemand - - ProgramArguments - - /usr/bin/synergys - --no-daemon - --config - - /Users/snorp/.synergy.conf - - RunAtLoad - - - diff --git a/doc/synergyc.man b/doc/synergyc.man deleted file mode 100644 index 29e6ac873..000000000 --- a/doc/synergyc.man +++ /dev/null @@ -1,84 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.11. -.TH SYNERGYC "1" "February 2020" "synergyc 1.11.0-stable, protocol version 1.6" "User Commands" -.SH NAME -synergyc \- manual page for synergyc 1.11.0-stable, protocol version 1.6 -.SH SYNOPSIS -.B synergyc -[\fI\,--yscroll \/\fR] [\fI\,--display \/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name \/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug \/\fR] \fI\,\/\fR -.SH DESCRIPTION -Connect to a synergy mouse/keyboard sharing server. -.TP -\fB\-d\fR, \fB\-\-debug\fR -filter out log messages with priority below level. -level may be: FATAL, ERROR, WARNING, NOTE, INFO, -DEBUG, DEBUG1, DEBUG2. -.TP -\fB\-n\fR, \fB\-\-name\fR use screen\-name instead the hostname to identify -this screen in the configuration. -.TP -\fB\-1\fR, \fB\-\-no\-restart\fR -do not try to restart on failure. -.PP -* \fB\-\-restart\fR restart the server automatically if it fails. -.TP -\fB\-l\fR \fB\-\-log\fR -write log messages to file. -.TP -\fB\-\-no\-tray\fR -disable the system tray icon. -.TP -\fB\-\-enable\-drag\-drop\fR -enable file drag & drop. -.TP -\fB\-\-enable\-crypto\fR -enable the crypto (ssl) plugin. -.TP -\fB\-\-display\fR -connect to the X server at -.TP -\fB\-\-no\-xinitthreads\fR -do not call XInitThreads() -.TP -\fB\-f\fR, \fB\-\-no\-daemon\fR -run in the foreground. -.PP -* \fB\-\-daemon\fR run as a daemon. -.TP -\fB\-\-yscroll\fR -defines the vertical scrolling delta, which is -120 by default. -.TP -\fB\-h\fR, \fB\-\-help\fR -display this help and exit. -.TP -\fB\-\-version\fR -display version information and exit. -.PP -* marks defaults. -.PP -The server address is of the form: [][:]. The hostname -must be the address or hostname of the server. The port overrides the -default port, 24800. -.PP -synergyc: a server address or name is required -Try `synergyc \fB\-\-help\fR' for more information. -.SH COPYRIGHT -Copyright \(co 2012\-2019 Symless Ltd. -.br -Copyright \(co 2008\-2014 Nick Bolton -.br -Copyright \(co 2002\-2014 Chris Schoeneman -synergyc: a server address or name is required -Try `synergyc \fB\-\-help\fR' for more information. -.SH "SEE ALSO" -The full documentation for -.B synergyc -is maintained as a Texinfo manual. If the -.B info -and -.B synergyc -programs are properly installed at your site, the command -.IP -.B info synergyc -.PP -should give you access to the complete manual. diff --git a/doc/synergys.man b/doc/synergys.man deleted file mode 100644 index 337b4725f..000000000 --- a/doc/synergys.man +++ /dev/null @@ -1,88 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.11. -.TH SYNERGYS "1" "February 2020" "synergys 1.11.0-stable, protocol version 1.6" "User Commands" -.SH NAME -synergys \- manual page for synergys 1.11.0-stable, protocol version 1.6 -.SH SYNOPSIS -.B synergys -[\fI\,--address
\/\fR] [\fI\,--config \/\fR] [\fI\,--display \/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name \/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug \/\fR] -.SH DESCRIPTION -Start the synergy mouse/keyboard sharing server. -.TP -\fB\-a\fR, \fB\-\-address\fR
-listen for clients on the given address. -.TP -\fB\-c\fR, \fB\-\-config\fR -use the named configuration file instead. -.TP -\fB\-d\fR, \fB\-\-debug\fR -filter out log messages with priority below level. -level may be: FATAL, ERROR, WARNING, NOTE, INFO, -DEBUG, DEBUG1, DEBUG2. -.TP -\fB\-n\fR, \fB\-\-name\fR use screen\-name instead the hostname to identify -this screen in the configuration. -.TP -\fB\-1\fR, \fB\-\-no\-restart\fR -do not try to restart on failure. -.PP -* \fB\-\-restart\fR restart the server automatically if it fails. -.TP -\fB\-l\fR \fB\-\-log\fR -write log messages to file. -.TP -\fB\-\-no\-tray\fR -disable the system tray icon. -.TP -\fB\-\-enable\-drag\-drop\fR -enable file drag & drop. -.TP -\fB\-\-enable\-crypto\fR -enable the crypto (ssl) plugin. -.TP -\fB\-\-display\fR -connect to the X server at -.TP -\fB\-\-no\-xinitthreads\fR -do not call XInitThreads() -.TP -\fB\-f\fR, \fB\-\-no\-daemon\fR -run in the foreground. -.PP -* \fB\-\-daemon\fR run as a daemon. -.TP -\fB\-h\fR, \fB\-\-help\fR -display this help and exit. -.TP -\fB\-\-version\fR -display version information and exit. -.PP -* marks defaults. -.PP -The argument for \fB\-\-address\fR is of the form: [][:]. The -hostname must be the address or hostname of an interface on the system. -The default is to listen on all interfaces. The port overrides the -default port, 24800. -.PP -If no configuration file pathname is provided then the first of the -following to load successfully sets the configuration: -.IP -$HOME/.synergy.conf -\fI\,/etc/synergy.conf\/\fP -.SH COPYRIGHT -Copyright \(co 2012\-2019 Symless Ltd. -.br -Copyright \(co 2008\-2014 Nick Bolton -.br -Copyright \(co 2002\-2014 Chris Schoeneman -.SH "SEE ALSO" -The full documentation for -.B synergys -is maintained as a Texinfo manual. If the -.B info -and -.B synergys -programs are properly installed at your site, the command -.IP -.B info synergys -.PP -should give you access to the complete manual. diff --git a/res/Readme.txt b/res/Readme.txt deleted file mode 100644 index e4bfb1752..000000000 --- a/res/Readme.txt +++ /dev/null @@ -1,12 +0,0 @@ -Thank you for chosing Synergy! -http://symless.com/ - -Synergy allows you to share your keyboard and mouse between computers over a network. - -For FAQ, setup, and usage instructions, please visit our online Readme: -http://symless.com/pm/projects/synergy/wiki/Readme - -Have fun! - -Thanks, -The Synergy Team diff --git a/res/dist/arch/PKGBUILD.in b/res/dist/arch/PKGBUILD.in new file mode 100644 index 000000000..fdbf65477 --- /dev/null +++ b/res/dist/arch/PKGBUILD.in @@ -0,0 +1,33 @@ +# Maintainer: Synergy team + +pkgname=synergy +pkgver=@SYNERGY_VERSION_FOUR_PART@ +pkgrel=1 +pkgdesc="Mouse and keyboard sharing utility" +url='https://symless.com/synergy/' +arch=('x86_64') +license=('GPL-2.0-only') +depends=( + 'gcc-libs' + 'glibc' + 'openssl' + 'libx11' + 'libxi' + 'libxkbfile' + 'libxext' + 'libxtst' + 'libxinerama' + 'libxkbcommon-x11' + 'libnotify' + 'hicolor-icon-theme' + 'qt5-base' +) +conflicts=('synergy-git' 'synergy1-bin' 'synergy2-bin' 'synergy3-bin') + +package() { + # By default, `makepkg` will run from the `src` directory, which would + # only install the binaries, and not the .desktop file, etc. To install + # everything, we need to run `make install` with the root Makefile. + cd $startdir + make install DESTDIR=$pkgdir +} diff --git a/flatpak/flatpak-desktop.patch b/res/dist/flatpak/flatpak-desktop.patch similarity index 100% rename from flatpak/flatpak-desktop.patch rename to res/dist/flatpak/flatpak-desktop.patch diff --git a/flatpak/synergy-business.yml b/res/dist/flatpak/synergy-business.yml similarity index 100% rename from flatpak/synergy-business.yml rename to res/dist/flatpak/synergy-business.yml diff --git a/flatpak/synergy-enterprise.yml b/res/dist/flatpak/synergy-enterprise.yml similarity index 100% rename from flatpak/synergy-enterprise.yml rename to res/dist/flatpak/synergy-enterprise.yml diff --git a/flatpak/synergy.yml b/res/dist/flatpak/synergy.yml similarity index 100% rename from flatpak/synergy.yml rename to res/dist/flatpak/synergy.yml diff --git a/res/synergy.desktop b/res/dist/linux/synergy.desktop similarity index 81% rename from res/synergy.desktop rename to res/dist/linux/synergy.desktop index fa987bdf5..6a62168d6 100644 --- a/res/synergy.desktop +++ b/res/dist/linux/synergy.desktop @@ -2,7 +2,7 @@ Type=Application Version=1.0 Name=Synergy -Comment=Keyboard and mouse sharing solution +Comment=Mouse and keyboard sharing utility Path=/usr/bin Exec=/usr/bin/synergy Icon=synergy diff --git a/res/dist/rpm/synergy-business.spec.in b/res/dist/rpm/synergy-business.spec.in deleted file mode 100644 index 6cc117663..000000000 --- a/res/dist/rpm/synergy-business.spec.in +++ /dev/null @@ -1,32 +0,0 @@ -%define _rpmfilename %%{NAME}_%%{Version}-%%{Release}.rpm - -Name: synergy-business -Version: @SYNERGY_VERSION@ -Summary: Keyboard and mouse sharing solution -Group: Applications/Productivity -URL: https://symless.com/synergy -Source: https://symless.com/synergy/downloads -Vendor: Symless -Packager: Symless -License: GPLv2 -Epoch: 1 -Release: @SYNERGY_VERSION@%{?dist} -Requires: openssl - -%description -Synergy allows you to share one mouse and keyboard between multiple computers. -Work seamlessly across Windows, macOS and Linux. - -%files -%defattr(755,root,root,-) -%{_bindir}/synergy -%{_bindir}/synergyc -%{_bindir}/synergys -%{_bindir}/syntool -%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop -%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/synergy.svg -%exclude %{_bindir}/synergy-core - -%changelog -* Wed Apr 26 2017 Symless -- Initial version of the package diff --git a/res/dist/rpm/synergy-enterprise.spec.in b/res/dist/rpm/synergy-enterprise.spec.in deleted file mode 100644 index 7310f2dcc..000000000 --- a/res/dist/rpm/synergy-enterprise.spec.in +++ /dev/null @@ -1,32 +0,0 @@ -%define _rpmfilename %%{NAME}_%%{Version}-%%{Release}.rpm - -Name: synergy-enterprise -Version: @SYNERGY_VERSION@ -Summary: Keyboard and mouse sharing solution -Group: Applications/Productivity -URL: https://symless.com/synergy -Source: https://symless.com/synergy/downloads -Vendor: Symless -Packager: Symless -License: GPLv2 -Epoch: 1 -Release: @SYNERGY_VERSION@%{?dist} -Requires: openssl - -%description -Synergy allows you to share one mouse and keyboard between multiple computers. -Work seamlessly across Windows, macOS and Linux. - -%files -%defattr(755,root,root,-) -%{_bindir}/synergy -%{_bindir}/synergyc -%{_bindir}/synergys -%{_bindir}/syntool -%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop -%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/synergy.svg -%exclude %{_bindir}/synergy-core - -%changelog -* Wed Apr 26 2017 Symless -- Initial version of the package diff --git a/res/dist/rpm/synergy.spec.in b/res/dist/rpm/synergy.spec.in deleted file mode 100644 index 64c2fc9ef..000000000 --- a/res/dist/rpm/synergy.spec.in +++ /dev/null @@ -1,32 +0,0 @@ -%define _rpmfilename %%{NAME}_%%{VERSION}-%%{RELEASE}.rpm - -Name: synergy -Version: @SYNERGY_VERSION@ -Summary: Keyboard and mouse sharing solution -Group: Applications/Productivity -URL: https://symless.com/synergy -Source: https://symless.com/synergy/downloads -Vendor: Symless -Packager: Symless -License: GPLv2 -Epoch: 1 -Release: @SYNERGY_VERSION@%{?dist} -Requires: openssl - -%description -Synergy allows you to share one mouse and keyboard between multiple computers. -Work seamlessly across Windows, macOS and Linux. - -%files -%defattr(755,root,root,-) -%{_bindir}/synergy -%{_bindir}/synergyc -%{_bindir}/synergys -%{_bindir}/syntool -%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop -%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/synergy.svg -%exclude %{_bindir}/synergy-core - -%changelog -* Wed Apr 26 2017 Symless -- Initial version of the package diff --git a/res/dist/wix/Product.wxs b/res/dist/wix/Product.wxs index f4bd5f861..df562ed6c 100644 --- a/res/dist/wix/Product.wxs +++ b/res/dist/wix/Product.wxs @@ -44,10 +44,10 @@ common_background - + - - + + diff --git a/res/dist/wix/SynergyWelcome.wxs b/res/dist/wix/SynergyWelcome.wxs index 380d11059..f2b716320 100644 --- a/res/dist/wix/SynergyWelcome.wxs +++ b/res/dist/wix/SynergyWelcome.wxs @@ -7,7 +7,7 @@ welcome_background - + diff --git a/res/banner.png b/res/dist/wix/images/banner.png similarity index 100% rename from res/banner.png rename to res/dist/wix/images/banner.png diff --git a/res/common_background.png b/res/dist/wix/images/common_background.png similarity index 100% rename from res/common_background.png rename to res/dist/wix/images/common_background.png diff --git a/res/dialog.png b/res/dist/wix/images/dialog.png similarity index 100% rename from res/dialog.png rename to res/dist/wix/images/dialog.png diff --git a/res/welcome_background.png b/res/dist/wix/images/welcome_background.png similarity index 100% rename from res/welcome_background.png rename to res/dist/wix/images/welcome_background.png diff --git a/res/synergy.png b/res/synergy.png new file mode 100644 index 0000000000000000000000000000000000000000..15da1fa2e85e8efc16f9ff864057d42d411641e7 GIT binary patch literal 22516 zcmb@ug;!MH_dk4x8U-mS1%?zU0TmG#YJfrTjg)jFf=K5uGy^IvAt)k^DBURyQi62% zNW;+G^SgY$>-i5J)?&fBbM86&>^iR=A(zXZSy67bJ~ z$M6~W=cbdAzAFHb=3oCpgtoR`fDiAwDd@RrI=*p3zjCnz&}g)vwS%qe>sL;ef{rd$ ziCdD40Kf)3N6Kn>ByG%i`p_NL<9Cm(dd2lI#hhW)|5|Pz-9xbPZB5cwkWCBP*pCpE zSB_3;Pno)I7MLGM=^25Tjp)S(!l`qtg4z>uV#28j zuCsj|zdPjRzIyUTpDs!;A&~#S|HN^&!Z9JG**eJ@hB|2eok3&ildmgrO}q0zT1tq= zC6h`M&;@&IC}GP^**b%GBV)%nhHjpk-s7c0gW$7 z{-=A9-V(2FOplvU-y$m43XlaN%N)Y9RjBgS6=DH?thmt8#G|)|`T8xIq)2^`+H7Mj zzC7In2Iy;~hsXY0#71n3zpu9NSkV%J6jt*a*~5dx+aqU7vr>PRR@02kw$Im273? ztA|LEk3glIR|Jxt+7YVVrE&(+By~i7l(0%Bqy?(UY7nP&)`SM8^{iJ@{`cHP$M*Cr z=t5;l3_SQZ?nsk$CIIH6Dzwfwt9X5n`0pN{Z2q1-SCYa6OLFg?|KMz_ zX?y&Uhe-@jxA?3*#uaAX#?ZW9NVM}DAZ~vi_pVN`his6c(d`?(pUeAk2Ky>Qt`K$zoA%w#Z~LggPd%?-tDIu zm7oT+YvmT|J4d!B*<|~X)cHnbaD8TJd~@n2NFn)kiEmFP8O`M+q7Cf)#)xvhQ^>h6bm6M~#@Dhhx$WTD_1LG9XR5uepU}x&mAa z_!@4em7yqOip*#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k>Cv{PT|}$DzwnDSM$t7cibK}mlT@dASTZ_g{PAPUL|oM zS(*$DWNcFJB!t{c6Yam9URH`Qnr5~%41}`Y&+NPS&DaR?Jsq`b1y#l9{l7n3OJbOG aaH(@cGPG_gorTnM1s. -include_directories (./lib) -include_directories (${CMAKE_CURRENT_BINARY_DIR}/lib) +include_directories(./lib) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/lib) add_subdirectory(lib) add_subdirectory(cmd) -if (SYNERGY_BUILD_GUI) - add_subdirectory(gui) -endif (SYNERGY_BUILD_GUI) +if(SYNERGY_BUILD_GUI) + add_subdirectory(gui) +endif(SYNERGY_BUILD_GUI) -if (BUILD_TESTS) - add_subdirectory(test) +if(BUILD_TESTS) + add_subdirectory(test) endif() diff --git a/src/cmd/CMakeLists.txt b/src/cmd/CMakeLists.txt index f78289d0d..c745d045c 100644 --- a/src/cmd/CMakeLists.txt +++ b/src/cmd/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2011 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -15,10 +15,10 @@ # along with this program. If not, see . add_subdirectory(synergyd) -if (UNIFIED_CORE) - add_subdirectory(synergy-core) +if(UNIFIED_CORE) + add_subdirectory(synergy-core) else() - add_subdirectory(synergyc) - add_subdirectory(synergys) -endif (UNIFIED_CORE) + add_subdirectory(synergyc) + add_subdirectory(synergys) +endif(UNIFIED_CORE) add_subdirectory(syntool) diff --git a/src/cmd/synergy-core/CMakeLists.txt b/src/cmd/synergy-core/CMakeLists.txt index 5ab1c488d..b99ca1aae 100644 --- a/src/cmd/synergy-core/CMakeLists.txt +++ b/src/cmd/synergy-core/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2022 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -16,24 +16,30 @@ set(target synergy-core) -set(sources - ${target}.cpp -) +set(sources ${target}.cpp) -if (WIN32) - list(APPEND sources - ${target}.exe.manifest - ${CMAKE_BINARY_DIR}/src/version.rc - ) +if(WIN32) + list(APPEND sources ${target}.exe.manifest ${CMAKE_BINARY_DIR}/src/version.rc) endif() add_executable(${target} ${sources}) -target_link_libraries(${target} - arch base client common io mt net ipc platform server synlib ${libs}) +target_link_libraries( + ${target} + arch + base + client + common + io + mt + net + ipc + platform + server + synlib + ${libs}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - install (TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - install (TARGETS ${target} DESTINATION bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(TARGETS ${target} DESTINATION bin) endif() - diff --git a/src/cmd/synergyc/CMakeLists.txt b/src/cmd/synergyc/CMakeLists.txt index 556c9f2ea..8f3a5f01b 100644 --- a/src/cmd/synergyc/CMakeLists.txt +++ b/src/cmd/synergyc/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -16,46 +16,56 @@ set(target synergyc) -set(sources - ${target}.cpp -) +set(sources ${target}.cpp) -if (WIN32) - file(GLOB arch_headers "MSWindows*.h") - file(GLOB arch_sources "MSWindows*.cpp") - list(APPEND sources - resource.h - ${target}.ico - ${target}.rc - tb_error.ico - tb_idle.ico - tb_run.ico - tb_wait.ico - ${target}.exe.manifest - ${CMAKE_BINARY_DIR}/src/version.rc - ) -elseif (APPLE) - file(GLOB arch_headers "OSX*.h") - file(GLOB arch_sources "OSX*.cpp") -elseif (UNIX) - file(GLOB arch_headers "XWindows*.h") - file(GLOB arch_sources "XWindows*.cpp") +if(WIN32) + file(GLOB arch_headers "MSWindows*.h") + file(GLOB arch_sources "MSWindows*.cpp") + list( + APPEND + sources + resource.h + ${target}.ico + ${target}.rc + tb_error.ico + tb_idle.ico + tb_run.ico + tb_wait.ico + ${target}.exe.manifest + ${CMAKE_BINARY_DIR}/src/version.rc) +elseif(APPLE) + file(GLOB arch_headers "OSX*.h") + file(GLOB arch_sources "OSX*.cpp") +elseif(UNIX) + file(GLOB arch_headers "XWindows*.h") + file(GLOB arch_sources "XWindows*.cpp") endif() list(APPEND sources ${arch_sources}) list(APPEND headers ${arch_headers}) -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_executable(${target} ${sources}) -target_link_libraries(${target} - arch base client common io mt net ipc platform server synlib ${libs}) +target_link_libraries( + ${target} + arch + base + client + common + io + mt + net + ipc + platform + server + synlib + ${libs}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - install (TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - install (TARGETS ${target} DESTINATION bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(TARGETS ${target} DESTINATION bin) endif() - diff --git a/src/cmd/synergyd/CMakeLists.txt b/src/cmd/synergyd/CMakeLists.txt index dcd4e108a..d6087a163 100644 --- a/src/cmd/synergyd/CMakeLists.txt +++ b/src/cmd/synergyd/CMakeLists.txt @@ -1,6 +1,6 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2012 Nick Bolton +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton # # This package is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -19,16 +19,22 @@ set(target synergyd) file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (WIN32) - add_executable ( - ${target} - WIN32 - ${sources} - ${CMAKE_BINARY_DIR}/src/version.rc - ) +if(WIN32) + add_executable(${target} WIN32 ${sources} ${CMAKE_BINARY_DIR}/src/version.rc) else() - add_executable (${target} ${sources}) + add_executable(${target} ${sources}) endif() -target_link_libraries (${target} - arch base common io ipc mt net platform synlib shared ${libs}) +target_link_libraries( + ${target} + arch + base + common + io + ipc + mt + net + platform + synlib + shared + ${libs}) diff --git a/src/cmd/synergys/CMakeLists.txt b/src/cmd/synergys/CMakeLists.txt index ca084ef5f..60942febe 100644 --- a/src/cmd/synergys/CMakeLists.txt +++ b/src/cmd/synergys/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -16,47 +16,56 @@ set(target synergys) -set(sources - ${target}.cpp -) +set(sources ${target}.cpp) -if (WIN32) - file(GLOB arch_headers "MSWindows*.h") - file(GLOB arch_sources "MSWindows*.cpp") - list(APPEND sources - resource.h - ${target}.ico - ${target}.rc - tb_error.ico - tb_idle.ico - tb_run.ico - tb_wait.ico - ${target}.exe.manifest - ${CMAKE_BINARY_DIR}/src/version.rc - ) -elseif (APPLE) - file(GLOB arch_headers "OSX*.h") - file(GLOB arch_sources "OSX*.cpp") -elseif (UNIX) - file(GLOB arch_headers "XWindows*.h") - file(GLOB arch_sources "XWindows*.cpp") +if(WIN32) + file(GLOB arch_headers "MSWindows*.h") + file(GLOB arch_sources "MSWindows*.cpp") + list( + APPEND + sources + resource.h + ${target}.ico + ${target}.rc + tb_error.ico + tb_idle.ico + tb_run.ico + tb_wait.ico + ${target}.exe.manifest + ${CMAKE_BINARY_DIR}/src/version.rc) +elseif(APPLE) + file(GLOB arch_headers "OSX*.h") + file(GLOB arch_sources "OSX*.cpp") +elseif(UNIX) + file(GLOB arch_headers "XWindows*.h") + file(GLOB arch_sources "XWindows*.cpp") endif() list(APPEND sources ${arch_sources}) list(APPEND headers ${arch_headers}) -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_executable(${target} ${sources}) -target_link_libraries(${target} - arch base client common io mt net ipc platform server synlib ${libs}) +target_link_libraries( + ${target} + arch + base + client + common + io + mt + net + ipc + platform + server + synlib + ${libs}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - install (TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - install (TARGETS ${target} DESTINATION bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(TARGETS ${target} DESTINATION bin) endif() - - diff --git a/src/cmd/syntool/CMakeLists.txt b/src/cmd/syntool/CMakeLists.txt index f6b79299b..b59d0787e 100644 --- a/src/cmd/syntool/CMakeLists.txt +++ b/src/cmd/syntool/CMakeLists.txt @@ -1,10 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2014-2016 Symless Ltd. -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -18,16 +19,28 @@ set(target syntool) file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (WIN32) - list(APPEND sources ${CMAKE_BINARY_DIR}/src/version.rc) +if(WIN32) + list(APPEND sources ${CMAKE_BINARY_DIR}/src/version.rc) endif() add_executable(${target} ${sources}) -target_link_libraries(${target} - synlib arch base client common io ipc mt net platform server ${libs}) +target_link_libraries( + ${target} + synlib + arch + base + client + common + io + ipc + mt + net + platform + server + ${libs}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - install (TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - install (TARGETS ${target} DESTINATION bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(TARGETS ${target} DESTINATION bin) endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 5e7aab45a..c12da2efb 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,108 +1,106 @@ -find_package (Qt5 COMPONENTS Core Widgets Network LinguistTools) -set (CMAKE_AUTOMOC ON) -set (CMAKE_AUTORCC ON) -set (CMAKE_AUTOUIC ON) -set (CMAKE_INCLUDE_CURRENT_DIR ON) +find_package(Qt5 COMPONENTS Core Widgets Network LinguistTools) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -file (GLOB GUI_SOURCE_FILES - src/*.cpp - src/*.h - src/validators/* - src/widgets/* -) -file (GLOB GUI_UI_FILES src/*.ui) -file (GLOB ACTIVATION_FILES src/*Activation* src/*License*) -file (GLOB ZEROCONF_FILES src/Zeroconf*) -file (GLOB LANGUAGE_FILES res/lang/*.ts) +file(GLOB GUI_SOURCE_FILES src/*.cpp src/*.h src/validators/* src/widgets/*) +file(GLOB GUI_UI_FILES src/*.ui) +file(GLOB ACTIVATION_FILES src/*Activation* src/*License*) +file(GLOB ZEROCONF_FILES src/Zeroconf*) +file(GLOB LANGUAGE_FILES res/lang/*.ts) configure_file(res/Languages.qrc res/Languages.qrc) -set_source_files_properties(${LANGUAGE_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/res/lang") +set_source_files_properties( + ${LANGUAGE_FILES} PROPERTIES OUTPUT_LOCATION + "${CMAKE_CURRENT_BINARY_DIR}/res/lang") qt5_add_translation(QM_FILES ${LANGUAGE_FILES}) add_custom_target(translations ALL DEPENDS ${QM_FILES}) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - file (GLOB GUI_MAC_SOURCE_FILES src/*.mm) - list (APPEND GUI_SOURCE_FILES ${GUI_MAC_SOURCE_FILES}) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + file(GLOB GUI_MAC_SOURCE_FILES src/*.mm) + list(APPEND GUI_SOURCE_FILES ${GUI_MAC_SOURCE_FILES}) endif() -# Retrieve the absolute path to qmake and then use that path to find -# the binaries +# Retrieve the absolute path to qmake and then use that path to find the +# binaries get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}") find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}") -if (SYNERGY_ENTERPRISE) - list (REMOVE_ITEM GUI_SOURCE_FILES ${ACTIVATION_FILES}) - list (REMOVE_ITEM GUI_UI_FILES ${ACTIVATION_FILES}) -endif () - -list (REMOVE_ITEM GUI_SOURCE_FILES ${ZEROCONF_FILES}) - - -if (WIN32) - set (GUI_RC_FILES - res/win/Synergy.rc - ${CMAKE_BINARY_DIR}/src/version.rc - ) +if(SYNERGY_ENTERPRISE) + list(REMOVE_ITEM GUI_SOURCE_FILES ${ACTIVATION_FILES}) + list(REMOVE_ITEM GUI_UI_FILES ${ACTIVATION_FILES}) endif() -add_executable (synergy WIN32 - ${GUI_SOURCE_FILES} - ${GUI_UI_FILES} - ${GUI_RC_FILES} - res/Synergy.qrc - ${CMAKE_CURRENT_BINARY_DIR}/res/Languages.qrc - ${QM_FILES} -) +list(REMOVE_ITEM GUI_SOURCE_FILES ${ZEROCONF_FILES}) -include_directories (./src) -target_link_libraries (synergy shared) +if(WIN32) + set(GUI_RC_FILES res/win/Synergy.rc ${CMAKE_BINARY_DIR}/src/version.rc) +endif() + +add_executable( + synergy WIN32 + ${GUI_SOURCE_FILES} ${GUI_UI_FILES} ${GUI_RC_FILES} res/Synergy.qrc + ${CMAKE_CURRENT_BINARY_DIR}/res/Languages.qrc ${QM_FILES}) + +include_directories(./src) +target_link_libraries(synergy shared) target_link_libraries(synergy Qt5::Core Qt5::Widgets Qt5::Network) -target_compile_definitions (synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}") -target_compile_definitions (synergy PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}") +target_compile_definitions( + synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}") +target_compile_definitions(synergy + PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}") -if (WIN32) - set_target_properties (synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") +if(WIN32) + set_target_properties(synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT") endif() -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - install (TARGETS synergy DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) - install (CODE "MESSAGE (\"Running macdeployqt to install frameworks in bundle\")") - install (CODE "execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${SYNERGY_BUNDLE_APP_DIR} -always-overwrite)") -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - install (TARGETS synergy DESTINATION bin) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + install(TARGETS synergy DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR}) + install( + CODE "MESSAGE (\"Running macdeployqt to install frameworks in bundle\")") + install( + CODE "execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${SYNERGY_BUNDLE_APP_DIR} -always-overwrite)" + ) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + install(TARGETS synergy DESTINATION bin) endif() -if (WIN32) - if(Qt5_FOUND AND WIN32 AND TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt) - get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION) +if(WIN32) + if(Qt5_FOUND + AND WIN32 + AND TARGET Qt5::qmake + AND NOT TARGET Qt5::windeployqt) + get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION) - execute_process( - COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX - RESULT_VARIABLE return_code - OUTPUT_VARIABLE qt5_install_prefix - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + execute_process( + COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX + RESULT_VARIABLE return_code + OUTPUT_VARIABLE qt5_install_prefix + OUTPUT_STRIP_TRAILING_WHITESPACE) - set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe") + set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe") - if(EXISTS ${imported_location}) - add_executable(Qt5::windeployqt IMPORTED) + if(EXISTS ${imported_location}) + add_executable(Qt5::windeployqt IMPORTED) - set_target_properties(Qt5::windeployqt PROPERTIES IMPORTED_LOCATION ${imported_location}) - endif() - endif() - if(TARGET Qt5::windeployqt) - # execute windeployqt in a tmp directory after build - add_custom_command(TARGET synergy - POST_BUILD - COMMAND set PATH=%PATH%$${qt5_install_prefix}/bin - COMMAND Qt5::windeployqt "$/$" - ) + set_target_properties(Qt5::windeployqt PROPERTIES IMPORTED_LOCATION + ${imported_location}) endif() + endif() + if(TARGET Qt5::windeployqt) + # execute windeployqt in a tmp directory after build + add_custom_command( + TARGET synergy + POST_BUILD + COMMAND set PATH=%PATH%$${qt5_install_prefix}/bin + COMMAND Qt5::windeployqt + "$/$") + endif() endif() diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 6a117e2ae..b4b052f16 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 diff --git a/src/lib/arch/CMakeLists.txt b/src/lib/arch/CMakeLists.txt index 59ec1ff54..9ac716257 100644 --- a/src/lib/arch/CMakeLists.txt +++ b/src/lib/arch/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,33 +17,33 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() # arch -if (WIN32) - file(GLOB arch_headers "win32/*.h") - file(GLOB arch_sources "win32/*.cpp") -elseif (UNIX) - file(GLOB arch_headers "unix/*.h") - file(GLOB arch_sources "unix/*.cpp") +if(WIN32) + file(GLOB arch_headers "win32/*.h") + file(GLOB arch_sources "win32/*.cpp") +elseif(UNIX) + file(GLOB arch_headers "unix/*.h") + file(GLOB arch_sources "unix/*.cpp") endif() list(APPEND sources ${arch_sources}) list(APPEND headers ${arch_headers}) -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(arch STATIC ${sources}) -if (UNIX) - target_link_libraries(arch ${CMAKE_DL_LIBS} ${libs}) +if(UNIX) + target_link_libraries(arch ${CMAKE_DL_LIBS} ${libs}) - if (NOT APPLE) - find_package (Qt5 COMPONENTS DBus) - target_link_libraries (arch Qt5::DBus) - endif() + if(NOT APPLE) + find_package(Qt5 COMPONENTS DBus) + target_link_libraries(arch Qt5::DBus) + endif() endif() diff --git a/src/lib/base/CMakeLists.txt b/src/lib/base/CMakeLists.txt index 30d0e9326..3a6416bab 100644 --- a/src/lib/base/CMakeLists.txt +++ b/src/lib/base/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,12 +17,12 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(base STATIC ${sources}) -if (UNIX) - target_link_libraries(base common) +if(UNIX) + target_link_libraries(base common) endif() diff --git a/src/lib/client/CMakeLists.txt b/src/lib/client/CMakeLists.txt index 3e8dc7fcb..298a02274 100644 --- a/src/lib/client/CMakeLists.txt +++ b/src/lib/client/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,12 +17,12 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(client STATIC ${sources}) -if (UNIX) - target_link_libraries(client synlib io) +if(UNIX) + target_link_libraries(client synlib io) endif() diff --git a/src/lib/common/CMakeLists.txt b/src/lib/common/CMakeLists.txt index e068ac205..4f66ba841 100644 --- a/src/lib/common/CMakeLists.txt +++ b/src/lib/common/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,8 +17,8 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(common STATIC ${sources}) diff --git a/src/lib/io/CMakeLists.txt b/src/lib/io/CMakeLists.txt index e8c55f791..ee52610d3 100644 --- a/src/lib/io/CMakeLists.txt +++ b/src/lib/io/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,8 +17,8 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(io STATIC ${sources}) diff --git a/src/lib/ipc/CMakeLists.txt b/src/lib/ipc/CMakeLists.txt index 8615a50d0..0d535f405 100644 --- a/src/lib/ipc/CMakeLists.txt +++ b/src/lib/ipc/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,12 +17,20 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(ipc STATIC ${sources}) -if (UNIX) - target_link_libraries(ipc arch base common mt io net synlib) +if(UNIX) + target_link_libraries( + ipc + arch + base + common + mt + io + net + synlib) endif() diff --git a/src/lib/mt/CMakeLists.txt b/src/lib/mt/CMakeLists.txt index de72b4805..10e440a2f 100644 --- a/src/lib/mt/CMakeLists.txt +++ b/src/lib/mt/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,8 +17,8 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(mt STATIC ${sources}) diff --git a/src/lib/net/CMakeLists.txt b/src/lib/net/CMakeLists.txt index 3331420de..da3afb27d 100644 --- a/src/lib/net/CMakeLists.txt +++ b/src/lib/net/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -14,31 +14,18 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -file(GLOB headers - "*.h" - "InverseSockets/*.h" -) -file(GLOB sources - "*.cpp" - "InverseSockets/*.cpp" -) +file(GLOB headers "*.h" "InverseSockets/*.h") +file(GLOB sources "*.cpp" "InverseSockets/*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(net STATIC ${sources}) -target_link_libraries(net - PUBLIC - OpenSSL::SSL - PRIVATE - mt - io -) +target_link_libraries( + net + PUBLIC OpenSSL::SSL + PRIVATE mt io) if(WIN32) - target_link_libraries(net - PRIVATE - Crypt32 - ws2_32 - ) + target_link_libraries(net PRIVATE Crypt32 ws2_32) endif() diff --git a/src/lib/platform/CMakeLists.txt b/src/lib/platform/CMakeLists.txt index f01c32dce..a7f5238f5 100644 --- a/src/lib/platform/CMakeLists.txt +++ b/src/lib/platform/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -14,41 +14,46 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if (WIN32) - file(GLOB headers "MSWindows*.h") - file(GLOB sources "MSWindows*.cpp") -elseif (APPLE) - file(GLOB headers "OSX*.h" "IOSX*.h") - file(GLOB sources "OSX*.cpp" "IOSX*.cpp" "OSX*.m" "OSX*.mm") -elseif (UNIX) - file(GLOB headers "XWindows*.h") - file(GLOB sources "XWindows*.cpp") +if(WIN32) + file(GLOB headers "MSWindows*.h") + file(GLOB sources "MSWindows*.cpp") +elseif(APPLE) + file(GLOB headers "OSX*.h" "IOSX*.h") + file(GLOB sources "OSX*.cpp" "IOSX*.cpp" "OSX*.m" "OSX*.mm") +elseif(UNIX) + file(GLOB headers "XWindows*.h") + file(GLOB sources "XWindows*.cpp") endif() -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -if (APPLE) - list(APPEND inc - /System/Library/Frameworks - ) +if(APPLE) + list(APPEND inc /System/Library/Frameworks) endif() include_directories(${inc}) add_library(platform STATIC ${sources}) target_link_libraries(platform client ${libs}) -if (UNIX) - target_link_libraries(platform io net ipc synlib client ${libs}) +if(UNIX) + target_link_libraries( + platform + io + net + ipc + synlib + client + ${libs}) - if (NOT APPLE) - find_package (Qt5 COMPONENTS DBus) - target_link_libraries (platform Qt5::DBus) - endif() + if(NOT APPLE) + find_package(Qt5 COMPONENTS DBus) + target_link_libraries(platform Qt5::DBus) + endif() endif() -if (APPLE) - find_library(COCOA_LIBRARY Cocoa) - target_link_libraries(platform ${COCOA_LIBRARY}) +if(APPLE) + find_library(COCOA_LIBRARY Cocoa) + target_link_libraries(platform ${COCOA_LIBRARY}) endif() diff --git a/src/lib/server/CMakeLists.txt b/src/lib/server/CMakeLists.txt index 1fc7154d1..a2ff5f6f2 100644 --- a/src/lib/server/CMakeLists.txt +++ b/src/lib/server/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -17,14 +17,14 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(server STATIC ${sources}) target_link_libraries(server shared) -if (UNIX) - target_link_libraries(server synlib) +if(UNIX) + target_link_libraries(server synlib) endif() diff --git a/src/lib/shared/CMakeLists.txt b/src/lib/shared/CMakeLists.txt index f518c460f..9d91779eb 100644 --- a/src/lib/shared/CMakeLists.txt +++ b/src/lib/shared/CMakeLists.txt @@ -1,10 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2016 Symless Ltd. -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -16,11 +17,10 @@ file(GLOB headers "*.h") file(GLOB sources "*.cpp") -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(shared STATIC ${sources}) target_link_libraries(shared arch base) - diff --git a/src/lib/synergy/CMakeLists.txt b/src/lib/synergy/CMakeLists.txt index 16d53a079..4e07c7780 100644 --- a/src/lib/synergy/CMakeLists.txt +++ b/src/lib/synergy/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -18,46 +18,56 @@ file(GLOB headers "*.h" "languages/*.h") file(GLOB sources "*.cpp" "languages/*.cpp") # arch -if (WIN32) - file(GLOB arch_headers "win32/*.h") - file(GLOB arch_sources "win32/*.cpp") - include_directories("../../../ext/WinToast/src") - list(APPEND arch_sources "../../../ext/WinToast/src/wintoastlib.cpp") -elseif (UNIX) - file(GLOB arch_headers "unix/*.h") - file(GLOB arch_sources "unix/*.cpp") +if(WIN32) + file(GLOB arch_headers "win32/*.h") + file(GLOB arch_sources "win32/*.cpp") + include_directories("../../../ext/WinToast/src") + list(APPEND arch_sources "../../../ext/WinToast/src/wintoastlib.cpp") +elseif(UNIX) + file(GLOB arch_headers "unix/*.h") + file(GLOB arch_sources "unix/*.cpp") endif() option(SYSTEM_PUGIXML "Use system pugixml instead of vendored one" OFF) -if (SYSTEM_PUGIXML) - find_package(pugixml REQUIRED) +if(SYSTEM_PUGIXML) + find_package(pugixml REQUIRED) else() - include_directories("../../../ext/pugixml/src") - list(APPEND arch_sources "../../../ext/pugixml/src/pugixml.cpp") + include_directories("../../../ext/pugixml/src") + list(APPEND arch_sources "../../../ext/pugixml/src/pugixml.cpp") endif() list(APPEND sources ${arch_sources}) list(APPEND headers ${arch_headers}) -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() add_library(synlib STATIC ${sources}) -if (UNIX) - target_link_libraries(synlib arch client ipc net base platform mt server) - if (NOT APPLE) - find_package(PkgConfig REQUIRED) - pkg_check_modules(lib_glib REQUIRED IMPORTED_TARGET glib-2.0) - pkg_search_module( PC_GDKPIXBUF gdk-pixbuf-2.0 ) - include_directories(${PC_GDKPIXBUF_INCLUDE_DIRS}) - pkg_check_modules(lib_gdkpixbuf REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0 ) - pkg_check_modules(lib_notify REQUIRED IMPORTED_TARGET libnotify) - target_link_libraries(synlib PkgConfig::lib_glib PkgConfig::lib_gdkpixbuf PkgConfig::lib_notify) - endif() +if(UNIX) + target_link_libraries( + synlib + arch + client + ipc + net + base + platform + mt + server) + if(NOT APPLE) + find_package(PkgConfig REQUIRED) + pkg_check_modules(lib_glib REQUIRED IMPORTED_TARGET glib-2.0) + pkg_search_module(PC_GDKPIXBUF gdk-pixbuf-2.0) + include_directories(${PC_GDKPIXBUF_INCLUDE_DIRS}) + pkg_check_modules(lib_gdkpixbuf REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0) + pkg_check_modules(lib_notify REQUIRED IMPORTED_TARGET libnotify) + target_link_libraries(synlib PkgConfig::lib_glib PkgConfig::lib_gdkpixbuf + PkgConfig::lib_notify) + endif() endif() -if (SYSTEM_PUGIXML) - target_link_libraries(synlib pugixml) +if(SYSTEM_PUGIXML) + target_link_libraries(synlib pugixml) endif() diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 23c9028e7..ad7f338d7 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2011 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -15,18 +15,16 @@ # along with this program. If not, see . include_directories( - ../../ext/googletest/googletest - ../../ext/googletest/googletest/include - ../../ext/googletest/googlemock - ../../ext/googletest/googlemock/include) - + ../../ext/googletest/googletest ../../ext/googletest/googletest/include + ../../ext/googletest/googlemock ../../ext/googletest/googlemock/include) + add_library(gtest STATIC ../../ext/googletest/googletest/src/gtest-all.cc) add_library(gmock STATIC ../../ext/googletest/googlemock/src/gmock-all.cc) -if (UNIX) - # ignore warnings in gtest and gmock - set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-w") - set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w") +if(UNIX) + # ignore warnings in gtest and gmock + set_target_properties(gtest PROPERTIES COMPILE_FLAGS "-w") + set_target_properties(gmock PROPERTIES COMPILE_FLAGS "-w") endif() add_subdirectory(integtests) diff --git a/src/test/integtests/CMakeLists.txt b/src/test/integtests/CMakeLists.txt index e85b93111..b1a401c14 100644 --- a/src/test/integtests/CMakeLists.txt +++ b/src/test/integtests/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -23,15 +23,15 @@ list(REMOVE_ITEM headers ${remove_platform}) list(REMOVE_ITEM sources ${remove_platform}) # platform -if (WIN32) - file(GLOB platform_sources "platform/MSWindows*.cpp") - file(GLOB platform_headers "platform/MSWindows*.h") -elseif (APPLE) - file(GLOB platform_sources "platform/OSX*.cpp") - file(GLOB platform_headers "platform/OSX*.h") -elseif (UNIX) - file(GLOB platform_sources "platform/XWindows*.cpp") - file(GLOB platform_headers "platform/XWindows*.h") +if(WIN32) + file(GLOB platform_sources "platform/MSWindows*.cpp") + file(GLOB platform_headers "platform/MSWindows*.h") +elseif(APPLE) + file(GLOB platform_sources "platform/OSX*.cpp") + file(GLOB platform_headers "platform/OSX*.h") +elseif(UNIX) + file(GLOB platform_sources "platform/XWindows*.cpp") + file(GLOB platform_headers "platform/XWindows*.h") endif() list(APPEND sources ${platform_sources}) @@ -49,21 +49,32 @@ file(GLOB_RECURSE mock_sources "../../test/mock/*.cpp") list(APPEND headers ${mock_headers}) list(APPEND sources ${mock_sources}) -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -if (WIN32) - list(APPEND sources ${CMAKE_BINARY_DIR}/src/version.rc) +if(WIN32) + list(APPEND sources ${CMAKE_BINARY_DIR}/src/version.rc) endif() include_directories( - ../../ - ../../lib/ - ../../../ext/googletest/googletest/include - ../../../ext/googletest/googlemock/include -) + ../../ ../../lib/ ../../../ext/googletest/googletest/include + ../../../ext/googletest/googlemock/include) add_executable(integtests ${sources}) -target_link_libraries(integtests - arch base client common io ipc mt net platform server synlib gtest gmock ${libs}) +target_link_libraries( + integtests + arch + base + client + common + io + ipc + mt + net + platform + server + synlib + gtest + gmock + ${libs}) diff --git a/src/test/unittests/CMakeLists.txt b/src/test/unittests/CMakeLists.txt index 00fcf6b5e..8f04e2288 100644 --- a/src/test/unittests/CMakeLists.txt +++ b/src/test/unittests/CMakeLists.txt @@ -1,11 +1,11 @@ -# synergy -- mouse and keyboard sharing utility -# Copyright (C) 2012-2016 Symless Ltd. -# Copyright (C) 2009 Nick Bolton -# +# Synergy -- mouse and keyboard sharing utility +# Copyright (C) 2012-2024 Symless Ltd. +# Copyright (C) 2009-2012 Nick Bolton +# # 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 @@ -36,36 +36,47 @@ list(APPEND headers ${mock_headers}) list(APPEND sources ${mock_sources}) # platform -if (WIN32) - file(GLOB platform_sources "platform/MSWindows*.cpp") - file(GLOB platform_headers "platform/MSWindows*.h") -elseif (APPLE) - file(GLOB platform_sources "platform/OSX*.cpp") - file(GLOB platform_headers "platform/OSX*.h") -elseif (UNIX) - file(GLOB platform_sources "platform/XWindows*.cpp") - file(GLOB platform_headers "platform/XWindows*.h") +if(WIN32) + file(GLOB platform_sources "platform/MSWindows*.cpp") + file(GLOB platform_headers "platform/MSWindows*.h") +elseif(APPLE) + file(GLOB platform_sources "platform/OSX*.cpp") + file(GLOB platform_headers "platform/OSX*.h") +elseif(UNIX) + file(GLOB platform_sources "platform/XWindows*.cpp") + file(GLOB platform_headers "platform/XWindows*.h") endif() list(APPEND sources ${platform_sources}) list(APPEND headers ${platform_headers}) -include_directories( - ../../ - ../../lib/ - ../../../ext/gtest/include - ../../../ext/gmock/include - ../../../ext -) +include_directories(../../ ../../lib/ ../../../ext/gtest/include + ../../../ext/gmock/include ../../../ext) -if (SYNERGY_ADD_HEADERS) - list(APPEND sources ${headers}) +if(SYNERGY_ADD_HEADERS) + list(APPEND sources ${headers}) endif() -if (WIN32) - list(APPEND sources ${CMAKE_BINARY_DIR}/src/version.rc) +if(WIN32) + list(APPEND sources ${CMAKE_BINARY_DIR}/src/version.rc) endif() add_executable(${target} ${sources}) -target_link_libraries(${target} - arch base client server common io net platform server synlib mt ipc gtest gmock shared ${libs}) +target_link_libraries( + ${target} + arch + base + client + server + common + io + net + platform + server + synlib + mt + ipc + gtest + gmock + shared + ${libs})