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
|
|
@ -13,6 +13,12 @@
|
||||||
# Packaging (optional)
|
# 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] Base64 encoded PFX code signing certificate
|
||||||
# WINDOWS_PFX_CERTIFICATE="very-long-base64-encoded-string"
|
# WINDOWS_PFX_CERTIFICATE="very-long-base64-encoded-string"
|
||||||
|
|
||||||
|
|
|
||||||
6
.github/actions/dist-upload/action.yml
vendored
|
|
@ -26,6 +26,12 @@ runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|
||||||
steps:
|
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 }}
|
- if: ${{ inputs.use_gdrive == 'true' && !inputs.package-version }}
|
||||||
run: |
|
run: |
|
||||||
echo "Input 'package-version' is required when uploading to Google Drive"
|
echo "Input 'package-version' is required when uploading to Google Drive"
|
||||||
|
|
|
||||||
144
.github/workflows/ci.yml
vendored
|
|
@ -17,6 +17,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
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_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
|
||||||
UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }}
|
UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|
||||||
|
|
@ -43,7 +44,7 @@ jobs:
|
||||||
|
|
||||||
- name: Cache Qt
|
- name: Cache Qt
|
||||||
id: cache-qt
|
id: cache-qt
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ env.QT_BASE_DIR }}
|
path: ${{ env.QT_BASE_DIR }}
|
||||||
key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }}
|
key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }}
|
||||||
|
|
@ -61,20 +62,20 @@ jobs:
|
||||||
run: cmake -B build --preset=windows-release
|
run: cmake -B build --preset=windows-release
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build
|
run: cmake --build build -j8
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./build/bin/unittests
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
if: ${{ !github.event.pull_request.draft }}
|
if: ${{ env.ENABLE_PACKAGING == 'true' }}
|
||||||
run: python ./scripts/package.py
|
run: python ./scripts/package.py
|
||||||
env:
|
env:
|
||||||
WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }}
|
WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }}
|
||||||
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }}
|
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }}
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if:
|
if: ${{ env.ENABLE_PACKAGING == 'true' }}
|
||||||
uses: ./.github/actions/dist-upload
|
uses: ./.github/actions/dist-upload
|
||||||
with:
|
with:
|
||||||
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
||||||
|
|
@ -97,13 +98,6 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
runtime:
|
runtime:
|
||||||
- name: "macos-10-intel"
|
|
||||||
timeout: 20
|
|
||||||
os: "macos-14-large"
|
|
||||||
arch: x64
|
|
||||||
target: "10.14"
|
|
||||||
shell: "bash"
|
|
||||||
|
|
||||||
- name: "macos-11-arm64"
|
- name: "macos-11-arm64"
|
||||||
timeout: 10
|
timeout: 10
|
||||||
os: "macos-14"
|
os: "macos-14"
|
||||||
|
|
@ -111,6 +105,13 @@ jobs:
|
||||||
target: "11"
|
target: "11"
|
||||||
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -126,13 +127,13 @@ jobs:
|
||||||
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
|
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build
|
run: cmake --build build -j8
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./build/bin/unittests
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
if: ${{ !github.event.pull_request.draft }}
|
if: ${{ env.ENABLE_PACKAGING == 'true' }}
|
||||||
run: ./scripts/package.py
|
run: ./scripts/package.py
|
||||||
env:
|
env:
|
||||||
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
|
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
|
||||||
|
|
@ -143,7 +144,7 @@ jobs:
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
|
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if:
|
if: ${{ env.ENABLE_PACKAGING == 'true' }}
|
||||||
uses: ./.github/actions/dist-upload
|
uses: ./.github/actions/dist-upload
|
||||||
with:
|
with:
|
||||||
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
use_github: ${{ env.UPLOAD_TO_GITHUB }}
|
||||||
|
|
@ -160,52 +161,84 @@ jobs:
|
||||||
name: linux-${{ matrix.distro.name }}
|
name: linux-${{ matrix.distro.name }}
|
||||||
container: ${{ matrix.distro.container }}
|
container: ${{ matrix.distro.container }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
# Prevent apt prompting for input.
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
distro:
|
distro:
|
||||||
- name: centos-8
|
- name: ubuntu-24.04
|
||||||
container: symless/synergy-core:centos8
|
container: ubuntu:24.04
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
legacy-cmake: true
|
install-deps-apt: true
|
||||||
|
extra-packages: 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
|
|
||||||
|
|
||||||
- name: ubuntu-22.04
|
- name: ubuntu-22.04
|
||||||
container: symless/synergy-core:ubuntu22.04
|
container: ubuntu:22.04
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
install-deps-apt: true
|
||||||
|
|
||||||
- name: ubuntu-24.04
|
- name: debian-12
|
||||||
runs-on: ubuntu-24.04
|
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:
|
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
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
|
- name: Config Git safe dir
|
||||||
|
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: ./scripts/install_deps.py
|
run: ./scripts/install_deps.py
|
||||||
|
|
||||||
|
|
@ -219,11 +252,26 @@ jobs:
|
||||||
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
|
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build
|
run: cmake --build build -j8
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./build/bin/unittests
|
run: ./build/bin/unittests
|
||||||
|
|
||||||
- name: Package
|
- 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
|
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 }}
|
||||||
|
|
|
||||||
|
|
@ -5,37 +5,28 @@
|
||||||
# file with configuration. For more information, see:
|
# file with configuration. For more information, see:
|
||||||
# https://github.com/actions/labeler/blob/master/README.md
|
# https://github.com/actions/labeler/blob/master/README.md
|
||||||
|
|
||||||
name: "Check ChangeLog"
|
name: "Lint ChangeLog"
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-changelog:
|
lint-changelog:
|
||||||
if: ${{ !github.event.pull_request.draft }}
|
if: ${{ !github.event.pull_request.draft }}
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Get changed files
|
- name: Get changes
|
||||||
id: file_changes
|
id: file_changes
|
||||||
uses: trilom/file-changes-action@v1.2.4
|
uses: trilom/file-changes-action@v1.2.4
|
||||||
with:
|
with:
|
||||||
output: ","
|
output: ","
|
||||||
|
|
||||||
- name: echo changes
|
- name: Show modified
|
||||||
run: |
|
run: echo '${{ steps.file_changes.outputs.files_modified}}'
|
||||||
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: List files
|
- name: Check
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.file_changes.outputs.files_modified}}" == *"ChangeLog"* ]]; then
|
if [[ "${{ steps.file_changes.outputs.files_modified}}" == *"ChangeLog"* ]]; then
|
||||||
echo "ChangeLog has been updated"
|
echo "ChangeLog has been updated"
|
||||||
23
.github/workflows/lint-cmake-files.yml
vendored
Normal file
|
|
@ -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
|
||||||
3
.vscode/extensions.json
vendored
|
|
@ -4,6 +4,7 @@
|
||||||
"twxs.cmake",
|
"twxs.cmake",
|
||||||
"llvm-vs-code-extensions.vscode-clangd",
|
"llvm-vs-code-extensions.vscode-clangd",
|
||||||
"ms-vscode.cpptools",
|
"ms-vscode.cpptools",
|
||||||
"vadimcn.vscode-lldb"
|
"vadimcn.vscode-lldb",
|
||||||
|
"cheshirekow.cmake-format"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
388
CMakeLists.txt
|
|
@ -18,389 +18,13 @@ cmake_minimum_required (VERSION 3.5)
|
||||||
project(synergy-core C CXX)
|
project(synergy-core C CXX)
|
||||||
|
|
||||||
include(cmake/Version.cmake)
|
include(cmake/Version.cmake)
|
||||||
set_version()
|
include(cmake/Definitions.cmake)
|
||||||
|
include(cmake/Libraries.cmake)
|
||||||
# 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 <arpa/inet.h>\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()
|
|
||||||
|
|
||||||
include(cmake/Packaging.cmake)
|
include(cmake/Packaging.cmake)
|
||||||
|
|
||||||
|
set_version()
|
||||||
|
configure_definitions()
|
||||||
|
configure_libs()
|
||||||
configure_packaging()
|
configure_packaging()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ Enhancements:
|
||||||
- #7354 Re-implement CI auto version increment for packaging
|
- #7354 Re-implement CI auto version increment for packaging
|
||||||
- #7353 Re-implement packaging for GitHub workflows (macOS)
|
- #7353 Re-implement packaging for GitHub workflows (macOS)
|
||||||
- #7360 Re-implement packaging for GitHub workflows (Windows)
|
- #7360 Re-implement packaging for GitHub workflows (Windows)
|
||||||
|
- #7361 Re-implement packaging for GitHub workflows (Linux)
|
||||||
|
|
||||||
# 1.14.6
|
# 1.14.6
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ cmake -B build --preset=linux-release
|
||||||
|
|
||||||
**Build:**
|
**Build:**
|
||||||
```
|
```
|
||||||
cmake --build build
|
cmake --build build -j8
|
||||||
```
|
```
|
||||||
|
|
||||||
**Test:**
|
**Test:**
|
||||||
|
|
|
||||||
5
cmake-format.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
format:
|
||||||
|
line_ending: "auto"
|
||||||
|
|
||||||
|
markup:
|
||||||
|
first_comment_is_literal: true
|
||||||
|
|
@ -140,7 +140,8 @@ elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
|
set(COVERAGE_COMPILER_FLAGS
|
||||||
|
"-g -fprofile-arcs -ftest-coverage"
|
||||||
CACHE INTERNAL "")
|
CACHE INTERNAL "")
|
||||||
|
|
||||||
set(CMAKE_Fortran_FLAGS_COVERAGE
|
set(CMAKE_Fortran_FLAGS_COVERAGE
|
||||||
|
|
@ -149,57 +150,56 @@ set(CMAKE_Fortran_FLAGS_COVERAGE
|
||||||
FORCE)
|
FORCE)
|
||||||
set(CMAKE_CXX_FLAGS_COVERAGE
|
set(CMAKE_CXX_FLAGS_COVERAGE
|
||||||
${COVERAGE_COMPILER_FLAGS}
|
${COVERAGE_COMPILER_FLAGS}
|
||||||
CACHE STRING "Flags used by the C++ compiler during coverage builds."
|
CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE)
|
||||||
FORCE )
|
|
||||||
set(CMAKE_C_FLAGS_COVERAGE
|
set(CMAKE_C_FLAGS_COVERAGE
|
||||||
${COVERAGE_COMPILER_FLAGS}
|
${COVERAGE_COMPILER_FLAGS}
|
||||||
CACHE STRING "Flags used by the C compiler during coverage builds."
|
CACHE STRING "Flags used by the C compiler during coverage builds." FORCE)
|
||||||
FORCE )
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||||
""
|
""
|
||||||
CACHE STRING "Flags used for linking binaries during coverage builds."
|
CACHE STRING "Flags used for linking binaries during coverage builds."
|
||||||
FORCE)
|
FORCE)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
||||||
""
|
""
|
||||||
CACHE STRING "Flags used by the shared libraries linker during coverage builds."
|
CACHE STRING
|
||||||
|
"Flags used by the shared libraries linker during coverage builds."
|
||||||
FORCE)
|
FORCE)
|
||||||
mark_as_advanced(
|
mark_as_advanced(
|
||||||
CMAKE_Fortran_FLAGS_COVERAGE
|
CMAKE_Fortran_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE
|
||||||
CMAKE_CXX_FLAGS_COVERAGE
|
CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
|
||||||
CMAKE_C_FLAGS_COVERAGE
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
|
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
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"
|
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL
|
||||||
|
"GNU")
|
||||||
link_libraries(gcov)
|
link_libraries(gcov)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Defines a target for running and collection code coverage information
|
# Defines a target for running and collection code coverage information Builds
|
||||||
# Builds dependencies, runs the given executable and outputs reports.
|
# dependencies, runs the given executable and outputs reports. NOTE! The
|
||||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
# executable should always have a ZERO as exit code otherwise the coverage
|
||||||
# the coverage generation will not complete.
|
# generation will not complete.
|
||||||
#
|
#
|
||||||
# setup_target_for_coverage_lcov(
|
# setup_target_for_coverage_lcov( NAME testrunner_coverage #
|
||||||
# NAME testrunner_coverage # New target name
|
# New target name EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in
|
||||||
# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
# PROJECT_BINARY_DIR DEPENDENCIES testrunner # Dependencies
|
||||||
# DEPENDENCIES testrunner # Dependencies to build first
|
# to build first BASE_DIRECTORY "../" # Base directory
|
||||||
# BASE_DIRECTORY "../" # Base directory for report
|
# for report # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*"
|
||||||
# # (defaults to PROJECT_SOURCE_DIR)
|
# "src/dir2/*" # Patterns to exclude (can be relative # to
|
||||||
# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
|
# BASE_DIRECTORY, with CMake 3.4+) NO_DEMANGLE #
|
||||||
# # to BASE_DIRECTORY, with CMake 3.4+)
|
# Don't demangle C++ symbols # even if c++filt is found )
|
||||||
# NO_DEMANGLE # Don't demangle C++ symbols
|
|
||||||
# # even if c++filt is found
|
|
||||||
# )
|
|
||||||
function(setup_target_for_coverage_lcov)
|
function(setup_target_for_coverage_lcov)
|
||||||
|
|
||||||
set(options NO_DEMANGLE)
|
set(options NO_DEMANGLE)
|
||||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
|
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS
|
||||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
GENHTML_ARGS)
|
||||||
|
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}"
|
||||||
|
"${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
if(NOT LCOV_PATH)
|
if(NOT LCOV_PATH)
|
||||||
message(FATAL_ERROR "lcov not found! Aborting...")
|
message(FATAL_ERROR "lcov not found! Aborting...")
|
||||||
|
|
@ -218,7 +218,8 @@ function(setup_target_for_coverage_lcov)
|
||||||
|
|
||||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||||
set(LCOV_EXCLUDES "")
|
set(LCOV_EXCLUDES "")
|
||||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
|
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES}
|
||||||
|
${COVERAGE_LCOV_EXCLUDES})
|
||||||
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -232,74 +233,80 @@ function(setup_target_for_coverage_lcov)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Setup target
|
# Setup target
|
||||||
add_custom_target(${Coverage_NAME}
|
add_custom_target(
|
||||||
|
${Coverage_NAME}
|
||||||
# Cleanup lcov
|
# Cleanup lcov
|
||||||
COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . -b ${BASEDIR} --zerocounters
|
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
|
# 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
|
COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d
|
||||||
|
. -b ${BASEDIR} -o ${Coverage_NAME}.base
|
||||||
# Run tests
|
# Run tests
|
||||||
COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||||
|
|
||||||
# Capturing lcov counters and generating report
|
# 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
|
COMMAND
|
||||||
|
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory .
|
||||||
|
-b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
|
||||||
# add baseline counters
|
# 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
|
COMMAND
|
||||||
# filter collected data to final coverage report
|
${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a
|
||||||
COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
|
${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file
|
||||||
|
|
||||||
# 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}.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
|
${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
|
${Coverage_NAME} # report directory
|
||||||
|
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
DEPENDS ${Coverage_DEPENDENCIES}
|
DEPENDS ${Coverage_DEPENDENCIES}
|
||||||
VERBATIM # Protect arguments to commands
|
VERBATIM # Protect arguments to commands
|
||||||
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
|
COMMENT
|
||||||
|
"Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Show where to find the lcov info report
|
# Show where to find the lcov info report
|
||||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
add_custom_command(
|
||||||
|
TARGET ${Coverage_NAME}
|
||||||
|
POST_BUILD
|
||||||
COMMAND ;
|
COMMAND ;
|
||||||
COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
|
COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info.")
|
||||||
)
|
|
||||||
|
|
||||||
# Show info where to find the report
|
# Show info where to find the report
|
||||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
add_custom_command(
|
||||||
|
TARGET ${Coverage_NAME}
|
||||||
|
POST_BUILD
|
||||||
COMMAND ;
|
COMMAND ;
|
||||||
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
|
COMMENT
|
||||||
|
"Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
|
||||||
)
|
)
|
||||||
|
|
||||||
endfunction() # setup_target_for_coverage_lcov
|
endfunction() # setup_target_for_coverage_lcov
|
||||||
|
|
||||||
# Defines a target for running and collection code coverage information
|
# Defines a target for running and collection code coverage information Builds
|
||||||
# Builds dependencies, runs the given executable and outputs reports.
|
# dependencies, runs the given executable and outputs reports. NOTE! The
|
||||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
# executable should always have a ZERO as exit code otherwise the coverage
|
||||||
# the coverage generation will not complete.
|
# generation will not complete.
|
||||||
#
|
#
|
||||||
# setup_target_for_coverage_gcovr_xml(
|
# setup_target_for_coverage_gcovr_xml( NAME ctest_coverage #
|
||||||
# NAME ctest_coverage # New target name
|
# New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in
|
||||||
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
# PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to
|
||||||
# DEPENDENCIES executable_target # Dependencies to build first
|
# build first BASE_DIRECTORY "../" # Base directory for report
|
||||||
# BASE_DIRECTORY "../" # Base directory for report
|
# # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" "src/dir2/*" #
|
||||||
# # (defaults to PROJECT_SOURCE_DIR)
|
# Patterns to exclude (can be relative # to BASE_DIRECTORY, with CMake 3.4+) )
|
||||||
# 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)
|
function(setup_target_for_coverage_gcovr_xml)
|
||||||
|
|
||||||
set(options NONE)
|
set(options NONE)
|
||||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
||||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}"
|
||||||
|
"${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
if(NOT GCOVR_PATH)
|
if(NOT GCOVR_PATH)
|
||||||
message(FATAL_ERROR "gcovr not found! Aborting...")
|
message(FATAL_ERROR "gcovr not found! Aborting...")
|
||||||
|
|
@ -314,7 +321,8 @@ function(setup_target_for_coverage_gcovr_xml)
|
||||||
|
|
||||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||||
set(GCOVR_EXCLUDES "")
|
set(GCOVR_EXCLUDES "")
|
||||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
|
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES}
|
||||||
|
${COVERAGE_GCOVR_EXCLUDES})
|
||||||
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -329,49 +337,45 @@ function(setup_target_for_coverage_gcovr_xml)
|
||||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(${Coverage_NAME}
|
add_custom_target(
|
||||||
|
${Coverage_NAME}
|
||||||
# Run tests
|
# Run tests
|
||||||
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||||
|
|
||||||
# Running gcovr
|
# Running gcovr
|
||||||
COMMAND ${GCOVR_PATH} --sonarqube
|
COMMAND ${GCOVR_PATH} --sonarqube -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
||||||
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
--object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}.xml
|
||||||
--object-directory=${PROJECT_BINARY_DIR}
|
|
||||||
-o ${Coverage_NAME}.xml
|
|
||||||
BYPRODUCTS ${Coverage_NAME}.xml
|
BYPRODUCTS ${Coverage_NAME}.xml
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
DEPENDS ${Coverage_DEPENDENCIES}
|
DEPENDS ${Coverage_DEPENDENCIES}
|
||||||
VERBATIM # Protect arguments to commands
|
VERBATIM # Protect arguments to commands
|
||||||
COMMENT "Running gcovr to produce Cobertura code coverage report."
|
COMMENT "Running gcovr to produce Cobertura code coverage report.")
|
||||||
)
|
|
||||||
|
|
||||||
# Show info where to find the report
|
# Show info where to find the report
|
||||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
add_custom_command(
|
||||||
|
TARGET ${Coverage_NAME}
|
||||||
|
POST_BUILD
|
||||||
COMMAND ;
|
COMMAND ;
|
||||||
COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
|
COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml.")
|
||||||
)
|
|
||||||
endfunction() # setup_target_for_coverage_gcovr_xml
|
endfunction() # setup_target_for_coverage_gcovr_xml
|
||||||
|
|
||||||
# Defines a target for running and collection code coverage information
|
# Defines a target for running and collection code coverage information Builds
|
||||||
# Builds dependencies, runs the given executable and outputs reports.
|
# dependencies, runs the given executable and outputs reports. NOTE! The
|
||||||
# NOTE! The executable should always have a ZERO as exit code otherwise
|
# executable should always have a ZERO as exit code otherwise the coverage
|
||||||
# the coverage generation will not complete.
|
# generation will not complete.
|
||||||
#
|
#
|
||||||
# setup_target_for_coverage_gcovr_html(
|
# setup_target_for_coverage_gcovr_html( NAME ctest_coverage #
|
||||||
# NAME ctest_coverage # New target name
|
# New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in
|
||||||
# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
|
# PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to
|
||||||
# DEPENDENCIES executable_target # Dependencies to build first
|
# build first BASE_DIRECTORY "../" # Base directory for report
|
||||||
# BASE_DIRECTORY "../" # Base directory for report
|
# # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" "src/dir2/*" #
|
||||||
# # (defaults to PROJECT_SOURCE_DIR)
|
# Patterns to exclude (can be relative # to BASE_DIRECTORY, with CMake 3.4+) )
|
||||||
# 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)
|
function(setup_target_for_coverage_gcovr_html)
|
||||||
|
|
||||||
set(options NONE)
|
set(options NONE)
|
||||||
set(oneValueArgs BASE_DIRECTORY NAME)
|
set(oneValueArgs BASE_DIRECTORY NAME)
|
||||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
||||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}"
|
||||||
|
"${multiValueArgs}" ${ARGN})
|
||||||
|
|
||||||
if(NOT GCOVR_PATH)
|
if(NOT GCOVR_PATH)
|
||||||
message(FATAL_ERROR "gcovr not found! Aborting...")
|
message(FATAL_ERROR "gcovr not found! Aborting...")
|
||||||
|
|
@ -386,7 +390,8 @@ function(setup_target_for_coverage_gcovr_html)
|
||||||
|
|
||||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||||
set(GCOVR_EXCLUDES "")
|
set(GCOVR_EXCLUDES "")
|
||||||
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
|
foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES}
|
||||||
|
${COVERAGE_GCOVR_EXCLUDES})
|
||||||
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -401,37 +406,44 @@ function(setup_target_for_coverage_gcovr_html)
|
||||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(${Coverage_NAME}
|
add_custom_target(
|
||||||
|
${Coverage_NAME}
|
||||||
# Run tests
|
# Run tests
|
||||||
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
|
||||||
|
|
||||||
# Create folder
|
# Create folder
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
|
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||||
|
${PROJECT_BINARY_DIR}/${Coverage_NAME}
|
||||||
# Running gcovr
|
# Running gcovr
|
||||||
COMMAND ${GCOVR_PATH} --html --html-details
|
COMMAND
|
||||||
-r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
|
||||||
--object-directory=${PROJECT_BINARY_DIR}
|
--object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}/index.html
|
||||||
-o ${Coverage_NAME}/index.html
|
|
||||||
|
|
||||||
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
|
BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
DEPENDS ${Coverage_DEPENDENCIES}
|
DEPENDS ${Coverage_DEPENDENCIES}
|
||||||
VERBATIM # Protect arguments to commands
|
VERBATIM # Protect arguments to commands
|
||||||
COMMENT "Running gcovr to produce HTML code coverage report."
|
COMMENT "Running gcovr to produce HTML code coverage report.")
|
||||||
)
|
|
||||||
|
|
||||||
# Show info where to find the report
|
# Show info where to find the report
|
||||||
add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
|
add_custom_command(
|
||||||
|
TARGET ${Coverage_NAME}
|
||||||
|
POST_BUILD
|
||||||
COMMAND ;
|
COMMAND ;
|
||||||
COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
|
COMMENT
|
||||||
|
"Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
|
||||||
)
|
)
|
||||||
|
|
||||||
endfunction() # setup_target_for_coverage_gcovr_html
|
endfunction() # setup_target_for_coverage_gcovr_html
|
||||||
|
|
||||||
function(append_coverage_compiler_flags)
|
function(append_coverage_compiler_flags)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
set(CMAKE_C_FLAGS
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
"${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}"
|
||||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
|
PARENT_SCOPE)
|
||||||
message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
|
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
|
endfunction() # append_coverage_compiler_flags
|
||||||
|
|
|
||||||
99
cmake/Definitions.cmake
Normal file
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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()
|
||||||
370
cmake/Libraries.cmake
Normal file
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
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 <arpa/inet.h>\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()
|
||||||
|
|
@ -18,44 +18,154 @@
|
||||||
# If enabled, configure packaging based on OS.
|
# If enabled, configure packaging based on OS.
|
||||||
#
|
#
|
||||||
macro(configure_packaging)
|
macro(configure_packaging)
|
||||||
|
|
||||||
if(${SYNERGY_BUILD_INSTALLER})
|
if(${SYNERGY_BUILD_INSTALLER})
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
set(CPACK_PACKAGE_NAME "synergy")
|
||||||
configure_macos_packaging()
|
set(CPACK_PACKAGE_CONTACT "Synergy <support@symless.com>")
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
set(CPACK_PACKAGE_DESCRIPTION "Mouse and keyboard sharing utility")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "Symless")
|
||||||
|
|
||||||
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
configure_windows_packaging()
|
configure_windows_packaging()
|
||||||
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
configure_macos_packaging()
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly")
|
||||||
configure_linux_packaging()
|
configure_linux_packaging()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(CPack)
|
||||||
else()
|
else()
|
||||||
message(STATUS "Not configuring installer")
|
message(STATUS "Not configuring installer")
|
||||||
endif()
|
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()
|
endmacro()
|
||||||
|
|
||||||
#
|
#
|
||||||
# macOS app bundle
|
# macOS app bundle
|
||||||
#
|
#
|
||||||
macro(configure_macos_packaging)
|
macro(configure_macos_packaging)
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
||||||
set (CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks")
|
message(STATUS "Configuring macOS app bundle")
|
||||||
set (SYNERGY_BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/res/dist/macos/bundle)
|
|
||||||
|
set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION})
|
||||||
|
|
||||||
|
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_DIR ${CMAKE_BINARY_DIR}/bundle)
|
||||||
set(SYNERGY_BUNDLE_APP_DIR ${SYNERGY_BUNDLE_DIR}/Synergy.app)
|
set(SYNERGY_BUNDLE_APP_DIR ${SYNERGY_BUNDLE_DIR}/Synergy.app)
|
||||||
set(SYNERGY_BUNDLE_BINARY_DIR ${SYNERGY_BUNDLE_APP_DIR}/Contents/MacOS)
|
set(SYNERGY_BUNDLE_BINARY_DIR ${SYNERGY_BUNDLE_APP_DIR}/Contents/MacOS)
|
||||||
|
|
||||||
configure_files(${SYNERGY_BUNDLE_SOURCE_DIR} ${SYNERGY_BUNDLE_DIR})
|
configure_files(${SYNERGY_BUNDLE_SOURCE_DIR} ${SYNERGY_BUNDLE_DIR})
|
||||||
endif()
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Linux packages (including BSD and DragonFly)
|
||||||
|
#
|
||||||
|
macro(configure_linux_packaging)
|
||||||
|
|
||||||
|
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 <developers@symless.com>")
|
||||||
|
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})
|
||||||
|
|
||||||
|
file(
|
||||||
|
GLOB_RECURSE sourceFiles
|
||||||
|
RELATIVE ${srcDir}
|
||||||
|
${srcDir}/*)
|
||||||
|
file(
|
||||||
|
GLOB_RECURSE templateFiles
|
||||||
|
LIST_DIRECTORIES false
|
||||||
|
RELATIVE ${srcDir}
|
||||||
|
${srcDir}/*.in)
|
||||||
|
list(REMOVE_ITEM sourceFiles ${templateFiles})
|
||||||
|
|
||||||
|
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)
|
function(find_openssl_dir_win32 result)
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND where openssl
|
COMMAND where openssl
|
||||||
OUTPUT_VARIABLE OPENSSL_PATH
|
OUTPUT_VARIABLE OPENSSL_PATH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
)
|
|
||||||
|
|
||||||
# It's possible that there are multiple OpenSSL installations on the system,
|
# It's possible that there are multiple OpenSSL installations on the system,
|
||||||
# which is the case on GitHub runners.
|
# which is the case on GitHub runners. For now we'll pick the first one, but
|
||||||
# For now we'll pick the first one, but that's probably not very robust.
|
# that's probably not very robust. Maybe our choco config could install to a
|
||||||
# Maybe our choco config could install to a specific location?
|
# specific location?
|
||||||
string(REGEX REPLACE "\r?\n" ";" OPENSSL_PATH_LIST ${OPENSSL_PATH})
|
string(REGEX REPLACE "\r?\n" ";" OPENSSL_PATH_LIST ${OPENSSL_PATH})
|
||||||
message(STATUS "Found OpenSSL binaries at: ${OPENSSL_PATH_LIST}")
|
message(STATUS "Found OpenSSL binaries at: ${OPENSSL_PATH_LIST}")
|
||||||
|
|
||||||
|
|
@ -68,53 +178,8 @@ function(find_openssl_dir_win32 result)
|
||||||
get_filename_component(OPENSSL_DIR ${OPENSSL_BIN_DIR} DIRECTORY)
|
get_filename_component(OPENSSL_DIR ${OPENSSL_BIN_DIR} DIRECTORY)
|
||||||
message(STATUS "OpenSSL install root dir: ${OPENSSL_DIR}")
|
message(STATUS "OpenSSL install root dir: ${OPENSSL_DIR}")
|
||||||
|
|
||||||
set(${result} ${OPENSSL_DIR} PARENT_SCOPE)
|
set(${result}
|
||||||
|
${OPENSSL_DIR}
|
||||||
|
PARENT_SCOPE)
|
||||||
|
|
||||||
endfunction()
|
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)
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Same as the `configure_file` command but for directories recursively.
|
|
||||||
#
|
|
||||||
macro (configure_files srcDir destDir)
|
|
||||||
message (STATUS "Configuring directory ${destDir}")
|
|
||||||
make_directory (${destDir})
|
|
||||||
|
|
||||||
file (GLOB_RECURSE sourceFiles RELATIVE ${srcDir} ${srcDir}/*)
|
|
||||||
file (GLOB_RECURSE templateFiles LIST_DIRECTORIES false RELATIVE ${srcDir} ${srcDir}/*.in)
|
|
||||||
list (REMOVE_ITEM sourceFiles ${templateFiles})
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
|
||||||
|
|
@ -26,14 +26,23 @@ macro(set_version)
|
||||||
string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION)
|
string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message (STATUS "Version number: " ${SYNERGY_VERSION})
|
message(STATUS "Version number (semver): " ${SYNERGY_VERSION})
|
||||||
add_definitions(-DSYNERGY_VERSION="${SYNERGY_VERSION}")
|
add_definitions(-DSYNERGY_VERSION="${SYNERGY_VERSION}")
|
||||||
|
|
||||||
# Useful for copyright (e.g. in macOS bundle .plist.in and Windows version .rc file)
|
# Useful for copyright (e.g. in macOS bundle .plist.in and Windows version .rc
|
||||||
|
# file)
|
||||||
string(TIMESTAMP SYNERGY_BUILD_YEAR "%Y")
|
string(TIMESTAMP SYNERGY_BUILD_YEAR "%Y")
|
||||||
|
|
||||||
# MSI requires a 4-digit number and doesn't accept semver.
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||||
if (WIN32)
|
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}")
|
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ "${SYNERGY_VERSION}")
|
||||||
set(VERSION_MAJOR "${CMAKE_MATCH_1}")
|
set(VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||||
set(VERSION_MINOR "${CMAKE_MATCH_2}")
|
set(VERSION_MINOR "${CMAKE_MATCH_2}")
|
||||||
|
|
@ -46,13 +55,40 @@ macro(set_version)
|
||||||
set(VERSION_REVISION "0")
|
set(VERSION_REVISION "0")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Dot-separated version number for MSI and Windows version .rc file.
|
set(SYNERGY_VERSION_FOUR_PART
|
||||||
set(SYNERGY_VERSION_MS "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_REVISION}")
|
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_REVISION}")
|
||||||
message (STATUS "Version number for Microsoft (dots): " ${SYNERGY_VERSION_MS})
|
|
||||||
|
endmacro()
|
||||||
# CSV version number for Windows version .rc file.
|
|
||||||
set(SYNERGY_VERSION_MS_CSV "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}")
|
# MSI requires a 4-digit number and doesn't accept semver.
|
||||||
message (STATUS "Version number for Microsoft (CSV): " ${SYNERGY_VERSION_MS_CSV})
|
macro(set_windows_version)
|
||||||
endif()
|
|
||||||
|
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()
|
endmacro()
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ config:
|
||||||
dependencies:
|
dependencies:
|
||||||
command: brew bundle --file=Brewfile
|
command: brew bundle --file=Brewfile
|
||||||
|
|
||||||
# arch, opensuse, etc, patches welcome! :)
|
|
||||||
linux:
|
linux:
|
||||||
debian: &debian
|
debian: &debian
|
||||||
dependencies:
|
dependencies:
|
||||||
command: sudo apt-get update; sudo apt-get install -y \
|
command: sudo apt-get update; \
|
||||||
|
sudo apt-get install -y \
|
||||||
cmake \
|
cmake \
|
||||||
make \
|
make \
|
||||||
g++ \
|
g++ \
|
||||||
|
|
@ -29,35 +29,69 @@ config:
|
||||||
libx11-dev \
|
libx11-dev \
|
||||||
libxtst-dev \
|
libxtst-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
pkg-config \
|
|
||||||
libglib2.0-dev \
|
libglib2.0-dev \
|
||||||
libgdk-pixbuf-2.0-dev \
|
libgdk-pixbuf-2.0-dev \
|
||||||
libnotify-dev \
|
libnotify-dev \
|
||||||
libxkbfile-dev \
|
libxkbfile-dev \
|
||||||
qtbase5-dev \
|
qtbase5-dev \
|
||||||
qttools5-dev \
|
qttools5-dev \
|
||||||
libgtk-3-dev \
|
libgtk-3-dev
|
||||||
rpm
|
|
||||||
|
|
||||||
ubuntu:
|
ubuntu:
|
||||||
<<: *debian
|
<<: *debian
|
||||||
|
|
||||||
fedora: &fedora
|
fedora: &fedora
|
||||||
dependencies:
|
dependencies:
|
||||||
command: sudo dnf check-update; sudo dnf install -y \
|
command: sudo dnf check-update; \
|
||||||
|
sudo dnf install -y \
|
||||||
cmake \
|
cmake \
|
||||||
make \
|
make \
|
||||||
gcc-c++ \
|
gcc-c++ \
|
||||||
openssl-devel \
|
openssl-devel \
|
||||||
libXtst-devel \
|
|
||||||
glib2-devel \
|
glib2-devel \
|
||||||
gdk-pixbuf2-devel \
|
gdk-pixbuf2-devel \
|
||||||
|
libXtst-devel \
|
||||||
libnotify-devel \
|
libnotify-devel \
|
||||||
|
libxkbfile-devel \
|
||||||
qt5-qtbase-devel \
|
qt5-qtbase-devel \
|
||||||
qt5-qttools-devel \
|
qt5-qttools-devel \
|
||||||
libxkbfile-devel \
|
|
||||||
gtk3-devel \
|
gtk3-devel \
|
||||||
rpm-build
|
rpm-build
|
||||||
|
|
||||||
centos:
|
opensuse-tumbleweed: &opensuse-tumbleweed
|
||||||
<<: *fedora
|
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
|
||||||
1
debian/compat
vendored
|
|
@ -1 +0,0 @@
|
||||||
9
|
|
||||||
17
debian/control
vendored
|
|
@ -1,17 +0,0 @@
|
||||||
Source: synergy
|
|
||||||
Section: utils
|
|
||||||
Priority: optional
|
|
||||||
Standards-Version: 3.9.7
|
|
||||||
Homepage: https://www.symless.com/
|
|
||||||
Maintainer: Symless <engineering@symless.com>
|
|
||||||
|
|
||||||
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
|
|
||||||
5
debian/copyright
vendored
|
|
@ -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
|
|
||||||
5
debian/rules
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@ --buildsystem=cmake --builddirectory=build --parallel
|
|
||||||
|
|
||||||
1
debian/source/format
vendored
|
|
@ -1 +0,0 @@
|
||||||
3.0 (native)
|
|
||||||
2
debian/source/lintian-overrides
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
file-without-copyright-information
|
|
||||||
binary-without-manpage
|
|
||||||
|
|
@ -1,234 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorCodeStyle>
|
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>CodeStyleData</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="AlignAssignments">false</value>
|
|
||||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
|
||||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToTypeName">false</value>
|
|
||||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
|
||||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
|
||||||
<value type="bool" key="IndentBlockBody">true</value>
|
|
||||||
<value type="bool" key="IndentBlockBraces">false</value>
|
|
||||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
|
||||||
<value type="bool" key="IndentClassBraces">false</value>
|
|
||||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
|
||||||
<value type="bool" key="IndentEnumBraces">false</value>
|
|
||||||
<value type="bool" key="IndentFunctionBody">true</value>
|
|
||||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
|
||||||
<value type="int" key="IndentSize">4</value>
|
|
||||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
|
||||||
<value type="int" key="PaddingMode">2</value>
|
|
||||||
<value type="bool" key="SpacesForTabs">false</value>
|
|
||||||
<value type="int" key="TabSize">4</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>DisplayName</variable>
|
|
||||||
<value type="QString">Synergy</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorCodeStyle>
|
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>CodeStyleData</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="AlignAssignments">false</value>
|
|
||||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
|
||||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToTypeName">false</value>
|
|
||||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
|
||||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
|
||||||
<value type="bool" key="IndentBlockBody">true</value>
|
|
||||||
<value type="bool" key="IndentBlockBraces">false</value>
|
|
||||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
|
||||||
<value type="bool" key="IndentClassBraces">false</value>
|
|
||||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
|
||||||
<value type="bool" key="IndentEnumBraces">false</value>
|
|
||||||
<value type="bool" key="IndentFunctionBody">true</value>
|
|
||||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
|
||||||
<value type="int" key="IndentSize">4</value>
|
|
||||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
|
||||||
<value type="int" key="PaddingMode">2</value>
|
|
||||||
<value type="bool" key="SpacesForTabs">false</value>
|
|
||||||
<value type="int" key="TabSize">4</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>DisplayName</variable>
|
|
||||||
<value type="QString">Synergy</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorCodeStyle>
|
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>CodeStyleData</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="AlignAssignments">false</value>
|
|
||||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
|
||||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToTypeName">false</value>
|
|
||||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
|
||||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
|
||||||
<value type="bool" key="IndentBlockBody">true</value>
|
|
||||||
<value type="bool" key="IndentBlockBraces">false</value>
|
|
||||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
|
||||||
<value type="bool" key="IndentClassBraces">false</value>
|
|
||||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
|
||||||
<value type="bool" key="IndentEnumBraces">false</value>
|
|
||||||
<value type="bool" key="IndentFunctionBody">true</value>
|
|
||||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
|
||||||
<value type="int" key="IndentSize">4</value>
|
|
||||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
|
||||||
<value type="int" key="PaddingMode">2</value>
|
|
||||||
<value type="bool" key="SpacesForTabs">false</value>
|
|
||||||
<value type="int" key="TabSize">4</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>DisplayName</variable>
|
|
||||||
<value type="QString">Synergy</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorCodeStyle>
|
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>CodeStyleData</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="AlignAssignments">false</value>
|
|
||||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
|
||||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToTypeName">false</value>
|
|
||||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
|
||||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
|
||||||
<value type="bool" key="IndentBlockBody">true</value>
|
|
||||||
<value type="bool" key="IndentBlockBraces">false</value>
|
|
||||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
|
||||||
<value type="bool" key="IndentClassBraces">false</value>
|
|
||||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
|
||||||
<value type="bool" key="IndentEnumBraces">false</value>
|
|
||||||
<value type="bool" key="IndentFunctionBody">true</value>
|
|
||||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
|
||||||
<value type="int" key="IndentSize">4</value>
|
|
||||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
|
||||||
<value type="int" key="PaddingMode">2</value>
|
|
||||||
<value type="bool" key="SpacesForTabs">false</value>
|
|
||||||
<value type="int" key="TabSize">4</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>DisplayName</variable>
|
|
||||||
<value type="QString">Synergy</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorCodeStyle>
|
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>CodeStyleData</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="AlignAssignments">false</value>
|
|
||||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
|
||||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToTypeName">false</value>
|
|
||||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
|
||||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
|
||||||
<value type="bool" key="IndentBlockBody">true</value>
|
|
||||||
<value type="bool" key="IndentBlockBraces">false</value>
|
|
||||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
|
||||||
<value type="bool" key="IndentClassBraces">false</value>
|
|
||||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
|
||||||
<value type="bool" key="IndentEnumBraces">false</value>
|
|
||||||
<value type="bool" key="IndentFunctionBody">true</value>
|
|
||||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
|
||||||
<value type="int" key="IndentSize">4</value>
|
|
||||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
|
||||||
<value type="int" key="PaddingMode">2</value>
|
|
||||||
<value type="bool" key="SpacesForTabs">false</value>
|
|
||||||
<value type="int" key="TabSize">4</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>DisplayName</variable>
|
|
||||||
<value type="QString">Synergy</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE QtCreatorCodeStyle>
|
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-02-14T09:50:24. -->
|
|
||||||
<qtcreator>
|
|
||||||
<data>
|
|
||||||
<variable>CodeStyleData</variable>
|
|
||||||
<valuemap type="QVariantMap">
|
|
||||||
<value type="bool" key="AlignAssignments">false</value>
|
|
||||||
<value type="bool" key="AutoSpacesForTabs">false</value>
|
|
||||||
<value type="bool" key="BindStarToIdentifier">true</value>
|
|
||||||
<value type="bool" key="BindStarToLeftSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToRightSpecifier">false</value>
|
|
||||||
<value type="bool" key="BindStarToTypeName">false</value>
|
|
||||||
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
|
|
||||||
<value type="bool" key="IndentAccessSpecifiers">false</value>
|
|
||||||
<value type="bool" key="IndentBlockBody">true</value>
|
|
||||||
<value type="bool" key="IndentBlockBraces">false</value>
|
|
||||||
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
|
|
||||||
<value type="bool" key="IndentClassBraces">false</value>
|
|
||||||
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
|
|
||||||
<value type="bool" key="IndentEnumBraces">false</value>
|
|
||||||
<value type="bool" key="IndentFunctionBody">true</value>
|
|
||||||
<value type="bool" key="IndentFunctionBraces">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBody">false</value>
|
|
||||||
<value type="bool" key="IndentNamespaceBraces">false</value>
|
|
||||||
<value type="int" key="IndentSize">4</value>
|
|
||||||
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
|
|
||||||
<value type="bool" key="IndentSwitchLabels">false</value>
|
|
||||||
<value type="int" key="PaddingMode">2</value>
|
|
||||||
<value type="bool" key="SpacesForTabs">false</value>
|
|
||||||
<value type="int" key="TabSize">4</value>
|
|
||||||
</valuemap>
|
|
||||||
</data>
|
|
||||||
<data>
|
|
||||||
<variable>DisplayName</variable>
|
|
||||||
<value type="QString">Synergy</value>
|
|
||||||
</data>
|
|
||||||
</qtcreator>
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
|
||||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<!-- Mac OSX only: Copy this plist file into [~]/Library/LaunchAgents to start synergy client automatically. Make sure you change the IP below. -->
|
|
||||||
<dict>
|
|
||||||
<key>Label</key>
|
|
||||||
<string>org.symless.com.synergyc.plist</string>
|
|
||||||
<key>OnDemand</key>
|
|
||||||
<false/>
|
|
||||||
<key>ProgramArguments</key>
|
|
||||||
<array>
|
|
||||||
<string>/usr/bin/synergyc</string>
|
|
||||||
<!-- Replace this IP with the IP of your synergys server -->
|
|
||||||
<string>192.168.0.2</string>
|
|
||||||
</array>
|
|
||||||
<key>RunAtLoad</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
|
||||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<!-- Mac OSX only: Copy this plist file into [~]/Library/LaunchAgents to start synergy server automatically. Make sure you change configuration file below -->
|
|
||||||
<dict>
|
|
||||||
<key>Label</key>
|
|
||||||
<string>org.symless.com.synergys.plist</string>
|
|
||||||
<key>OnDemand</key>
|
|
||||||
<false/>
|
|
||||||
<key>ProgramArguments</key>
|
|
||||||
<array>
|
|
||||||
<string>/usr/bin/synergys</string>
|
|
||||||
<string>--no-daemon</string>
|
|
||||||
<string>--config</string>
|
|
||||||
<!-- Replace this path with the path to your synergy configuration -->
|
|
||||||
<string>/Users/snorp/.synergy.conf</string>
|
|
||||||
</array>
|
|
||||||
<key>RunAtLoad</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
|
|
@ -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 <delta>\/\fR] [\fI\,--display <display>\/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name <screen-name>\/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug <level>\/\fR] \fI\,<server-address>\/\fR
|
|
||||||
.SH DESCRIPTION
|
|
||||||
Connect to a synergy mouse/keyboard sharing server.
|
|
||||||
.TP
|
|
||||||
\fB\-d\fR, \fB\-\-debug\fR <level>
|
|
||||||
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 <screen\-name> 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 <file>
|
|
||||||
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 <display>
|
|
||||||
connect to the X server at <display>
|
|
||||||
.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 <delta>
|
|
||||||
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: [<hostname>][:<port>]. 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.
|
|
||||||
|
|
@ -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 <address>\/\fR] [\fI\,--config <pathname>\/\fR] [\fI\,--display <display>\/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name <screen-name>\/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug <level>\/\fR]
|
|
||||||
.SH DESCRIPTION
|
|
||||||
Start the synergy mouse/keyboard sharing server.
|
|
||||||
.TP
|
|
||||||
\fB\-a\fR, \fB\-\-address\fR <address>
|
|
||||||
listen for clients on the given address.
|
|
||||||
.TP
|
|
||||||
\fB\-c\fR, \fB\-\-config\fR <pathname>
|
|
||||||
use the named configuration file instead.
|
|
||||||
.TP
|
|
||||||
\fB\-d\fR, \fB\-\-debug\fR <level>
|
|
||||||
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 <screen\-name> 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 <file>
|
|
||||||
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 <display>
|
|
||||||
connect to the X server at <display>
|
|
||||||
.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: [<hostname>][:<port>]. 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.
|
|
||||||
|
|
@ -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
|
|
||||||
33
res/dist/arch/PKGBUILD.in
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Maintainer: Synergy team <developers@symless.com>
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
Type=Application
|
Type=Application
|
||||||
Version=1.0
|
Version=1.0
|
||||||
Name=Synergy
|
Name=Synergy
|
||||||
Comment=Keyboard and mouse sharing solution
|
Comment=Mouse and keyboard sharing utility
|
||||||
Path=/usr/bin
|
Path=/usr/bin
|
||||||
Exec=/usr/bin/synergy
|
Exec=/usr/bin/synergy
|
||||||
Icon=synergy
|
Icon=synergy
|
||||||
32
res/dist/rpm/synergy-business.spec.in
vendored
|
|
@ -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 <engineering@symless.com>
|
|
||||||
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 <engineering@symless.com>
|
|
||||||
- Initial version of the package
|
|
||||||
32
res/dist/rpm/synergy-enterprise.spec.in
vendored
|
|
@ -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 <engineering@symless.com>
|
|
||||||
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 <engineering@symless.com>
|
|
||||||
- Initial version of the package
|
|
||||||
32
res/dist/rpm/synergy.spec.in
vendored
|
|
@ -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 <engineering@symless.com>
|
|
||||||
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 <engineering@symless.com>
|
|
||||||
- Initial version of the package
|
|
||||||
6
res/dist/wix/Product.wxs
vendored
|
|
@ -44,10 +44,10 @@
|
||||||
<?endif ?>
|
<?endif ?>
|
||||||
</DirectoryRef>
|
</DirectoryRef>
|
||||||
<Property Id="SynergyCommonBackground">common_background</Property>
|
<Property Id="SynergyCommonBackground">common_background</Property>
|
||||||
<Binary Id="common_background" SourceFile="$(var.ResPath)\common_background.png"/>
|
<Binary Id="common_background" SourceFile="$(var.ResPath)\dist\wix\images\common_background.png"/>
|
||||||
<Icon Id="synergy.ico" SourceFile="$(var.ResPath)/synergy.ico"/>
|
<Icon Id="synergy.ico" SourceFile="$(var.ResPath)/synergy.ico"/>
|
||||||
<WixVariable Id="WixUIBannerBmp" Value="$(var.ResPath)\banner.png"/>
|
<WixVariable Id="WixUIBannerBmp" Value="$(var.ResPath)\dist\wix\images\banner.png"/>
|
||||||
<WixVariable Id="WixUIDialogBmp" Value="$(var.ResPath)\dialog.png"/>
|
<WixVariable Id="WixUIDialogBmp" Value="$(var.ResPath)\dist\wix\images\dialog.png"/>
|
||||||
<Property Id="ARPPRODUCTICON" Value="synergy.ico"/>
|
<Property Id="ARPPRODUCTICON" Value="synergy.ico"/>
|
||||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
|
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
|
||||||
<Property Id="LEGACY_UNINSTALL_EXISTS">
|
<Property Id="LEGACY_UNINSTALL_EXISTS">
|
||||||
|
|
|
||||||
2
res/dist/wix/SynergyWelcome.wxs
vendored
|
|
@ -7,7 +7,7 @@
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<UI Id="SynergyWelcome">
|
<UI Id="SynergyWelcome">
|
||||||
<Property Id="SynergyWelcomeBackground">welcome_background</Property>
|
<Property Id="SynergyWelcomeBackground">welcome_background</Property>
|
||||||
<Binary Id="welcome_background" SourceFile="$(var.ResPath)\welcome_background.png"/>
|
<Binary Id="welcome_background" SourceFile="$(var.ResPath)\dist\wix\images\welcome_background.png"/>
|
||||||
|
|
||||||
<Dialog Id="SynergyWelcome" Width="370" Height="270" Title="!(loc.WelcomeDlg_Title)">
|
<Dialog Id="SynergyWelcome" Width="370" Height="270" Title="!(loc.WelcomeDlg_Title)">
|
||||||
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
|
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
BIN
res/synergy.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
|
@ -1,11 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Type=Application
|
|
||||||
Version=1.0
|
|
||||||
Name=Synergy
|
|
||||||
Comment=Keyboard and mouse sharing solution
|
|
||||||
Path=/usr/bin
|
|
||||||
Exec=/usr/bin/synergy2
|
|
||||||
Icon=synergy
|
|
||||||
Terminal=false
|
|
||||||
Categories=Utility;
|
|
||||||
Keywords=keyboard;mouse;sharing;network;share;
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
import argparse
|
import argparse
|
||||||
import lib.env as env
|
import lib.env as env
|
||||||
import lib.github as github
|
import lib.github as github
|
||||||
from lib.config import Config
|
|
||||||
|
|
||||||
qt_version_key = "QT_VERSION"
|
qt_version_key = "QT_VERSION"
|
||||||
|
|
||||||
|
|
@ -20,6 +19,8 @@ def main():
|
||||||
# important: load venv before loading modules that install deps.
|
# important: load venv before loading modules that install deps.
|
||||||
env.ensure_in_venv(__file__)
|
env.ensure_in_venv(__file__)
|
||||||
|
|
||||||
|
from lib.config import Config
|
||||||
|
|
||||||
if args.set_qt_version:
|
if args.set_qt_version:
|
||||||
config = Config()
|
config = Config()
|
||||||
_qt_mirror, qt_version, _qt_install_dir = config.get_qt_config()
|
_qt_mirror, qt_version, _qt_install_dir = config.get_qt_config()
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,9 @@ def main():
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# ensures that pip and venv are available for `ensure_module` function.
|
|
||||||
env.ensure_dependencies()
|
env.ensure_dependencies()
|
||||||
|
env.ensure_in_venv(__file__, auto_create=True)
|
||||||
# important: load venv before loading modules that install deps.
|
env.install_requirements()
|
||||||
env.ensure_in_venv(__file__)
|
|
||||||
|
|
||||||
error = False
|
error = False
|
||||||
try:
|
try:
|
||||||
|
|
@ -107,7 +105,7 @@ class Dependencies:
|
||||||
def linux(self):
|
def linux(self):
|
||||||
"""Installs dependencies on Linux."""
|
"""Installs dependencies on Linux."""
|
||||||
|
|
||||||
distro = env.get_linux_distro()
|
distro, _distro_like, _distro_version = env.get_linux_distro()
|
||||||
if not distro:
|
if not distro:
|
||||||
raise RuntimeError("Unable to detect Linux distro")
|
raise RuntimeError("Unable to detect Linux distro")
|
||||||
|
|
||||||
|
|
@ -122,9 +120,9 @@ class Dependencies:
|
||||||
print("The 'sudo' command was not found, stripping sudo from command")
|
print("The 'sudo' command was not found, stripping sudo from command")
|
||||||
command = command.replace("sudo ", "").strip()
|
command = command.replace("sudo ", "").strip()
|
||||||
|
|
||||||
# don't check the return code, as some package managers return non-zero exit codes
|
# On Fedora, dnf update returns code 100 when updates are available, but the last command
|
||||||
# under normal circumstances (e.g. dnf returns 100 when there are updates available).
|
# run should be dnf install, so the return code should always be 0.
|
||||||
cmd_utils.run(command, check=False, shell=True, print_cmd=True)
|
cmd_utils.run(command, shell=True, print_cmd=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import lib.env as env
|
||||||
|
|
||||||
|
|
||||||
def has_command(command):
|
def has_command(command):
|
||||||
|
|
@ -34,7 +35,6 @@ def strip_continuation_sequences(command):
|
||||||
return command.replace(cmd_continuation, "")
|
return command.replace(cmd_continuation, "")
|
||||||
|
|
||||||
|
|
||||||
# TODO: fix bug: often when using this function, only the first arg element is sent to subprocess.run
|
|
||||||
def run(
|
def run(
|
||||||
command,
|
command,
|
||||||
check=True, # true by default to fail fast
|
check=True, # true by default to fail fast
|
||||||
|
|
@ -61,9 +61,11 @@ def run(
|
||||||
print_cmd (bool): Print the command before running it (false by default for security)
|
print_cmd (bool): Print the command before running it (false by default for security)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
is_list_cmd = isinstance(command, list)
|
||||||
|
|
||||||
# create string version of list command, only for debugging purposes
|
# create string version of list command, only for debugging purposes
|
||||||
command_str = command
|
command_str = command
|
||||||
if isinstance(command, list):
|
if is_list_cmd:
|
||||||
command_str = " ".join(command)
|
command_str = " ".join(command)
|
||||||
|
|
||||||
if print_cmd:
|
if print_cmd:
|
||||||
|
|
@ -72,6 +74,19 @@ def run(
|
||||||
print("Running command...")
|
print("Running command...")
|
||||||
command_str = "***"
|
command_str = "***"
|
||||||
|
|
||||||
|
# TODO: You can definitely use a list command with shell=True on Windows,
|
||||||
|
# but can you use a string command with shell=False on Windows?
|
||||||
|
#
|
||||||
|
# The `subprocess.run` function has a little gotcha:
|
||||||
|
# - a string command must be used when `shell=True`
|
||||||
|
# - a list command must be used when shell isn't or `shell=False`
|
||||||
|
# however, it allows you to pass a string command when shell isn't used or `shell=False`
|
||||||
|
# then fails with a vague error message. same problem with list commands and `shell=True`
|
||||||
|
if not env.is_windows() and is_list_cmd and shell:
|
||||||
|
raise ValueError("List commands cannot be used when shell=True on Unix systems")
|
||||||
|
elif not is_list_cmd and not shell:
|
||||||
|
raise ValueError("String commands cannot be used when shell=False or not set")
|
||||||
|
|
||||||
# Flush the output to ensure the command is printed before the output of the command,
|
# Flush the output to ensure the command is printed before the output of the command,
|
||||||
# which seems to happen in the GitHub runner logs.
|
# which seems to happen in the GitHub runner logs.
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
@ -89,6 +104,7 @@ def run(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
result = subprocess.run(command, check=check, shell=shell)
|
result = subprocess.run(command, check=check, shell=shell)
|
||||||
|
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
# Take control of how failed commands are printed:
|
# Take control of how failed commands are printed:
|
||||||
# - if `print_cmd` is false, it will print `***` instead of the command
|
# - if `print_cmd` is false, it will print `***` instead of the command
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
|
import yaml
|
||||||
import lib.env as env
|
import lib.env as env
|
||||||
import lib.cmd_utils as cmd_utils
|
import lib.cmd_utils as cmd_utils
|
||||||
|
|
||||||
config_file = "config.yml"
|
config_file = "config.yaml"
|
||||||
root_key = "config"
|
root_key = "config"
|
||||||
deps_key = "dependencies"
|
deps_key = "dependencies"
|
||||||
|
|
||||||
|
|
@ -20,7 +21,7 @@ def _get(dict, key, key_parent=None):
|
||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
key_path = f"{root_key}:{key_parent}:{key}" if key_parent else key
|
key_path = f"{root_key}:{key_parent}:{key}" if key_parent else key
|
||||||
raise ConfigKeyError(f"Missing key in {config_file}: {key_path}")
|
raise ConfigKeyError(config_file, key_path)
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
@ -29,18 +30,18 @@ class Config:
|
||||||
"""Reads the project configuration YAML file."""
|
"""Reads the project configuration YAML file."""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
env.ensure_module("yaml", "pyyaml")
|
|
||||||
import yaml
|
|
||||||
|
|
||||||
with open(config_file, "r") as f:
|
with open(config_file, "r") as f:
|
||||||
data = yaml.safe_load(f)
|
data = yaml.safe_load(f)
|
||||||
|
|
||||||
self.os_name = env.get_os()
|
self.os_name = env.get_os()
|
||||||
|
|
||||||
|
print("Config for OS:", self.os_name)
|
||||||
root = _get(data, root_key)
|
root = _get(data, root_key)
|
||||||
self.os = _get(root, self.os_name)
|
self.os = _get(root, self.os_name)
|
||||||
|
|
||||||
def get_os_value(self, key):
|
def get_os_value(self, key):
|
||||||
return _get(self.os, key, f"{self.os_name}:{key}")
|
return _get(self.os, key, self.os_name)
|
||||||
|
|
||||||
def get_qt_config(self):
|
def get_qt_config(self):
|
||||||
qt_key = "qt"
|
qt_key = "qt"
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import os, sys, subprocess
|
||||||
import lib.cmd_utils as cmd_utils
|
import lib.cmd_utils as cmd_utils
|
||||||
|
|
||||||
venv_path = "build/python"
|
venv_path = "build/python"
|
||||||
version_file = "VERSION"
|
|
||||||
version_env_var = "SYNERGY_VERSION"
|
|
||||||
|
|
||||||
|
|
||||||
def check_module(module):
|
def check_module(module):
|
||||||
|
|
@ -47,22 +45,47 @@ def is_running_in_ci():
|
||||||
def get_linux_distro():
|
def get_linux_distro():
|
||||||
"""Detects the Linux distro."""
|
"""Detects the Linux distro."""
|
||||||
os_file = "/etc/os-release"
|
os_file = "/etc/os-release"
|
||||||
|
name = None
|
||||||
|
name_like = None
|
||||||
|
version = None
|
||||||
|
|
||||||
if os.path.isfile(os_file):
|
if os.path.isfile(os_file):
|
||||||
with open(os_file) as f:
|
with open(os_file) as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if line.startswith("ID="):
|
if line.startswith("ID="):
|
||||||
return line.strip().split("=")[1].strip('"')
|
name = line.strip().split("=")[1].strip('"')
|
||||||
return None
|
elif line.startswith("ID_LIKE="):
|
||||||
|
name_like = line.strip().split("=")[1].strip('"')
|
||||||
|
elif line.startswith("VERSION_ID="):
|
||||||
|
version = line.strip().split("=")[1].strip('"')
|
||||||
|
|
||||||
|
return name, name_like, version
|
||||||
|
|
||||||
|
|
||||||
def get_env_var(name):
|
def get_env(name, required=True):
|
||||||
"""Returns an env var or raises an error if it is not set."""
|
"""Returns an env var (stripped) or optionally raises an error if not set."""
|
||||||
value = os.getenv(name)
|
value = os.getenv(name)
|
||||||
if not value:
|
if value:
|
||||||
raise ValueError(f"Environment variable not set: {name}")
|
value = value.strip()
|
||||||
|
|
||||||
|
if required and not value:
|
||||||
|
raise ValueError(f"Required env var not set: {name}")
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def get_env_bool(name, default=False):
|
||||||
|
"""Returns a boolean value from an env var (stripped)."""
|
||||||
|
value = os.getenv(name)
|
||||||
|
if value:
|
||||||
|
value = value.strip()
|
||||||
|
|
||||||
|
if value is None:
|
||||||
|
return default
|
||||||
|
|
||||||
|
return value.lower() in ["true", "1", "yes"]
|
||||||
|
|
||||||
|
|
||||||
def get_python_executable(binary="python"):
|
def get_python_executable(binary="python"):
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
return os.path.join(venv_path, "Scripts", binary)
|
return os.path.join(venv_path, "Scripts", binary)
|
||||||
|
|
@ -75,46 +98,47 @@ def in_venv():
|
||||||
return sys.prefix != sys.base_prefix
|
return sys.prefix != sys.base_prefix
|
||||||
|
|
||||||
|
|
||||||
def ensure_in_venv(script_file):
|
def ensure_in_venv(script_file, auto_create=False):
|
||||||
"""
|
"""
|
||||||
Ensures the script is running in a Python virtual environment (venv).
|
Ensures the script is running in a Python virtual environment (venv).
|
||||||
If the script is not running in a venv, it will create one and re-run the script in the venv.
|
If the script is not running in a venv, it will create one and re-run the script in the venv.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
assert_dependencies()
|
check_dependencies(raise_error=True)
|
||||||
import venv
|
import venv
|
||||||
|
|
||||||
if not in_venv():
|
if not in_venv():
|
||||||
if not os.path.exists(venv_path):
|
if not os.path.exists(venv_path):
|
||||||
|
if not auto_create:
|
||||||
|
print("Hint: Run the `install_deps.py` script first.")
|
||||||
|
raise RuntimeError(f"Virtual environment not found at: {venv_path}")
|
||||||
|
|
||||||
print(f"Creating virtual environment at {venv_path}")
|
print(f"Creating virtual environment at {venv_path}")
|
||||||
venv.create(venv_path, with_pip=True)
|
venv.create(venv_path, with_pip=True)
|
||||||
|
|
||||||
print(f"Using virtual environment for {script_file}", flush=True)
|
script_file_abs = os.path.abspath(script_file)
|
||||||
|
print(f"Using virtual environment for: {script_file_abs}", flush=True)
|
||||||
python_executable = get_python_executable()
|
python_executable = get_python_executable()
|
||||||
result = subprocess.run([python_executable, script_file] + sys.argv[1:])
|
result = subprocess.run([python_executable, script_file_abs] + sys.argv[1:])
|
||||||
sys.exit(result.returncode)
|
sys.exit(result.returncode)
|
||||||
|
|
||||||
|
|
||||||
# TODO: Use requirements.txt or pyproject.toml to specify dependencies
|
def install_requirements():
|
||||||
def ensure_module(module, package):
|
|
||||||
"""
|
"""
|
||||||
Ensures that a Python module is available, and installs the package if it is not.
|
Uses `pip` to install required Python modules from the `requirements.txt` file.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
assert_dependencies()
|
check_dependencies(raise_error=True)
|
||||||
|
|
||||||
try:
|
print("Installing required modules...")
|
||||||
__import__(module)
|
|
||||||
except ImportError:
|
|
||||||
print(f"Python missing {module}, installing {package}...", file=sys.stderr)
|
|
||||||
cmd_utils.run(
|
cmd_utils.run(
|
||||||
[sys.executable, "-m", "pip", "install", package],
|
[sys.executable, "-m", "pip", "install", "-r", "scripts/requirements.txt"],
|
||||||
shell=False,
|
shell=False,
|
||||||
print_cmd=True,
|
print_cmd=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def assert_dependencies(raise_error=True):
|
def check_dependencies(raise_error=False):
|
||||||
"""
|
"""
|
||||||
Returns True if pip and venv are available.
|
Returns True if pip and venv are available.
|
||||||
"""
|
"""
|
||||||
|
|
@ -137,7 +161,7 @@ def ensure_dependencies():
|
||||||
This is normally only installs on Linux, as Windows and Mac usually come with pip and venv.
|
This is normally only installs on Linux, as Windows and Mac usually come with pip and venv.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if assert_dependencies(raise_error=False):
|
if check_dependencies():
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Installing Python dependencies...")
|
print("Installing Python dependencies...")
|
||||||
|
|
@ -150,38 +174,44 @@ def ensure_dependencies():
|
||||||
has_sudo = cmd_utils.has_command("sudo")
|
has_sudo = cmd_utils.has_command("sudo")
|
||||||
sudo = "sudo" if has_sudo else ""
|
sudo = "sudo" if has_sudo else ""
|
||||||
|
|
||||||
distro = get_linux_distro()
|
distro, distro_like, _version = get_linux_distro()
|
||||||
if distro == "ubuntu" or distro == "debian":
|
if not distro_like:
|
||||||
cmd_utils.run(
|
distro_like = distro
|
||||||
f"{sudo} apt update".strip(), check=False, shell=True, print_cmd=True
|
|
||||||
)
|
update_cmd = None
|
||||||
cmd_utils.run(
|
install_cmd = None
|
||||||
f"{sudo} apt install -y python3-pip python3-venv".strip(),
|
if "debian" in distro_like:
|
||||||
shell=True,
|
update_cmd = "apt update"
|
||||||
print_cmd=True,
|
install_cmd = "apt install -y python3-pip python3-venv"
|
||||||
)
|
elif "fedora" in distro_like:
|
||||||
elif distro == "fedora" or distro == "centos":
|
update_cmd = "dnf check-update"
|
||||||
cmd_utils.run(
|
install_cmd = "dnf install -y python3-pip python3-virtualenv"
|
||||||
f"{sudo} dnf check-update".strip(), check=False, shell=True, print_cmd=True
|
elif "arch" in distro_like:
|
||||||
)
|
install_cmd = "pacman -Syu --noconfirm python-pip python-virtualenv"
|
||||||
cmd_utils.run(
|
elif "opensuse" in distro_like:
|
||||||
f"{sudo} dnf install -y python3-pip python3-virtualenv".strip(),
|
update_cmd = "zypper refresh"
|
||||||
shell=True,
|
install_cmd = "zypper install -y python3-pip python3-virtualenv"
|
||||||
print_cmd=True,
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
# arch, opensuse, etc, patches welcome! :)
|
|
||||||
raise RuntimeError(f"Unable to install Python dependencies on {distro}")
|
raise RuntimeError(f"Unable to install Python dependencies on {distro}")
|
||||||
|
|
||||||
|
if update_cmd:
|
||||||
|
# don't check the return code, as some package managers return non-zero exit codes
|
||||||
|
# under normal circumstances (e.g. dnf check-update returns 100 when there are
|
||||||
|
# updates available).
|
||||||
|
cmd_utils.run(
|
||||||
|
f"{sudo} {update_cmd}".strip(), check=False, shell=True, print_cmd=True
|
||||||
|
)
|
||||||
|
|
||||||
|
cmd_utils.run(f"{sudo} {install_cmd}".strip(), shell=True, print_cmd=True)
|
||||||
|
|
||||||
|
|
||||||
def get_app_version():
|
def get_app_version():
|
||||||
"""
|
"""
|
||||||
Returns the version either from the env var, or from the version file.
|
Returns the version either from the env var, or from the version file.
|
||||||
"""
|
"""
|
||||||
if version_env_var in os.environ:
|
version = get_env("SYNERGY_VERSION", required=False)
|
||||||
version = os.environ[version_env_var].strip()
|
|
||||||
if version:
|
if version:
|
||||||
return version
|
return version
|
||||||
|
|
||||||
with open(version_file, "r") as f:
|
with open("VERSION", "r") as f:
|
||||||
return f.read().strip()
|
return f.read().strip()
|
||||||
|
|
|
||||||
87
scripts/lib/linux.py
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
import os, shutil, glob
|
||||||
|
import lib.cmd_utils as cmd_utils
|
||||||
|
import lib.env as env
|
||||||
|
|
||||||
|
dist_dir = "dist"
|
||||||
|
build_dir = "build"
|
||||||
|
|
||||||
|
|
||||||
|
def package(filename_base, build_distro=True, build_tgz=False, build_stgz=False):
|
||||||
|
|
||||||
|
extension, cmd = get_package_info(build_distro, build_tgz, build_stgz)
|
||||||
|
run_package_cmd(cmd)
|
||||||
|
package_filename = get_package_filename(extension)
|
||||||
|
target_file = f"{filename_base}.{extension}"
|
||||||
|
copy_to_dist_dir(package_filename, target_file)
|
||||||
|
|
||||||
|
|
||||||
|
def get_package_info(build_distro, build_tgz, build_stgz):
|
||||||
|
|
||||||
|
command = None
|
||||||
|
cpack_generator = None
|
||||||
|
file_extension = None
|
||||||
|
|
||||||
|
if build_tgz:
|
||||||
|
cpack_generator = "TGZ"
|
||||||
|
file_extension = "tar.gz"
|
||||||
|
|
||||||
|
elif build_stgz:
|
||||||
|
cpack_generator = "STGZ"
|
||||||
|
file_extension = "sh"
|
||||||
|
|
||||||
|
elif build_distro:
|
||||||
|
|
||||||
|
distro, distro_like, _distro_version = env.get_linux_distro()
|
||||||
|
if not distro_like:
|
||||||
|
distro_like = distro
|
||||||
|
|
||||||
|
if "debian" in distro_like:
|
||||||
|
cpack_generator = "DEB"
|
||||||
|
file_extension = "deb"
|
||||||
|
elif "fedora" in distro_like or "opensuse" in distro_like:
|
||||||
|
cpack_generator = "RPM"
|
||||||
|
file_extension = "rpm"
|
||||||
|
elif "arch" in distro_like:
|
||||||
|
command = ["makepkg", "-s"]
|
||||||
|
file_extension = "pkg.tar.zst"
|
||||||
|
else:
|
||||||
|
raise RuntimeError(f"Linux distro not yet supported: {distro_like}")
|
||||||
|
|
||||||
|
if not cpack_generator and not command:
|
||||||
|
raise RuntimeError("No package generator or command found")
|
||||||
|
|
||||||
|
if cpack_generator:
|
||||||
|
command = ["cpack", "-G", cpack_generator]
|
||||||
|
|
||||||
|
return file_extension, command
|
||||||
|
|
||||||
|
|
||||||
|
def run_package_cmd(command):
|
||||||
|
package_user = env.get_env("LINUX_PACKAGE_USER", required=False)
|
||||||
|
if package_user:
|
||||||
|
cmd_utils.run(["sudo", "chown", "-R", package_user, "build"], check=True)
|
||||||
|
command = ["sudo", "-u", package_user] + command
|
||||||
|
|
||||||
|
cwd = os.getcwd()
|
||||||
|
try:
|
||||||
|
os.chdir("build")
|
||||||
|
cmd_utils.run(command, check=True, print_cmd=True)
|
||||||
|
finally:
|
||||||
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
|
||||||
|
def get_package_filename(extension):
|
||||||
|
files = glob.glob(f"build/*.{extension}")
|
||||||
|
|
||||||
|
if not files:
|
||||||
|
raise ValueError(f"No .{extension} file found in build directory")
|
||||||
|
|
||||||
|
return files[0]
|
||||||
|
|
||||||
|
|
||||||
|
def copy_to_dist_dir(source_file, target_file):
|
||||||
|
os.makedirs(dist_dir, exist_ok=True)
|
||||||
|
|
||||||
|
target_path = f"{dist_dir}/{target_file}"
|
||||||
|
print(f"Copying to: {target_path}")
|
||||||
|
shutil.copy(source_file, target_path)
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import dmgbuild # type: ignore
|
||||||
import os, time, json
|
import os, time, json
|
||||||
import lib.cmd_utils as cmd_utils
|
import lib.cmd_utils as cmd_utils
|
||||||
import lib.env as env
|
import lib.env as env
|
||||||
|
|
@ -39,9 +40,9 @@ def set_cmake_prefix_env_var(cmake_prefix_command):
|
||||||
|
|
||||||
|
|
||||||
def package(filename_base):
|
def package(filename_base):
|
||||||
codesign_id = env.get_env_var("APPLE_CODESIGN_ID")
|
codesign_id = env.get_env("APPLE_CODESIGN_ID")
|
||||||
cert_base64 = env.get_env_var("APPLE_P12_CERTIFICATE")
|
cert_base64 = env.get_env("APPLE_P12_CERTIFICATE")
|
||||||
cert_password = env.get_env_var("APPLE_P12_PASSWORD")
|
cert_password = env.get_env("APPLE_P12_PASSWORD")
|
||||||
|
|
||||||
build_bundle()
|
build_bundle()
|
||||||
install_certificate(cert_base64, cert_password)
|
install_certificate(cert_base64, cert_password)
|
||||||
|
|
@ -86,9 +87,6 @@ def assert_certificate_installed(codesign_id):
|
||||||
|
|
||||||
|
|
||||||
def build_dmg(filename_base):
|
def build_dmg(filename_base):
|
||||||
env.ensure_module("dmgbuild", "dmgbuild")
|
|
||||||
import dmgbuild # type: ignore
|
|
||||||
|
|
||||||
settings_file_abs = os.path.abspath(settings_file)
|
settings_file_abs = os.path.abspath(settings_file)
|
||||||
app_path_abs = os.path.abspath(app_path)
|
app_path_abs = os.path.abspath(app_path)
|
||||||
|
|
||||||
|
|
@ -152,9 +150,9 @@ def notarize_package(dmg_path):
|
||||||
print(f"Notarizing package {dmg_path}...")
|
print(f"Notarizing package {dmg_path}...")
|
||||||
notary_tool = NotaryTool()
|
notary_tool = NotaryTool()
|
||||||
notary_tool.store_credentials(
|
notary_tool.store_credentials(
|
||||||
env.get_env_var("APPLE_NOTARY_USER"),
|
env.get_env("APPLE_NOTARY_USER"),
|
||||||
env.get_env_var("APPLE_NOTARY_PASSWORD"),
|
env.get_env("APPLE_NOTARY_PASSWORD"),
|
||||||
env.get_env_var("APPLE_TEAM_ID"),
|
env.get_env("APPLE_TEAM_ID"),
|
||||||
)
|
)
|
||||||
|
|
||||||
notary_tool.submit_and_wait(dmg_path)
|
notary_tool.submit_and_wait(dmg_path)
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ def set_env_var(name, value):
|
||||||
|
|
||||||
|
|
||||||
def package(filename_base):
|
def package(filename_base):
|
||||||
cert_base64 = env.get_env_var("WINDOWS_PFX_CERTIFICATE")
|
cert_base64 = env.get_env("WINDOWS_PFX_CERTIFICATE")
|
||||||
cert_password = env.get_env_var("WINDOWS_PFX_PASSWORD")
|
cert_password = env.get_env("WINDOWS_PFX_PASSWORD")
|
||||||
|
|
||||||
sign_binaries(cert_base64, cert_password)
|
sign_binaries(cert_base64, cert_password)
|
||||||
build_msi(filename_base)
|
build_msi(filename_base)
|
||||||
|
|
@ -126,8 +126,7 @@ def run_codesign(path, cert_base64, cert_password):
|
||||||
"/fd",
|
"/fd",
|
||||||
hashing_algorithm,
|
hashing_algorithm,
|
||||||
path,
|
path,
|
||||||
],
|
]
|
||||||
shell=True,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -166,7 +165,6 @@ class WindowsChoco:
|
||||||
value_arg = f'--value="{runner_temp}/choco"'
|
value_arg = f'--value="{runner_temp}/choco"'
|
||||||
cmd_utils.run(
|
cmd_utils.run(
|
||||||
["choco", "config", "set", key_arg, value_arg],
|
["choco", "config", "set", key_arg, value_arg],
|
||||||
shell=True,
|
|
||||||
print_cmd=True,
|
print_cmd=True,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
51
scripts/lint_cmake_files.py
Executable file
|
|
@ -0,0 +1,51 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sys, os, argparse, fnmatch
|
||||||
|
import lib.env as env
|
||||||
|
|
||||||
|
include_files = [
|
||||||
|
"*.cmake",
|
||||||
|
"CMakeLists.txt",
|
||||||
|
]
|
||||||
|
|
||||||
|
exclude_dirs = [
|
||||||
|
"ext",
|
||||||
|
"build",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def find_files(base_dir, include_files, exclude_dirs):
|
||||||
|
"""Recursively find files, excluding specified directories"""
|
||||||
|
matches = []
|
||||||
|
for root, dirnames, filenames in os.walk(base_dir):
|
||||||
|
dirnames[:] = [d for d in dirnames if d not in exclude_dirs]
|
||||||
|
|
||||||
|
for pattern in include_files:
|
||||||
|
for filename in fnmatch.filter(filenames, pattern):
|
||||||
|
matches.append(os.path.join(root, filename))
|
||||||
|
return matches
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("--format", action="store_true", help="Formats all CMake files")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# important: load venv before loading modules that install deps.
|
||||||
|
env.ensure_in_venv(__file__)
|
||||||
|
|
||||||
|
from cmakelang.format.__main__ import main as cmake_format_main
|
||||||
|
|
||||||
|
new_args = ["--in-place"] if args.format else ["--check"]
|
||||||
|
files_recursive = find_files(".", include_files, exclude_dirs)
|
||||||
|
|
||||||
|
if files_recursive:
|
||||||
|
sys.argv = [""] + new_args + files_recursive
|
||||||
|
sys.exit(cmake_format_main())
|
||||||
|
else:
|
||||||
|
print("No CMake files found to process.")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
@ -4,14 +4,13 @@ import platform
|
||||||
import lib.env as env
|
import lib.env as env
|
||||||
|
|
||||||
env_file = ".env"
|
env_file = ".env"
|
||||||
package_filename_product = "synergy"
|
package_name = "synergy"
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# important: load venv before loading modules that install deps.
|
# important: load venv before loading modules that install deps.
|
||||||
env.ensure_in_venv(__file__)
|
env.ensure_in_venv(__file__)
|
||||||
|
|
||||||
env.ensure_module("dotenv", "python-dotenv")
|
|
||||||
from dotenv import load_dotenv # type: ignore
|
from dotenv import load_dotenv # type: ignore
|
||||||
|
|
||||||
load_dotenv(dotenv_path=env_file)
|
load_dotenv(dotenv_path=env_file)
|
||||||
|
|
@ -25,15 +24,28 @@ def main():
|
||||||
elif env.is_mac():
|
elif env.is_mac():
|
||||||
mac_package(filename_base)
|
mac_package(filename_base)
|
||||||
elif env.is_linux():
|
elif env.is_linux():
|
||||||
linux_package(filename_base)
|
linux_package(filename_base, version)
|
||||||
else:
|
else:
|
||||||
raise RuntimeError(f"Unsupported platform: {env.get_os()}")
|
raise RuntimeError(f"Unsupported platform: {env.get_os()}")
|
||||||
|
|
||||||
|
|
||||||
def get_filename_base(version):
|
def get_filename_base(version, use_linux_distro=True):
|
||||||
os = env.get_os()
|
os = env.get_os()
|
||||||
machine = platform.machine().lower()
|
machine = platform.machine().lower()
|
||||||
return f"{package_filename_product}-{os}-{machine}-{version}"
|
if os == "linux" and use_linux_distro:
|
||||||
|
distro_name, _distro_like, distro_version = env.get_linux_distro()
|
||||||
|
if not distro_name:
|
||||||
|
raise RuntimeError("Failed to detect Linux distro")
|
||||||
|
|
||||||
|
if distro_version:
|
||||||
|
version_for_filename = distro_version.replace(".", "_")
|
||||||
|
distro = f"{distro_name}-{version_for_filename}"
|
||||||
|
else:
|
||||||
|
distro = distro_name
|
||||||
|
|
||||||
|
return f"{package_name}-{distro}-{machine}-{version}"
|
||||||
|
else:
|
||||||
|
return f"{package_name}-{os}-{machine}-{version}"
|
||||||
|
|
||||||
|
|
||||||
def windows_package(filename_base):
|
def windows_package(filename_base):
|
||||||
|
|
@ -48,9 +60,17 @@ def mac_package(filename_base):
|
||||||
mac.package(filename_base)
|
mac.package(filename_base)
|
||||||
|
|
||||||
|
|
||||||
def linux_package(filename_base):
|
def linux_package(filename_base, version):
|
||||||
"""TODO: Linux packaging"""
|
import lib.linux as linux
|
||||||
pass
|
|
||||||
|
extra_packages = env.get_env_bool("LINUX_EXTRA_PACKAGES", False)
|
||||||
|
|
||||||
|
linux.package(filename_base)
|
||||||
|
|
||||||
|
if extra_packages:
|
||||||
|
filename_base = get_filename_base(version, use_linux_distro=False)
|
||||||
|
linux.package(filename_base, build_tgz=True)
|
||||||
|
linux.package(filename_base, build_stgz=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
4
scripts/requirements.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
cmake_format
|
||||||
|
python-dotenv
|
||||||
|
pyyaml
|
||||||
|
dmgbuild; sys_platform == 'darwin'
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2011 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2011 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2022 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -16,24 +16,30 @@
|
||||||
|
|
||||||
set(target synergy-core)
|
set(target synergy-core)
|
||||||
|
|
||||||
set(sources
|
set(sources ${target}.cpp)
|
||||||
${target}.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND sources
|
list(APPEND sources ${target}.exe.manifest ${CMAKE_BINARY_DIR}/src/version.rc)
|
||||||
${target}.exe.manifest
|
|
||||||
${CMAKE_BINARY_DIR}/src/version.rc
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
target_link_libraries(${target}
|
target_link_libraries(
|
||||||
arch base client common io mt net ipc platform server synlib ${libs})
|
${target}
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
client
|
||||||
|
common
|
||||||
|
io
|
||||||
|
mt
|
||||||
|
net
|
||||||
|
ipc
|
||||||
|
platform
|
||||||
|
server
|
||||||
|
synlib
|
||||||
|
${libs})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
install(TARGETS ${target} DESTINATION bin)
|
install(TARGETS ${target} DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
|
|
||||||
set(target synergyc)
|
set(target synergyc)
|
||||||
|
|
||||||
set(sources
|
set(sources ${target}.cpp)
|
||||||
${target}.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
file(GLOB arch_headers "MSWindows*.h")
|
file(GLOB arch_headers "MSWindows*.h")
|
||||||
file(GLOB arch_sources "MSWindows*.cpp")
|
file(GLOB arch_sources "MSWindows*.cpp")
|
||||||
list(APPEND sources
|
list(
|
||||||
|
APPEND
|
||||||
|
sources
|
||||||
resource.h
|
resource.h
|
||||||
${target}.ico
|
${target}.ico
|
||||||
${target}.rc
|
${target}.rc
|
||||||
|
|
@ -32,8 +32,7 @@ if (WIN32)
|
||||||
tb_run.ico
|
tb_run.ico
|
||||||
tb_wait.ico
|
tb_wait.ico
|
||||||
${target}.exe.manifest
|
${target}.exe.manifest
|
||||||
${CMAKE_BINARY_DIR}/src/version.rc
|
${CMAKE_BINARY_DIR}/src/version.rc)
|
||||||
)
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
file(GLOB arch_headers "OSX*.h")
|
file(GLOB arch_headers "OSX*.h")
|
||||||
file(GLOB arch_sources "OSX*.cpp")
|
file(GLOB arch_sources "OSX*.cpp")
|
||||||
|
|
@ -50,12 +49,23 @@ if (SYNERGY_ADD_HEADERS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
target_link_libraries(${target}
|
target_link_libraries(
|
||||||
arch base client common io mt net ipc platform server synlib ${libs})
|
${target}
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
client
|
||||||
|
common
|
||||||
|
io
|
||||||
|
mt
|
||||||
|
net
|
||||||
|
ipc
|
||||||
|
platform
|
||||||
|
server
|
||||||
|
synlib
|
||||||
|
${libs})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
install(TARGETS ${target} DESTINATION bin)
|
install(TARGETS ${target} DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2012 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -20,15 +20,21 @@ file(GLOB headers "*.h")
|
||||||
file(GLOB sources "*.cpp")
|
file(GLOB sources "*.cpp")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_executable (
|
add_executable(${target} WIN32 ${sources} ${CMAKE_BINARY_DIR}/src/version.rc)
|
||||||
${target}
|
|
||||||
WIN32
|
|
||||||
${sources}
|
|
||||||
${CMAKE_BINARY_DIR}/src/version.rc
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries (${target}
|
target_link_libraries(
|
||||||
arch base common io ipc mt net platform synlib shared ${libs})
|
${target}
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
common
|
||||||
|
io
|
||||||
|
ipc
|
||||||
|
mt
|
||||||
|
net
|
||||||
|
platform
|
||||||
|
synlib
|
||||||
|
shared
|
||||||
|
${libs})
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
|
|
||||||
set(target synergys)
|
set(target synergys)
|
||||||
|
|
||||||
set(sources
|
set(sources ${target}.cpp)
|
||||||
${target}.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
file(GLOB arch_headers "MSWindows*.h")
|
file(GLOB arch_headers "MSWindows*.h")
|
||||||
file(GLOB arch_sources "MSWindows*.cpp")
|
file(GLOB arch_sources "MSWindows*.cpp")
|
||||||
list(APPEND sources
|
list(
|
||||||
|
APPEND
|
||||||
|
sources
|
||||||
resource.h
|
resource.h
|
||||||
${target}.ico
|
${target}.ico
|
||||||
${target}.rc
|
${target}.rc
|
||||||
|
|
@ -32,8 +32,7 @@ if (WIN32)
|
||||||
tb_run.ico
|
tb_run.ico
|
||||||
tb_wait.ico
|
tb_wait.ico
|
||||||
${target}.exe.manifest
|
${target}.exe.manifest
|
||||||
${CMAKE_BINARY_DIR}/src/version.rc
|
${CMAKE_BINARY_DIR}/src/version.rc)
|
||||||
)
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
file(GLOB arch_headers "OSX*.h")
|
file(GLOB arch_headers "OSX*.h")
|
||||||
file(GLOB arch_sources "OSX*.cpp")
|
file(GLOB arch_sources "OSX*.cpp")
|
||||||
|
|
@ -50,13 +49,23 @@ if (SYNERGY_ADD_HEADERS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
target_link_libraries(${target}
|
target_link_libraries(
|
||||||
arch base client common io mt net ipc platform server synlib ${libs})
|
${target}
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
client
|
||||||
|
common
|
||||||
|
io
|
||||||
|
mt
|
||||||
|
net
|
||||||
|
ipc
|
||||||
|
platform
|
||||||
|
server
|
||||||
|
synlib
|
||||||
|
${libs})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
install(TARGETS ${target} DESTINATION bin)
|
install(TARGETS ${target} DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2014-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -23,8 +24,20 @@ if (WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
target_link_libraries(${target}
|
target_link_libraries(
|
||||||
synlib arch base client common io ipc mt net platform server ${libs})
|
${target}
|
||||||
|
synlib
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
client
|
||||||
|
common
|
||||||
|
io
|
||||||
|
ipc
|
||||||
|
mt
|
||||||
|
net
|
||||||
|
platform
|
||||||
|
server
|
||||||
|
${libs})
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
install(TARGETS ${target} DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,7 @@ set (CMAKE_AUTORCC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
file (GLOB GUI_SOURCE_FILES
|
file(GLOB GUI_SOURCE_FILES src/*.cpp src/*.h src/validators/* src/widgets/*)
|
||||||
src/*.cpp
|
|
||||||
src/*.h
|
|
||||||
src/validators/*
|
|
||||||
src/widgets/*
|
|
||||||
)
|
|
||||||
file(GLOB GUI_UI_FILES src/*.ui)
|
file(GLOB GUI_UI_FILES src/*.ui)
|
||||||
file(GLOB ACTIVATION_FILES src/*Activation* src/*License*)
|
file(GLOB ACTIVATION_FILES src/*Activation* src/*License*)
|
||||||
file(GLOB ZEROCONF_FILES src/Zeroconf*)
|
file(GLOB ZEROCONF_FILES src/Zeroconf*)
|
||||||
|
|
@ -17,7 +12,9 @@ file (GLOB LANGUAGE_FILES res/lang/*.ts)
|
||||||
|
|
||||||
configure_file(res/Languages.qrc res/Languages.qrc)
|
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})
|
qt5_add_translation(QM_FILES ${LANGUAGE_FILES})
|
||||||
|
|
||||||
|
|
@ -28,8 +25,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
list(APPEND GUI_SOURCE_FILES ${GUI_MAC_SOURCE_FILES})
|
list(APPEND GUI_SOURCE_FILES ${GUI_MAC_SOURCE_FILES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Retrieve the absolute path to qmake and then use that path to find
|
# Retrieve the absolute path to qmake and then use that path to find the
|
||||||
# the binaries
|
# binaries
|
||||||
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
|
||||||
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
|
||||||
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
|
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
|
||||||
|
|
@ -42,29 +39,23 @@ endif ()
|
||||||
|
|
||||||
list(REMOVE_ITEM GUI_SOURCE_FILES ${ZEROCONF_FILES})
|
list(REMOVE_ITEM GUI_SOURCE_FILES ${ZEROCONF_FILES})
|
||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set (GUI_RC_FILES
|
set(GUI_RC_FILES res/win/Synergy.rc ${CMAKE_BINARY_DIR}/src/version.rc)
|
||||||
res/win/Synergy.rc
|
|
||||||
${CMAKE_BINARY_DIR}/src/version.rc
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable (synergy WIN32
|
add_executable(
|
||||||
${GUI_SOURCE_FILES}
|
synergy WIN32
|
||||||
${GUI_UI_FILES}
|
${GUI_SOURCE_FILES} ${GUI_UI_FILES} ${GUI_RC_FILES} res/Synergy.qrc
|
||||||
${GUI_RC_FILES}
|
${CMAKE_CURRENT_BINARY_DIR}/res/Languages.qrc ${QM_FILES})
|
||||||
res/Synergy.qrc
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/res/Languages.qrc
|
|
||||||
${QM_FILES}
|
|
||||||
)
|
|
||||||
|
|
||||||
include_directories(./src)
|
include_directories(./src)
|
||||||
target_link_libraries(synergy shared)
|
target_link_libraries(synergy shared)
|
||||||
|
|
||||||
target_link_libraries(synergy Qt5::Core Qt5::Widgets Qt5::Network)
|
target_link_libraries(synergy Qt5::Core Qt5::Widgets Qt5::Network)
|
||||||
target_compile_definitions (synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}")
|
target_compile_definitions(
|
||||||
target_compile_definitions (synergy PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}")
|
synergy PRIVATE -DSYNERGY_VERSION_STAGE="${SYNERGY_VERSION_STAGE}")
|
||||||
|
target_compile_definitions(synergy
|
||||||
|
PRIVATE -DSYNERGY_REVISION="${SYNERGY_REVISION}")
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set_target_properties(synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
|
set_target_properties(synergy PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
|
||||||
|
|
@ -72,37 +63,44 @@ endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
install(TARGETS synergy DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
install(TARGETS synergy DESTINATION ${SYNERGY_BUNDLE_BINARY_DIR})
|
||||||
install (CODE "MESSAGE (\"Running macdeployqt to install frameworks in bundle\")")
|
install(
|
||||||
install (CODE "execute_process(COMMAND ${MACDEPLOYQT_EXECUTABLE} ${SYNERGY_BUNDLE_APP_DIR} -always-overwrite)")
|
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")
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||||
install(TARGETS synergy DESTINATION bin)
|
install(TARGETS synergy DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(Qt5_FOUND AND WIN32 AND TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt)
|
if(Qt5_FOUND
|
||||||
|
AND WIN32
|
||||||
|
AND TARGET Qt5::qmake
|
||||||
|
AND NOT TARGET Qt5::windeployqt)
|
||||||
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
|
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
|
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
|
||||||
RESULT_VARIABLE return_code
|
RESULT_VARIABLE return_code
|
||||||
OUTPUT_VARIABLE qt5_install_prefix
|
OUTPUT_VARIABLE qt5_install_prefix
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
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})
|
if(EXISTS ${imported_location})
|
||||||
add_executable(Qt5::windeployqt IMPORTED)
|
add_executable(Qt5::windeployqt IMPORTED)
|
||||||
|
|
||||||
set_target_properties(Qt5::windeployqt PROPERTIES IMPORTED_LOCATION ${imported_location})
|
set_target_properties(Qt5::windeployqt PROPERTIES IMPORTED_LOCATION
|
||||||
|
${imported_location})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(TARGET Qt5::windeployqt)
|
if(TARGET Qt5::windeployqt)
|
||||||
# execute windeployqt in a tmp directory after build
|
# execute windeployqt in a tmp directory after build
|
||||||
add_custom_command(TARGET synergy
|
add_custom_command(
|
||||||
|
TARGET synergy
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
|
COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
|
||||||
COMMAND Qt5::windeployqt "$<TARGET_FILE_DIR:synergy>/$<TARGET_FILE_NAME:synergy>"
|
COMMAND Qt5::windeployqt
|
||||||
)
|
"$<TARGET_FILE_DIR:synergy>/$<TARGET_FILE_NAME:synergy>")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -24,5 +24,13 @@ endif()
|
||||||
add_library(ipc STATIC ${sources})
|
add_library(ipc STATIC ${sources})
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(ipc arch base common mt io net synlib)
|
target_link_libraries(
|
||||||
|
ipc
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
common
|
||||||
|
mt
|
||||||
|
io
|
||||||
|
net
|
||||||
|
synlib)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -14,31 +14,18 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
file(GLOB headers
|
file(GLOB headers "*.h" "InverseSockets/*.h")
|
||||||
"*.h"
|
file(GLOB sources "*.cpp" "InverseSockets/*.cpp")
|
||||||
"InverseSockets/*.h"
|
|
||||||
)
|
|
||||||
file(GLOB sources
|
|
||||||
"*.cpp"
|
|
||||||
"InverseSockets/*.cpp"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(SYNERGY_ADD_HEADERS)
|
if(SYNERGY_ADD_HEADERS)
|
||||||
list(APPEND sources ${headers})
|
list(APPEND sources ${headers})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(net STATIC ${sources})
|
add_library(net STATIC ${sources})
|
||||||
target_link_libraries(net
|
target_link_libraries(
|
||||||
PUBLIC
|
net
|
||||||
OpenSSL::SSL
|
PUBLIC OpenSSL::SSL
|
||||||
PRIVATE
|
PRIVATE mt io)
|
||||||
mt
|
|
||||||
io
|
|
||||||
)
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
target_link_libraries(net
|
target_link_libraries(net PRIVATE Crypt32 ws2_32)
|
||||||
PRIVATE
|
|
||||||
Crypt32
|
|
||||||
ws2_32
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -30,9 +30,7 @@ if (SYNERGY_ADD_HEADERS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
list(APPEND inc
|
list(APPEND inc /System/Library/Frameworks)
|
||||||
/System/Library/Frameworks
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${inc})
|
include_directories(${inc})
|
||||||
|
|
@ -40,7 +38,14 @@ add_library(platform STATIC ${sources})
|
||||||
target_link_libraries(platform client ${libs})
|
target_link_libraries(platform client ${libs})
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(platform io net ipc synlib client ${libs})
|
target_link_libraries(
|
||||||
|
platform
|
||||||
|
io
|
||||||
|
net
|
||||||
|
ipc
|
||||||
|
synlib
|
||||||
|
client
|
||||||
|
${libs})
|
||||||
|
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
find_package(Qt5 COMPONENTS DBus)
|
find_package(Qt5 COMPONENTS DBus)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -23,4 +24,3 @@ endif()
|
||||||
add_library(shared STATIC ${sources})
|
add_library(shared STATIC ${sources})
|
||||||
|
|
||||||
target_link_libraries(shared arch base)
|
target_link_libraries(shared arch base)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -46,7 +46,16 @@ endif()
|
||||||
add_library(synlib STATIC ${sources})
|
add_library(synlib STATIC ${sources})
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
target_link_libraries(synlib arch client ipc net base platform mt server)
|
target_link_libraries(
|
||||||
|
synlib
|
||||||
|
arch
|
||||||
|
client
|
||||||
|
ipc
|
||||||
|
net
|
||||||
|
base
|
||||||
|
platform
|
||||||
|
mt
|
||||||
|
server)
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(lib_glib REQUIRED IMPORTED_TARGET glib-2.0)
|
pkg_check_modules(lib_glib REQUIRED IMPORTED_TARGET glib-2.0)
|
||||||
|
|
@ -54,7 +63,8 @@ if (UNIX)
|
||||||
include_directories(${PC_GDKPIXBUF_INCLUDE_DIRS})
|
include_directories(${PC_GDKPIXBUF_INCLUDE_DIRS})
|
||||||
pkg_check_modules(lib_gdkpixbuf REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0)
|
pkg_check_modules(lib_gdkpixbuf REQUIRED IMPORTED_TARGET gdk-pixbuf-2.0)
|
||||||
pkg_check_modules(lib_notify REQUIRED IMPORTED_TARGET libnotify)
|
pkg_check_modules(lib_notify REQUIRED IMPORTED_TARGET libnotify)
|
||||||
target_link_libraries(synlib PkgConfig::lib_glib PkgConfig::lib_gdkpixbuf PkgConfig::lib_notify)
|
target_link_libraries(synlib PkgConfig::lib_glib PkgConfig::lib_gdkpixbuf
|
||||||
|
PkgConfig::lib_notify)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2011 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -15,10 +15,8 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
../../ext/googletest/googletest
|
../../ext/googletest/googletest ../../ext/googletest/googletest/include
|
||||||
../../ext/googletest/googletest/include
|
../../ext/googletest/googlemock ../../ext/googletest/googlemock/include)
|
||||||
../../ext/googletest/googlemock
|
|
||||||
../../ext/googletest/googlemock/include)
|
|
||||||
|
|
||||||
add_library(gtest STATIC ../../ext/googletest/googletest/src/gtest-all.cc)
|
add_library(gtest STATIC ../../ext/googletest/googletest/src/gtest-all.cc)
|
||||||
add_library(gmock STATIC ../../ext/googletest/googlemock/src/gmock-all.cc)
|
add_library(gmock STATIC ../../ext/googletest/googlemock/src/gmock-all.cc)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -58,12 +58,23 @@ if (WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
../../
|
../../ ../../lib/ ../../../ext/googletest/googletest/include
|
||||||
../../lib/
|
../../../ext/googletest/googlemock/include)
|
||||||
../../../ext/googletest/googletest/include
|
|
||||||
../../../ext/googletest/googlemock/include
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(integtests ${sources})
|
add_executable(integtests ${sources})
|
||||||
target_link_libraries(integtests
|
target_link_libraries(
|
||||||
arch base client common io ipc mt net platform server synlib gtest gmock ${libs})
|
integtests
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
client
|
||||||
|
common
|
||||||
|
io
|
||||||
|
ipc
|
||||||
|
mt
|
||||||
|
net
|
||||||
|
platform
|
||||||
|
server
|
||||||
|
synlib
|
||||||
|
gtest
|
||||||
|
gmock
|
||||||
|
${libs})
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# synergy -- mouse and keyboard sharing utility
|
# Synergy -- mouse and keyboard sharing utility
|
||||||
# Copyright (C) 2012-2016 Symless Ltd.
|
# Copyright (C) 2012-2024 Symless Ltd.
|
||||||
# Copyright (C) 2009 Nick Bolton
|
# Copyright (C) 2009-2012 Nick Bolton
|
||||||
#
|
#
|
||||||
# This package is free software; you can redistribute it and/or
|
# This package is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
|
|
@ -50,13 +50,8 @@ endif()
|
||||||
list(APPEND sources ${platform_sources})
|
list(APPEND sources ${platform_sources})
|
||||||
list(APPEND headers ${platform_headers})
|
list(APPEND headers ${platform_headers})
|
||||||
|
|
||||||
include_directories(
|
include_directories(../../ ../../lib/ ../../../ext/gtest/include
|
||||||
../../
|
../../../ext/gmock/include ../../../ext)
|
||||||
../../lib/
|
|
||||||
../../../ext/gtest/include
|
|
||||||
../../../ext/gmock/include
|
|
||||||
../../../ext
|
|
||||||
)
|
|
||||||
|
|
||||||
if(SYNERGY_ADD_HEADERS)
|
if(SYNERGY_ADD_HEADERS)
|
||||||
list(APPEND sources ${headers})
|
list(APPEND sources ${headers})
|
||||||
|
|
@ -67,5 +62,21 @@ if (WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${target} ${sources})
|
add_executable(${target} ${sources})
|
||||||
target_link_libraries(${target}
|
target_link_libraries(
|
||||||
arch base client server common io net platform server synlib mt ipc gtest gmock shared ${libs})
|
${target}
|
||||||
|
arch
|
||||||
|
base
|
||||||
|
client
|
||||||
|
server
|
||||||
|
common
|
||||||
|
io
|
||||||
|
net
|
||||||
|
platform
|
||||||
|
server
|
||||||
|
synlib
|
||||||
|
mt
|
||||||
|
ipc
|
||||||
|
gtest
|
||||||
|
gmock
|
||||||
|
shared
|
||||||
|
${libs})
|
||||||
|
|
|
||||||