diff --git a/.env.example b/.env.example
index 0501fdd9b..bc8eb65c7 100644
--- a/.env.example
+++ b/.env.example
@@ -13,6 +13,12 @@
# Packaging (optional)
#
+# [Linux] Build extra packages (self-extracting tar.gz and tar.gz)
+# LINUX_EXTRA_PACKAGES=true
+
+# [Linux] Run the package command as a different user (requires sudo)
+# LINUX_PACKAGE_USER=build
+
# [Windows] Base64 encoded PFX code signing certificate
# WINDOWS_PFX_CERTIFICATE="very-long-base64-encoded-string"
diff --git a/.github/actions/dist-upload/action.yml b/.github/actions/dist-upload/action.yml
index 15eb1ac22..3145d40d8 100644
--- a/.github/actions/dist-upload/action.yml
+++ b/.github/actions/dist-upload/action.yml
@@ -26,6 +26,12 @@ runs:
using: "composite"
steps:
+ - if: ${{ inputs.use_gdrive == inputs.use_github }}
+ run: |
+ echo "Either 'use_github' or 'use_gdrive' must be true (and not both)"
+ exit 1
+ shell: bash
+
- if: ${{ inputs.use_gdrive == 'true' && !inputs.package-version }}
run: |
echo "Input 'package-version' is required when uploading to Google Drive"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 31b696363..e676c2ec2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,6 +17,7 @@ on:
env:
SYNERGY_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
+ ENABLE_PACKAGING: ${{ !github.event.pull_request.draft }}
UPLOAD_TO_GITHUB: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }}
UPLOAD_TO_GDRIVE: ${{ github.event_name != 'pull_request' }}
@@ -43,7 +44,7 @@ jobs:
- name: Cache Qt
id: cache-qt
- uses: actions/cache@v1
+ uses: actions/cache@v4
with:
path: ${{ env.QT_BASE_DIR }}
key: ${{ runner.os }}-Qt_${{ env.QT_VERSION }}
@@ -61,20 +62,20 @@ jobs:
run: cmake -B build --preset=windows-release
- name: Build
- run: cmake --build build
+ run: cmake --build build -j8
- name: Test
run: ./build/bin/unittests
- name: Package
- if: ${{ !github.event.pull_request.draft }}
+ if: ${{ env.ENABLE_PACKAGING == 'true' }}
run: python ./scripts/package.py
env:
WINDOWS_PFX_CERTIFICATE: ${{ secrets.WINDOWS_PFX }}
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASS }}
- name: Upload
- if:
+ if: ${{ env.ENABLE_PACKAGING == 'true' }}
uses: ./.github/actions/dist-upload
with:
use_github: ${{ env.UPLOAD_TO_GITHUB }}
@@ -97,13 +98,6 @@ jobs:
strategy:
matrix:
runtime:
- - name: "macos-10-intel"
- timeout: 20
- os: "macos-14-large"
- arch: x64
- target: "10.14"
- shell: "bash"
-
- name: "macos-11-arm64"
timeout: 10
os: "macos-14"
@@ -111,6 +105,13 @@ jobs:
target: "11"
shell: "/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}"
+ - name: "macos-10-intel"
+ timeout: 20
+ os: "macos-14-large"
+ arch: x64
+ target: "10.14"
+ shell: "bash"
+
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -126,13 +127,13 @@ jobs:
run: cmake -B build --preset=macos-release -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)
- name: Build
- run: cmake --build build
+ run: cmake --build build -j8
- name: Test
run: ./build/bin/unittests
- name: Package
- if: ${{ !github.event.pull_request.draft }}
+ if: ${{ env.ENABLE_PACKAGING == 'true' }}
run: ./scripts/package.py
env:
APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
@@ -143,7 +144,7 @@ jobs:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Upload
- if:
+ if: ${{ env.ENABLE_PACKAGING == 'true' }}
uses: ./.github/actions/dist-upload
with:
use_github: ${{ env.UPLOAD_TO_GITHUB }}
@@ -160,52 +161,84 @@ jobs:
name: linux-${{ matrix.distro.name }}
container: ${{ matrix.distro.container }}
+ env:
+ # Prevent apt prompting for input.
+ DEBIAN_FRONTEND: noninteractive
+
strategy:
matrix:
distro:
- - name: centos-8
- container: symless/synergy-core:centos8
+ - name: ubuntu-24.04
+ container: ubuntu:24.04
runs-on: ubuntu-latest
- legacy-cmake: true
-
- - name: debian-11
- container: symless/synergy-core:debian11
- runs-on: ubuntu-latest
- legacy-cmake: true
-
- - name: debian-12
- container: symless/synergy-core:debiansid
- runs-on: ubuntu-latest
-
- - name: fedora-37
- container: symless/synergy-core:fedora37
- runs-on: ubuntu-latest
- legacy-cmake: true
-
- - name: fedora-38
- container: symless/synergy-core:fedora38
- runs-on: ubuntu-latest
- legacy-cmake: true
-
- - name: ubuntu-20.04
- container: symless/synergy-core:ubuntu20.04
- runs-on: ubuntu-latest
- legacy-cmake: true
+ install-deps-apt: true
+ extra-packages: true
- name: ubuntu-22.04
- container: symless/synergy-core:ubuntu22.04
+ container: ubuntu:22.04
runs-on: ubuntu-latest
+ install-deps-apt: true
- - name: ubuntu-24.04
- runs-on: ubuntu-24.04
+ - name: debian-12
+ container: debian:12
+ runs-on: ubuntu-latest
+ install-deps-apt: true
+
+ - name: debian-11
+ container: debian:11
+ runs-on: ubuntu-latest
+ install-deps-apt: true
+ legacy-cmake: true
+
+ - name: fedora-40
+ container: fedora:40
+ runs-on: ubuntu-latest
+ install-deps-dnf: true
+
+ - name: fedora-39
+ container: fedora:39
+ runs-on: ubuntu-latest
+ install-deps-dnf: true
+
+ - name: opensuse
+ container: opensuse/tumbleweed:latest
+ runs-on: ubuntu-latest
+ install-deps-zypper: true
+
+ - name: arch
+ container: archlinux:latest
+ runs-on: ubuntu-latest
+ install-deps-pacman: true
+ package-user: build
+
+ - name: manjaro
+ container: manjarolinux/base:latest
+ runs-on: ubuntu-latest
+ install-deps-pacman: true
+ package-user: build
steps:
- # Use @v3 since some older Linux distro versions don't support @v4
+ - name: Bootstrap
+ run: |
+ if [ "${{ matrix.distro.install-deps-apt }}" = "true" ]; then
+ apt update && apt install -y git python3
+ elif [ "${{ matrix.distro.install-deps-dnf }}" = "true" ]; then
+ dnf install -y git python3
+ elif [ "${{ matrix.distro.install-deps-pacman }}" = "true" ]; then
+ pacman -Syu --noconfirm git python sudo
+ useradd -m build
+ elif [ "${{ matrix.distro.install-deps-zypper }}" = "true" ]; then
+ zypper install -y git python3
+ fi
+
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
submodules: "recursive"
+ - name: Config Git safe dir
+ run: git config --global --add safe.directory $GITHUB_WORKSPACE
+
- name: Install dependencies
run: ./scripts/install_deps.py
@@ -219,11 +252,26 @@ jobs:
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
- run: cmake --build build
+ run: cmake --build build -j8
- name: Test
run: ./build/bin/unittests
- name: Package
- if: ${{ !github.event.pull_request.draft }}
+ if: ${{ !matrix.distro.skip-package && env.ENABLE_PACKAGING == 'true' }}
+ env:
+ LINUX_EXTRA_PACKAGES: ${{ matrix.distro.extra-packages }}
+ LINUX_PACKAGE_USER: ${{ matrix.distro.package-user }}
run: ./scripts/package.py
+
+ - name: Upload
+ if: ${{ !matrix.distro.skip-package && env.ENABLE_PACKAGING == 'true' }}
+ uses: ./.github/actions/dist-upload
+ with:
+ use_github: ${{ env.UPLOAD_TO_GITHUB }}
+ use_gdrive: ${{ env.UPLOAD_TO_GDRIVE }}
+ github-target-filename: "synergy-${{ matrix.distro.name }}"
+ gdrive-target-base-dir: "synergy1/personal"
+ gdrive-secret-key: ${{ secrets.GOOGLE_DRIVE_KEY }}
+ gdrive-parent-folder-id: ${{ secrets.GOOGLE_DRIVE_TECH_DRIVE }}
+ package-version: ${{ env.SYNERGY_VERSION }}
diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/lint-changelog.yml
similarity index 62%
rename from .github/workflows/check-changelog.yml
rename to .github/workflows/lint-changelog.yml
index 045dcde5e..2b51ffc8e 100644
--- a/.github/workflows/check-changelog.yml
+++ b/.github/workflows/lint-changelog.yml
@@ -5,37 +5,28 @@
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md
-name: "Check ChangeLog"
+name: "Lint ChangeLog"
on:
pull_request:
- branches: [master]
jobs:
- check-changelog:
+ lint-changelog:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- - name: Get changed files
+ - name: Get changes
id: file_changes
uses: trilom/file-changes-action@v1.2.4
with:
output: ","
- - name: echo changes
- run: |
- echo Files
- echo '${{ steps.file_changes.outputs.files}}'
- echo Modified
- echo '${{ steps.file_changes.outputs.files_modified}}'
- echo Added
- echo '${{ steps.file_changes.outputs.files_added}}'
- echo Removed
- echo '${{ steps.file_changes.outputs.files_removed}}'
+ - name: Show modified
+ run: echo '${{ steps.file_changes.outputs.files_modified}}'
- - name: List files
+ - name: Check
run: |
if [[ "${{ steps.file_changes.outputs.files_modified}}" == *"ChangeLog"* ]]; then
echo "ChangeLog has been updated"
diff --git a/.github/workflows/lint-cmake-files.yml b/.github/workflows/lint-cmake-files.yml
new file mode 100644
index 000000000..ebee5d289
--- /dev/null
+++ b/.github/workflows/lint-cmake-files.yml
@@ -0,0 +1,23 @@
+# Runs
+
+name: "Lint CMake files"
+on:
+ pull_request:
+
+jobs:
+ lint-cmake-files:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install dependencies
+ run: |
+ python3 -m venv build/python
+ source build/python/bin/activate
+ pip install cmake_format pyyaml
+
+ - name: Lint CMake files
+ run: ./scripts/lint_cmake_files.py
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index ae8529463..5d8d7df0a 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -4,6 +4,7 @@
"twxs.cmake",
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.cpptools",
- "vadimcn.vscode-lldb"
+ "vadimcn.vscode-lldb",
+ "cheshirekow.cmake-format"
]
}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e28171e37..c3ba38851 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,393 +14,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
-cmake_minimum_required (VERSION 3.5)
-project (synergy-core C CXX)
-
-include (cmake/Version.cmake)
-set_version()
-
-# use response files so that ninja can compile on windows,
-# otherwise you get an error when linking qt:
-# "The input line is too long."
-set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@")
-set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
-set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
-
-if (DEFINED ENV{SYNERGY_BUILD_MINIMAL})
- option (SYNERGY_BUILD_GUI "Build the GUI" OFF)
- option (SYNERGY_BUILD_INSTALLER "Build the installer" OFF)
-else()
- option (SYNERGY_BUILD_GUI "Build the GUI" ON)
- option (SYNERGY_BUILD_INSTALLER "Build the installer" ON)
-endif()
-
-if (DEFINED ENV{SYNERGY_NO_TESTS})
- option (BUILD_TESTS "Override building of tests" OFF)
-else()
- option (BUILD_TESTS "Override building of tests" ON)
- option (ENABLE_COVERAGE "Build with coverage")
-endif()
-
-if (DEFINED ENV{SYNERGY_UNIFIED_CORE})
- option (UNIFIED_CORE "Build a single core binary" ON)
-else()
- option (UNIFIED_CORE "Build a single core binary" OFF)
-endif()
-
-if ($ENV{SYNERGY_ENTERPRISE})
- option (SYNERGY_ENTERPRISE "Build Enterprise" ON)
-else()
- option (SYNERGY_ENTERPRISE "Build Enterprise" OFF)
-endif()
-
-if ($ENV{SYNERGY_BUSINESS})
- option (SYNERGY_BUSINESS "Build Business" ON)
-else()
- option (SYNERGY_BUSINESS "Build Business" OFF)
-endif()
-
-if (SYNERGY_DEVELOPER_MODE)
- add_definitions (-DSYNERGY_DEVELOPER_MODE=1)
-endif()
-
-if (SYNERGY_ENTERPRISE)
- add_definitions (-DSYNERGY_ENTERPRISE=1)
-endif()
-
-if (SYNERGY_BUSINESS)
- add_definitions(-DSYNERGY_BUSINESS=1)
-endif()
-
-set (CMAKE_CXX_STANDARD 20)
-set (CMAKE_CXX_EXTENSIONS OFF)
-set (CMAKE_CXX_STANDARD_REQUIRED ON)
-set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
-set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
-
-if (ENABLE_COVERAGE)
- # Add Code Coverage
- include(cmake/CodeCoverage.cmake)
- append_coverage_compiler_flags()
- setup_target_for_coverage_gcovr_xml(
- NAME coverage
- EXECUTABLE unittests
- BASE_DIRECTORY "${PROJECT_SOURCE_DIR}/src"
- EXCLUDE "ext/*")
-
-endif()
-
-if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
- add_definitions (-DNDEBUG)
-endif()
-
-# TODO: Find out why we need these, and remove them
-if (COMMAND cmake_policy)
- cmake_policy (SET CMP0003 NEW)
- cmake_policy (SET CMP0005 NEW)
-endif()
-
-# Add headers to source list
-if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
- set (SYNERGY_ADD_HEADERS FALSE)
-else()
- set (SYNERGY_ADD_HEADERS TRUE)
-endif()
-
-set (libs)
-include_directories (BEFORE SYSTEM ${PROJECT_SOURCE_DIR}/ext/googletest/googletest/include)
-
-if (UNIX)
- if (NOT APPLE)
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
- endif()
-
- # For config.h, detect the libraries, functions, etc.
- include (CheckIncludeFiles)
- include (CheckLibraryExists)
- include (CheckFunctionExists)
- include (CheckTypeSize)
- include (CheckIncludeFileCXX)
- include (CheckSymbolExists)
- include (CheckCSourceCompiles)
-
- check_include_file_cxx (istream HAVE_ISTREAM)
- check_include_file_cxx (ostream HAVE_OSTREAM)
- check_include_file_cxx (sstream HAVE_SSTREAM)
-
- check_include_files (inttypes.h HAVE_INTTYPES_H)
- check_include_files (locale.h HAVE_LOCALE_H)
- check_include_files (memory.h HAVE_MEMORY_H)
- check_include_files (stdlib.h HAVE_STDLIB_H)
- check_include_files (strings.h HAVE_STRINGS_H)
- check_include_files (string.h HAVE_STRING_H)
- check_include_files (sys/select.h HAVE_SYS_SELECT_H)
- check_include_files (sys/socket.h HAVE_SYS_SOCKET_H)
- check_include_files (sys/stat.h HAVE_SYS_STAT_H)
- check_include_files (sys/time.h HAVE_SYS_TIME_H)
- check_include_files (sys/utsname.h HAVE_SYS_UTSNAME_H)
- check_include_files (unistd.h HAVE_UNISTD_H)
- check_include_files (wchar.h HAVE_WCHAR_H)
-
- check_function_exists (getpwuid_r HAVE_GETPWUID_R)
- check_function_exists (gmtime_r HAVE_GMTIME_R)
- check_function_exists (nanosleep HAVE_NANOSLEEP)
- check_function_exists (poll HAVE_POLL)
- check_function_exists (sigwait HAVE_POSIX_SIGWAIT)
- check_function_exists (strftime HAVE_STRFTIME)
- check_function_exists (vsnprintf HAVE_VSNPRINTF)
- check_function_exists (inet_aton HAVE_INET_ATON)
-
- # For some reason, the check_function_exists macro doesn't detect
- # the inet_aton on some pure Unix platforms (e.g. sunos5). So we
- # need to do a more detailed check and also include some extra libs.
- if (NOT HAVE_INET_ATON)
- set (CMAKE_REQUIRED_LIBRARIES nsl)
-
- check_c_source_compiles (
- "#include \n int main() { inet_aton (0, 0); }"
- HAVE_INET_ATON_ADV)
-
- set (CMAKE_REQUIRED_LIBRARIES)
-
- if (HAVE_INET_ATON_ADV)
- # Override the previous fail.
- set (HAVE_INET_ATON 1)
-
- # Assume that both nsl and socket will be needed,
- # it seems safe to add socket on the back of nsl,
- # since socket only ever needed when nsl is needed.
- list (APPEND libs nsl socket)
- endif()
-
- endif()
-
- check_type_size (char SIZEOF_CHAR)
- check_type_size (int SIZEOF_INT)
- check_type_size (long SIZEOF_LONG)
- check_type_size (short SIZEOF_SHORT)
-
- # pthread is used on both Linux and Mac
- check_library_exists ("pthread" pthread_create "" HAVE_PTHREAD)
- if (HAVE_PTHREAD)
- list (APPEND libs pthread)
- else()
- message (FATAL_ERROR "Missing library: pthread")
- endif()
-
-
- if (APPLE)
- set (CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
-
- if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
- set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
- endif()
-
- if(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 11.0)
- set(SYNERGY_OSX_DEPLOYMENT_TARGET 1100)
- elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.15)
- set(SYNERGY_OSX_DEPLOYMENT_TARGET 1015)
- elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.14)
- set(SYNERGY_OSX_DEPLOYMENT_TARGET 1014)
- else()
- set(SYNERGY_OSX_DEPLOYMENT_TARGET 1013)
- endif()
- add_compile_definitions(OSX_DEPLOYMENT_TARGET=${SYNERGY_OSX_DEPLOYMENT_TARGET})
-
- find_library (lib_ScreenSaver ScreenSaver)
- find_library (lib_IOKit IOKit)
- find_library (lib_ApplicationServices ApplicationServices)
- find_library (lib_Foundation Foundation)
- find_library (lib_Carbon Carbon)
-
- list (APPEND libs
- ${lib_ScreenSaver}
- ${lib_IOKit}
- ${lib_ApplicationServices}
- ${lib_Foundation}
- ${lib_Carbon}
- )
-
- if(SYNERGY_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 1014)
- find_library (lib_UserNotifications UserNotifications)
- list (APPEND libs
- ${lib_UserNotifications}
- )
- endif()
-
- else() # not-apple
-
- # add include dir for bsd (posix uses /usr/include/)
- set (CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
-
- set (XKBlib "X11/Xlib.h;X11/XKBlib.h")
- set (CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
- check_type_size ("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H)
- set (HAVE_X11_EXTENSIONS_XRANDR_H "${X11_EXTENSIONS_XRANDR_H}")
- set (CMAKE_EXTRA_INCLUDE_FILES)
-
- check_include_files ("${XKBlib};X11/extensions/dpms.h" HAVE_X11_EXTENSIONS_DPMS_H)
- check_include_files ("X11/extensions/Xinerama.h" HAVE_X11_EXTENSIONS_XINERAMA_H)
- check_include_files ("${XKBlib};X11/extensions/XKBstr.h" HAVE_X11_EXTENSIONS_XKBSTR_H)
- check_include_files ("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
- check_include_files ("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
- check_include_files ("${XKBlib}" HAVE_X11_XKBLIB_H)
- check_include_files ("X11/extensions/XInput2.h" HAVE_XI2)
-
- if (HAVE_X11_EXTENSIONS_DPMS_H)
- # Assume that function prototypes declared, when include exists.
- set (HAVE_DPMS_PROTOTYPES 1)
- endif()
-
- if (NOT HAVE_X11_XKBLIB_H)
- message (FATAL_ERROR "Missing header: " ${XKBlib})
- endif()
-
- check_library_exists ("SM;ICE" IceConnectionNumber "" HAVE_ICE)
- check_library_exists ("Xext;X11" DPMSQueryExtension "" HAVE_Xext)
- check_library_exists ("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst)
- check_library_exists ("Xinerama" XineramaQueryExtension "" HAVE_Xinerama)
- check_library_exists ("Xi" XISelectEvents "" HAVE_Xi)
- check_library_exists ("Xrandr" XRRQueryExtension "" HAVE_Xrandr)
-
- if (HAVE_ICE)
-
- # Assume we have SM if we have ICE.
- set (HAVE_SM 1)
- list (APPEND libs SM ICE)
-
- endif()
-
- if (!X11_xkbfile_FOUND)
- message (FATAL_ERROR "Missing library: xkbfile")
- endif()
-
- if (HAVE_Xtst)
-
- # Xtxt depends on X11.
- set (HAVE_X11)
- list (APPEND libs Xtst X11 xkbfile)
-
- else()
-
- message (FATAL_ERROR "Missing library: Xtst")
-
- endif()
-
- if (HAVE_Xext)
- list (APPEND libs Xext)
- endif()
-
- if (HAVE_Xinerama)
- list (APPEND libs Xinerama)
- else (HAVE_Xinerama)
- if (HAVE_X11_EXTENSIONS_XINERAMA_H)
- set (HAVE_X11_EXTENSIONS_XINERAMA_H 0)
- message (WARNING "Old Xinerama implementation detected, disabled")
- endif()
- endif()
-
- if (HAVE_Xrandr)
- list (APPEND libs Xrandr)
- endif()
-
- # this was outside of the linux scope,
- # not sure why, moving it back inside.
- if (HAVE_Xi)
- list (APPEND libs Xi)
- endif()
-
- endif()
-
- # For config.h, set some static values; it may be a good idea to make
- # these values dynamic for non-standard UNIX compilers.
- set (ACCEPT_TYPE_ARG3 socklen_t)
- set (HAVE_CXX_BOOL 1)
- set (HAVE_CXX_CASTS 1)
- set (HAVE_CXX_EXCEPTIONS 1)
- set (HAVE_CXX_MUTABLE 1)
- set (HAVE_CXX_STDLIB 1)
- set (HAVE_PTHREAD_SIGNAL 1)
- set (SELECT_TYPE_ARG1 int)
- set (SELECT_TYPE_ARG234 " (fd_set *)")
- set (SELECT_TYPE_ARG5 " (struct timeval *)")
- set (STDC_HEADERS 1)
- set (TIME_WITH_SYS_TIME 1)
- set (HAVE_SOCKLEN_T 1)
-
- # For config.h, save the results based on a template (config.h.in).
- configure_file (res/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/lib/config.h)
-
- add_definitions (-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)
-
- if (APPLE)
- add_definitions (-DWINAPI_CARBON=1 -D_THREAD_SAFE)
- else()
- add_definitions (-DWINAPI_XWINDOWS=1)
- endif()
-
-elseif (WIN32)
-
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2")
-
- list (APPEND libs Wtsapi32 Userenv Wininet comsuppw Shlwapi)
-
- add_definitions (
- /DWIN32
- /D_WINDOWS
- /D_CRT_SECURE_NO_WARNINGS
- /DSYNERGY_VERSION=\"${SYNERGY_VERSION}\"
- /D_XKEYCHECK_H
- )
-
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/res/win/version.rc.in
- ${CMAKE_BINARY_DIR}/src/version.rc
- @ONLY)
-
-endif()
-
-#
-# OpenSSL
-#
-# Apple has to use static libraries because
-# "Use of the Apple-provided OpenSSL libraries by apps is strongly discouraged."
-# https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html
-if(APPLE OR DEFINED ENV{SYNERGY_STATIC_OPENSSL})
- set(OPENSSL_USE_STATIC_LIBS TRUE)
-endif()
-find_package(OpenSSL REQUIRED)
-
-#
-# Check submodules
-#
-find_package(Git QUIET)
-if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
-# Update submodules as needed
- option(GIT_SUBMODULE "Check submodules during build" ON)
- if(GIT_SUBMODULE)
- message(STATUS "Submodule update")
- execute_process(
- COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- RESULT_VARIABLE GIT_SUBMODULE_RESULT)
- if(NOT GIT_SUBMODULE_RESULT EQUAL "0")
- message(FATAL_ERROR "Git submodule update failed: ${GIT_SUBMODULE_RESULT}")
- endif()
- endif()
-endif()
-
-#
-# Google Test
-#
-if(BUILD_TESTS AND NOT EXISTS "${PROJECT_SOURCE_DIR}/ext/googletest/CMakeLists.txt")
- message(FATAL_ERROR "Git submodule for Google Test is missing")
-endif()
+cmake_minimum_required(VERSION 3.5)
+project(synergy-core C CXX)
+include(cmake/Version.cmake)
+include(cmake/Definitions.cmake)
+include(cmake/Libraries.cmake)
include(cmake/Packaging.cmake)
+
+set_version()
+configure_definitions()
+configure_libs()
configure_packaging()
-add_subdirectory (src)
+add_subdirectory(src)
diff --git a/ChangeLog b/ChangeLog
index 99369c6f4..4a3d442ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@ Enhancements:
- #7354 Re-implement CI auto version increment for packaging
- #7353 Re-implement packaging for GitHub workflows (macOS)
- #7360 Re-implement packaging for GitHub workflows (Windows)
+- #7361 Re-implement packaging for GitHub workflows (Linux)
# 1.14.6
diff --git a/README.md b/README.md
index 916edabdd..48876d158 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@ cmake -B build --preset=linux-release
**Build:**
```
-cmake --build build
+cmake --build build -j8
```
**Test:**
diff --git a/cmake-format.yaml b/cmake-format.yaml
new file mode 100644
index 000000000..203bdb80f
--- /dev/null
+++ b/cmake-format.yaml
@@ -0,0 +1,5 @@
+format:
+ line_ending: "auto"
+
+markup:
+ first_comment_is_literal: true
diff --git a/cmake/CodeCoverage.cmake b/cmake/CodeCoverage.cmake
index 2edaeccbc..0f3ff8abf 100644
--- a/cmake/CodeCoverage.cmake
+++ b/cmake/CodeCoverage.cmake
@@ -116,322 +116,334 @@
include(CMakeParseArguments)
# Check prereqs
-find_program( GCOV_PATH gcov )
-find_program( LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
-find_program( GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat )
-find_program( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
-find_program( CPPFILT_PATH NAMES c++filt )
+find_program(GCOV_PATH gcov)
+find_program(LCOV_PATH NAMES lcov lcov.bat lcov.exe lcov.perl)
+find_program(GENHTML_PATH NAMES genhtml genhtml.perl genhtml.bat)
+find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
+find_program(CPPFILT_PATH NAMES c++filt)
if(NOT GCOV_PATH)
- message(FATAL_ERROR "gcov not found! Aborting...")
+ message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
- if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
- message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
- endif()
+ if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
+ message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
+ endif()
elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
- if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
- # Do nothing; exit conditional without error if true
- elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
- # Do nothing; exit conditional without error if true
- else()
- message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
- endif()
+ if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "[Ff]lang")
+ # Do nothing; exit conditional without error if true
+ elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
+ # Do nothing; exit conditional without error if true
+ else()
+ message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+ endif()
endif()
-set(COVERAGE_COMPILER_FLAGS "-g -fprofile-arcs -ftest-coverage"
- CACHE INTERNAL "")
+set(COVERAGE_COMPILER_FLAGS
+ "-g -fprofile-arcs -ftest-coverage"
+ CACHE INTERNAL "")
set(CMAKE_Fortran_FLAGS_COVERAGE
- ${COVERAGE_COMPILER_FLAGS}
- CACHE STRING "Flags used by the Fortran compiler during coverage builds."
- FORCE )
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the Fortran compiler during coverage builds."
+ FORCE)
set(CMAKE_CXX_FLAGS_COVERAGE
- ${COVERAGE_COMPILER_FLAGS}
- CACHE STRING "Flags used by the C++ compiler during coverage builds."
- FORCE )
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the C++ compiler during coverage builds." FORCE)
set(CMAKE_C_FLAGS_COVERAGE
- ${COVERAGE_COMPILER_FLAGS}
- CACHE STRING "Flags used by the C compiler during coverage builds."
- FORCE )
+ ${COVERAGE_COMPILER_FLAGS}
+ CACHE STRING "Flags used by the C compiler during coverage builds." FORCE)
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
- ""
- CACHE STRING "Flags used for linking binaries during coverage builds."
- FORCE )
+ ""
+ CACHE STRING "Flags used for linking binaries during coverage builds."
+ FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
- ""
- CACHE STRING "Flags used by the shared libraries linker during coverage builds."
- FORCE )
+ ""
+ CACHE STRING
+ "Flags used by the shared libraries linker during coverage builds."
+ FORCE)
mark_as_advanced(
- CMAKE_Fortran_FLAGS_COVERAGE
- CMAKE_CXX_FLAGS_COVERAGE
- CMAKE_C_FLAGS_COVERAGE
- CMAKE_EXE_LINKER_FLAGS_COVERAGE
- CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
+ CMAKE_Fortran_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
- message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
+ message(
+ WARNING
+ "Code coverage results with an optimised (non-Debug) build may be misleading"
+ )
endif() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
-if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
- link_libraries(gcov)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_Fortran_COMPILER_ID STREQUAL
+ "GNU")
+ link_libraries(gcov)
endif()
-# Defines a target for running and collection code coverage information
-# Builds dependencies, runs the given executable and outputs reports.
-# NOTE! The executable should always have a ZERO as exit code otherwise
-# the coverage generation will not complete.
+# Defines a target for running and collection code coverage information Builds
+# dependencies, runs the given executable and outputs reports. NOTE! The
+# executable should always have a ZERO as exit code otherwise the coverage
+# generation will not complete.
#
-# setup_target_for_coverage_lcov(
-# NAME testrunner_coverage # New target name
-# EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
-# DEPENDENCIES testrunner # Dependencies to build first
-# BASE_DIRECTORY "../" # Base directory for report
-# # (defaults to PROJECT_SOURCE_DIR)
-# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
-# # to BASE_DIRECTORY, with CMake 3.4+)
-# NO_DEMANGLE # Don't demangle C++ symbols
-# # even if c++filt is found
-# )
+# setup_target_for_coverage_lcov( NAME testrunner_coverage #
+# New target name EXECUTABLE testrunner -j ${PROCESSOR_COUNT} # Executable in
+# PROJECT_BINARY_DIR DEPENDENCIES testrunner # Dependencies
+# to build first BASE_DIRECTORY "../" # Base directory
+# for report # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*"
+# "src/dir2/*" # Patterns to exclude (can be relative # to
+# BASE_DIRECTORY, with CMake 3.4+) NO_DEMANGLE #
+# Don't demangle C++ symbols # even if c++filt is found )
function(setup_target_for_coverage_lcov)
- set(options NO_DEMANGLE)
- set(oneValueArgs BASE_DIRECTORY NAME)
- set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS GENHTML_ARGS)
- cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(options NO_DEMANGLE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES LCOV_ARGS
+ GENHTML_ARGS)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}"
+ "${multiValueArgs}" ${ARGN})
- if(NOT LCOV_PATH)
- message(FATAL_ERROR "lcov not found! Aborting...")
- endif() # NOT LCOV_PATH
+ if(NOT LCOV_PATH)
+ message(FATAL_ERROR "lcov not found! Aborting...")
+ endif() # NOT LCOV_PATH
- if(NOT GENHTML_PATH)
- message(FATAL_ERROR "genhtml not found! Aborting...")
- endif() # NOT GENHTML_PATH
+ if(NOT GENHTML_PATH)
+ message(FATAL_ERROR "genhtml not found! Aborting...")
+ endif() # NOT GENHTML_PATH
- # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
- if(${Coverage_BASE_DIRECTORY})
- get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
- else()
- set(BASEDIR ${PROJECT_SOURCE_DIR})
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(${Coverage_BASE_DIRECTORY})
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(LCOV_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES}
+ ${COVERAGE_LCOV_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
+ list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES LCOV_EXCLUDES)
- # Collect excludes (CMake 3.4+: Also compute absolute paths)
- set(LCOV_EXCLUDES "")
- foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_LCOV_EXCLUDES})
- if(CMAKE_VERSION VERSION_GREATER 3.4)
- get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
- endif()
- list(APPEND LCOV_EXCLUDES "${EXCLUDE}")
- endforeach()
- list(REMOVE_DUPLICATES LCOV_EXCLUDES)
+ # Conditional arguments
+ if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
+ set(GENHTML_EXTRA_ARGS "--demangle-cpp")
+ endif()
- # Conditional arguments
- if(CPPFILT_PATH AND NOT ${Coverage_NO_DEMANGLE})
- set(GENHTML_EXTRA_ARGS "--demangle-cpp")
- endif()
+ # Setup target
+ add_custom_target(
+ ${Coverage_NAME}
+ # Cleanup lcov
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH}
+ -directory . -b ${BASEDIR} --zerocounters
+ # Create baseline to make sure untouched files show up in the report
+ COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d
+ . -b ${BASEDIR} -o ${Coverage_NAME}.base
+ # Run tests
+ COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ # Capturing lcov counters and generating report
+ COMMAND
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory .
+ -b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
+ # add baseline counters
+ COMMAND
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a
+ ${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file
+ ${Coverage_NAME}.total
+ # filter collected data to final coverage report
+ COMMAND
+ ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove
+ ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file
+ ${Coverage_NAME}.info
+ # Generate HTML output
+ COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o
+ ${Coverage_NAME} ${Coverage_NAME}.info
+ # Set output files as GENERATED (will be removed on 'make clean')
+ BYPRODUCTS ${Coverage_NAME}.base ${Coverage_NAME}.capture
+ ${Coverage_NAME}.total ${Coverage_NAME}.info
+ ${Coverage_NAME} # report directory
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT
+ "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+ )
- # Setup target
- add_custom_target(${Coverage_NAME}
+ # Show where to find the lcov info report
+ add_custom_command(
+ TARGET ${Coverage_NAME}
+ POST_BUILD
+ COMMAND ;
+ COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info.")
- # Cleanup lcov
- COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -directory . -b ${BASEDIR} --zerocounters
- # Create baseline to make sure untouched files show up in the report
- COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -c -i -d . -b ${BASEDIR} -o ${Coverage_NAME}.base
-
- # Run tests
- COMMAND ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
-
- # Capturing lcov counters and generating report
- COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --directory . -b ${BASEDIR} --capture --output-file ${Coverage_NAME}.capture
- # add baseline counters
- COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} -a ${Coverage_NAME}.base -a ${Coverage_NAME}.capture --output-file ${Coverage_NAME}.total
- # filter collected data to final coverage report
- COMMAND ${LCOV_PATH} ${Coverage_LCOV_ARGS} --gcov-tool ${GCOV_PATH} --remove ${Coverage_NAME}.total ${LCOV_EXCLUDES} --output-file ${Coverage_NAME}.info
-
- # Generate HTML output
- COMMAND ${GENHTML_PATH} ${GENHTML_EXTRA_ARGS} ${Coverage_GENHTML_ARGS} -o ${Coverage_NAME} ${Coverage_NAME}.info
-
- # Set output files as GENERATED (will be removed on 'make clean')
- BYPRODUCTS
- ${Coverage_NAME}.base
- ${Coverage_NAME}.capture
- ${Coverage_NAME}.total
- ${Coverage_NAME}.info
- ${Coverage_NAME} # report directory
-
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
- DEPENDS ${Coverage_DEPENDENCIES}
- VERBATIM # Protect arguments to commands
- COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
- )
-
- # Show where to find the lcov info report
- add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
- COMMAND ;
- COMMENT "Lcov code coverage info report saved in ${Coverage_NAME}.info."
- )
-
- # Show info where to find the report
- add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
- COMMAND ;
- COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
- )
+ # Show info where to find the report
+ add_custom_command(
+ TARGET ${Coverage_NAME}
+ POST_BUILD
+ COMMAND ;
+ COMMENT
+ "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
+ )
endfunction() # setup_target_for_coverage_lcov
-# Defines a target for running and collection code coverage information
-# Builds dependencies, runs the given executable and outputs reports.
-# NOTE! The executable should always have a ZERO as exit code otherwise
-# the coverage generation will not complete.
+# Defines a target for running and collection code coverage information Builds
+# dependencies, runs the given executable and outputs reports. NOTE! The
+# executable should always have a ZERO as exit code otherwise the coverage
+# generation will not complete.
#
-# setup_target_for_coverage_gcovr_xml(
-# NAME ctest_coverage # New target name
-# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
-# DEPENDENCIES executable_target # Dependencies to build first
-# BASE_DIRECTORY "../" # Base directory for report
-# # (defaults to PROJECT_SOURCE_DIR)
-# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
-# # to BASE_DIRECTORY, with CMake 3.4+)
-# )
+# setup_target_for_coverage_gcovr_xml( NAME ctest_coverage #
+# New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in
+# PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to
+# build first BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" "src/dir2/*" #
+# Patterns to exclude (can be relative # to BASE_DIRECTORY, with CMake 3.4+) )
function(setup_target_for_coverage_gcovr_xml)
- set(options NONE)
- set(oneValueArgs BASE_DIRECTORY NAME)
- set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
- cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}"
+ "${multiValueArgs}" ${ARGN})
- if(NOT GCOVR_PATH)
- message(FATAL_ERROR "gcovr not found! Aborting...")
- endif() # NOT GCOVR_PATH
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
- # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
- if(${Coverage_BASE_DIRECTORY})
- get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
- else()
- set(BASEDIR ${PROJECT_SOURCE_DIR})
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(${Coverage_BASE_DIRECTORY})
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES}
+ ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
- # Collect excludes (CMake 3.4+: Also compute absolute paths)
- set(GCOVR_EXCLUDES "")
- foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
- if(CMAKE_VERSION VERSION_GREATER 3.4)
- get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
- endif()
- list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
- endforeach()
- list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
+ endforeach()
- # Combine excludes to several -e arguments
- set(GCOVR_EXCLUDE_ARGS "")
- foreach(EXCLUDE ${GCOVR_EXCLUDES})
- list(APPEND GCOVR_EXCLUDE_ARGS "-e")
- list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
- endforeach()
+ add_custom_target(
+ ${Coverage_NAME}
+ # Run tests
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ # Running gcovr
+ COMMAND ${GCOVR_PATH} --sonarqube -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
+ --object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}.xml
+ BYPRODUCTS ${Coverage_NAME}.xml
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Running gcovr to produce Cobertura code coverage report.")
- add_custom_target(${Coverage_NAME}
- # Run tests
- ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
-
- # Running gcovr
- COMMAND ${GCOVR_PATH} --sonarqube
- -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
- --object-directory=${PROJECT_BINARY_DIR}
- -o ${Coverage_NAME}.xml
- BYPRODUCTS ${Coverage_NAME}.xml
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
- DEPENDS ${Coverage_DEPENDENCIES}
- VERBATIM # Protect arguments to commands
- COMMENT "Running gcovr to produce Cobertura code coverage report."
- )
-
- # Show info where to find the report
- add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
- COMMAND ;
- COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml."
- )
+ # Show info where to find the report
+ add_custom_command(
+ TARGET ${Coverage_NAME}
+ POST_BUILD
+ COMMAND ;
+ COMMENT "Cobertura code coverage report saved in ${Coverage_NAME}.xml.")
endfunction() # setup_target_for_coverage_gcovr_xml
-# Defines a target for running and collection code coverage information
-# Builds dependencies, runs the given executable and outputs reports.
-# NOTE! The executable should always have a ZERO as exit code otherwise
-# the coverage generation will not complete.
+# Defines a target for running and collection code coverage information Builds
+# dependencies, runs the given executable and outputs reports. NOTE! The
+# executable should always have a ZERO as exit code otherwise the coverage
+# generation will not complete.
#
-# setup_target_for_coverage_gcovr_html(
-# NAME ctest_coverage # New target name
-# EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in PROJECT_BINARY_DIR
-# DEPENDENCIES executable_target # Dependencies to build first
-# BASE_DIRECTORY "../" # Base directory for report
-# # (defaults to PROJECT_SOURCE_DIR)
-# EXCLUDE "src/dir1/*" "src/dir2/*" # Patterns to exclude (can be relative
-# # to BASE_DIRECTORY, with CMake 3.4+)
-# )
+# setup_target_for_coverage_gcovr_html( NAME ctest_coverage #
+# New target name EXECUTABLE ctest -j ${PROCESSOR_COUNT} # Executable in
+# PROJECT_BINARY_DIR DEPENDENCIES executable_target # Dependencies to
+# build first BASE_DIRECTORY "../" # Base directory for report
+# # (defaults to PROJECT_SOURCE_DIR) EXCLUDE "src/dir1/*" "src/dir2/*" #
+# Patterns to exclude (can be relative # to BASE_DIRECTORY, with CMake 3.4+) )
function(setup_target_for_coverage_gcovr_html)
- set(options NONE)
- set(oneValueArgs BASE_DIRECTORY NAME)
- set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
- cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+ set(options NONE)
+ set(oneValueArgs BASE_DIRECTORY NAME)
+ set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
+ cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}"
+ "${multiValueArgs}" ${ARGN})
- if(NOT GCOVR_PATH)
- message(FATAL_ERROR "gcovr not found! Aborting...")
- endif() # NOT GCOVR_PATH
+ if(NOT GCOVR_PATH)
+ message(FATAL_ERROR "gcovr not found! Aborting...")
+ endif() # NOT GCOVR_PATH
- # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
- if(${Coverage_BASE_DIRECTORY})
- get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
- else()
- set(BASEDIR ${PROJECT_SOURCE_DIR})
+ # Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
+ if(${Coverage_BASE_DIRECTORY})
+ get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
+ else()
+ set(BASEDIR ${PROJECT_SOURCE_DIR})
+ endif()
+
+ # Collect excludes (CMake 3.4+: Also compute absolute paths)
+ set(GCOVR_EXCLUDES "")
+ foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES}
+ ${COVERAGE_GCOVR_EXCLUDES})
+ if(CMAKE_VERSION VERSION_GREATER 3.4)
+ get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
endif()
+ list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
+ endforeach()
+ list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
- # Collect excludes (CMake 3.4+: Also compute absolute paths)
- set(GCOVR_EXCLUDES "")
- foreach(EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
- if(CMAKE_VERSION VERSION_GREATER 3.4)
- get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
- endif()
- list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
- endforeach()
- list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
+ # Combine excludes to several -e arguments
+ set(GCOVR_EXCLUDE_ARGS "")
+ foreach(EXCLUDE ${GCOVR_EXCLUDES})
+ list(APPEND GCOVR_EXCLUDE_ARGS "-e")
+ list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
+ endforeach()
- # Combine excludes to several -e arguments
- set(GCOVR_EXCLUDE_ARGS "")
- foreach(EXCLUDE ${GCOVR_EXCLUDES})
- list(APPEND GCOVR_EXCLUDE_ARGS "-e")
- list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
- endforeach()
+ add_custom_target(
+ ${Coverage_NAME}
+ # Run tests
+ ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
+ # Create folder
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ ${PROJECT_BINARY_DIR}/${Coverage_NAME}
+ # Running gcovr
+ COMMAND
+ ${GCOVR_PATH} --html --html-details -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
+ --object-directory=${PROJECT_BINARY_DIR} -o ${Coverage_NAME}/index.html
+ BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ DEPENDS ${Coverage_DEPENDENCIES}
+ VERBATIM # Protect arguments to commands
+ COMMENT "Running gcovr to produce HTML code coverage report.")
- add_custom_target(${Coverage_NAME}
- # Run tests
- ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS}
-
- # Create folder
- COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
-
- # Running gcovr
- COMMAND ${GCOVR_PATH} --html --html-details
- -r ${BASEDIR} ${GCOVR_EXCLUDE_ARGS}
- --object-directory=${PROJECT_BINARY_DIR}
- -o ${Coverage_NAME}/index.html
-
- BYPRODUCTS ${PROJECT_BINARY_DIR}/${Coverage_NAME} # report directory
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
- DEPENDS ${Coverage_DEPENDENCIES}
- VERBATIM # Protect arguments to commands
- COMMENT "Running gcovr to produce HTML code coverage report."
- )
-
- # Show info where to find the report
- add_custom_command(TARGET ${Coverage_NAME} POST_BUILD
- COMMAND ;
- COMMENT "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
- )
+ # Show info where to find the report
+ add_custom_command(
+ TARGET ${Coverage_NAME}
+ POST_BUILD
+ COMMAND ;
+ COMMENT
+ "Open ./${Coverage_NAME}/index.html in your browser to view the coverage report."
+ )
endfunction() # setup_target_for_coverage_gcovr_html
function(append_coverage_compiler_flags)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
- set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}" PARENT_SCOPE)
- message(STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
+ set(CMAKE_C_FLAGS
+ "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}"
+ PARENT_SCOPE)
+ set(CMAKE_CXX_FLAGS
+ "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}"
+ PARENT_SCOPE)
+ set(CMAKE_Fortran_FLAGS
+ "${CMAKE_Fortran_FLAGS} ${COVERAGE_COMPILER_FLAGS}"
+ PARENT_SCOPE)
+ message(
+ STATUS "Appending code coverage compiler flags: ${COVERAGE_COMPILER_FLAGS}")
endfunction() # append_coverage_compiler_flags
diff --git a/cmake/Definitions.cmake b/cmake/Definitions.cmake
new file mode 100644
index 000000000..52de6e045
--- /dev/null
+++ b/cmake/Definitions.cmake
@@ -0,0 +1,99 @@
+# Synergy -- mouse and keyboard sharing utility
+# Copyright (C) 2012-2024 Symless Ltd.
+# Copyright (C) 2009-2012 Nick Bolton
+#
+# This package is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# found in the file LICENSE that should have accompanied this file.
+#
+# This package is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+macro(configure_definitions)
+
+ set(CMAKE_CXX_STANDARD 20)
+ set(CMAKE_CXX_EXTENSIONS OFF)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+
+ configure_ninja()
+ configure_options()
+
+ if(SYNERGY_ENTERPRISE)
+ add_definitions(-DSYNERGY_ENTERPRISE=1)
+ endif()
+
+ if(SYNERGY_BUSINESS)
+ add_definitions(-DSYNERGY_BUSINESS=1)
+ endif()
+
+ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_definitions(-DNDEBUG)
+ endif()
+
+ # TODO: Find out why we need these, and remove them if we don't
+ if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+ cmake_policy(SET CMP0005 NEW)
+ endif()
+
+ # Add headers to source list
+ if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
+ set(SYNERGY_ADD_HEADERS FALSE)
+ else()
+ set(SYNERGY_ADD_HEADERS TRUE)
+ endif()
+endmacro()
+
+macro(configure_ninja)
+ # use response files so that ninja can compile on windows, otherwise you get
+ # an error when linking qt: "The input line is too long."
+ set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@")
+ set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
+ set(CMAKE_NINJA_FORCE_RESPONSE_FILE
+ 1
+ CACHE INTERNAL "")
+endmacro()
+
+macro(configure_options)
+ if(DEFINED ENV{SYNERGY_BUILD_MINIMAL})
+ option(SYNERGY_BUILD_GUI "Build the GUI" OFF)
+ option(SYNERGY_BUILD_INSTALLER "Build the installer" OFF)
+ else()
+ option(SYNERGY_BUILD_GUI "Build the GUI" ON)
+ option(SYNERGY_BUILD_INSTALLER "Build the installer" ON)
+ endif()
+
+ if(DEFINED ENV{SYNERGY_NO_TESTS})
+ option(BUILD_TESTS "Override building of tests" OFF)
+ else()
+ option(BUILD_TESTS "Override building of tests" ON)
+ option(ENABLE_COVERAGE "Build with coverage")
+ endif()
+
+ if(DEFINED ENV{SYNERGY_UNIFIED_CORE})
+ option(UNIFIED_CORE "Build a single core binary" ON)
+ else()
+ option(UNIFIED_CORE "Build a single core binary" OFF)
+ endif()
+
+ if($ENV{SYNERGY_ENTERPRISE})
+ option(SYNERGY_ENTERPRISE "Build Enterprise" ON)
+ else()
+ option(SYNERGY_ENTERPRISE "Build Enterprise" OFF)
+ endif()
+
+ if($ENV{SYNERGY_BUSINESS})
+ option(SYNERGY_BUSINESS "Build Business" ON)
+ else()
+ option(SYNERGY_BUSINESS "Build Business" OFF)
+ endif()
+endmacro()
diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake
new file mode 100644
index 000000000..ea74869b2
--- /dev/null
+++ b/cmake/Libraries.cmake
@@ -0,0 +1,370 @@
+# Synergy -- mouse and keyboard sharing utility
+# Copyright (C) 2012-2024 Symless Ltd.
+# Copyright (C) 2009-2012 Nick Bolton
+#
+# This package is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# found in the file LICENSE that should have accompanied this file.
+#
+# This package is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+macro(configure_libs)
+
+ set(libs)
+ if(UNIX)
+ configure_unix_libs()
+ elseif(WIN32)
+ configure_windows_libs()
+ endif()
+
+ configure_openssl()
+ update_submodules()
+ configure_test_libs()
+
+endmacro()
+
+#
+# Unix (Mac, Linux, BSD, etc)
+#
+macro(configure_unix_libs)
+
+ if(NOT APPLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ endif()
+
+ # For config.h, detect the libraries, functions, etc.
+ include(CheckIncludeFiles)
+ include(CheckLibraryExists)
+ include(CheckFunctionExists)
+ include(CheckTypeSize)
+ include(CheckIncludeFileCXX)
+ include(CheckSymbolExists)
+ include(CheckCSourceCompiles)
+
+ check_include_file_cxx(istream HAVE_ISTREAM)
+ check_include_file_cxx(ostream HAVE_OSTREAM)
+ check_include_file_cxx(sstream HAVE_SSTREAM)
+
+ check_include_files(inttypes.h HAVE_INTTYPES_H)
+ check_include_files(locale.h HAVE_LOCALE_H)
+ check_include_files(memory.h HAVE_MEMORY_H)
+ check_include_files(stdlib.h HAVE_STDLIB_H)
+ check_include_files(strings.h HAVE_STRINGS_H)
+ check_include_files(string.h HAVE_STRING_H)
+ check_include_files(sys/select.h HAVE_SYS_SELECT_H)
+ check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
+ check_include_files(sys/stat.h HAVE_SYS_STAT_H)
+ check_include_files(sys/time.h HAVE_SYS_TIME_H)
+ check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
+ check_include_files(unistd.h HAVE_UNISTD_H)
+ check_include_files(wchar.h HAVE_WCHAR_H)
+
+ check_function_exists(getpwuid_r HAVE_GETPWUID_R)
+ check_function_exists(gmtime_r HAVE_GMTIME_R)
+ check_function_exists(nanosleep HAVE_NANOSLEEP)
+ check_function_exists(poll HAVE_POLL)
+ check_function_exists(sigwait HAVE_POSIX_SIGWAIT)
+ check_function_exists(strftime HAVE_STRFTIME)
+ check_function_exists(vsnprintf HAVE_VSNPRINTF)
+ check_function_exists(inet_aton HAVE_INET_ATON)
+
+ # For some reason, the check_function_exists macro doesn't detect the
+ # inet_aton on some pure Unix platforms (e.g. sunos5). So we need to do a more
+ # detailed check and also include some extra libs.
+ if(NOT HAVE_INET_ATON)
+ set(CMAKE_REQUIRED_LIBRARIES nsl)
+
+ check_c_source_compiles(
+ "#include \n int main() { inet_aton (0, 0); }"
+ HAVE_INET_ATON_ADV)
+
+ set(CMAKE_REQUIRED_LIBRARIES)
+
+ if(HAVE_INET_ATON_ADV)
+ # Override the previous fail.
+ set(HAVE_INET_ATON 1)
+
+ # Assume that both nsl and socket will be needed, it seems safe to add
+ # socket on the back of nsl, since socket only ever needed when nsl is
+ # needed.
+ list(APPEND libs nsl socket)
+ endif()
+
+ endif()
+
+ check_type_size(char SIZEOF_CHAR)
+ check_type_size(int SIZEOF_INT)
+ check_type_size(long SIZEOF_LONG)
+ check_type_size(short SIZEOF_SHORT)
+
+ # pthread is used on both Linux and Mac
+ check_library_exists("pthread" pthread_create "" HAVE_PTHREAD)
+ if(HAVE_PTHREAD)
+ list(APPEND libs pthread)
+ else()
+ message(FATAL_ERROR "Missing library: pthread")
+ endif()
+
+ if(APPLE)
+ configure_mac_libs()
+ else()
+ configure_xorg_libs()
+ endif()
+
+ # For config.h, set some static values; it may be a good idea to make these
+ # values dynamic for non-standard UNIX compilers.
+ set(ACCEPT_TYPE_ARG3 socklen_t)
+ set(HAVE_CXX_BOOL 1)
+ set(HAVE_CXX_CASTS 1)
+ set(HAVE_CXX_EXCEPTIONS 1)
+ set(HAVE_CXX_MUTABLE 1)
+ set(HAVE_CXX_STDLIB 1)
+ set(HAVE_PTHREAD_SIGNAL 1)
+ set(SELECT_TYPE_ARG1 int)
+ set(SELECT_TYPE_ARG234 " (fd_set *)")
+ set(SELECT_TYPE_ARG5 " (struct timeval *)")
+ set(STDC_HEADERS 1)
+ set(TIME_WITH_SYS_TIME 1)
+ set(HAVE_SOCKLEN_T 1)
+
+ # For config.h, save the results based on a template (config.h.in).
+ configure_file(res/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/lib/config.h)
+
+ add_definitions(-DSYSAPI_UNIX=1 -DHAVE_CONFIG_H)
+
+endmacro()
+
+#
+# Apple macOS
+#
+macro(configure_mac_libs)
+
+ set(CMAKE_CXX_FLAGS
+ "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1"
+ )
+
+ if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
+ endif()
+
+ if(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 11.0)
+ set(SYNERGY_OSX_DEPLOYMENT_TARGET 1100)
+ elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.15)
+ set(SYNERGY_OSX_DEPLOYMENT_TARGET 1015)
+ elseif(CMAKE_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 10.14)
+ set(SYNERGY_OSX_DEPLOYMENT_TARGET 1014)
+ else()
+ set(SYNERGY_OSX_DEPLOYMENT_TARGET 1013)
+ endif()
+
+ add_compile_definitions(
+ OSX_DEPLOYMENT_TARGET=${SYNERGY_OSX_DEPLOYMENT_TARGET})
+
+ find_library(lib_ScreenSaver ScreenSaver)
+ find_library(lib_IOKit IOKit)
+ find_library(lib_ApplicationServices ApplicationServices)
+ find_library(lib_Foundation Foundation)
+ find_library(lib_Carbon Carbon)
+
+ list(
+ APPEND
+ libs
+ ${lib_ScreenSaver}
+ ${lib_IOKit}
+ ${lib_ApplicationServices}
+ ${lib_Foundation}
+ ${lib_Carbon})
+
+ if(SYNERGY_OSX_DEPLOYMENT_TARGET GREATER_EQUAL 1014)
+ find_library(lib_UserNotifications UserNotifications)
+ list(APPEND libs ${lib_UserNotifications})
+ endif()
+
+ add_definitions(-DWINAPI_CARBON=1 -D_THREAD_SAFE)
+
+endmacro()
+
+#
+# X.org/X11 for Linux, BSD, etc
+#
+macro(configure_xorg_libs)
+
+ # Add include dir for BSD (posix uses /usr/include/)
+ set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}:/usr/local/include")
+
+ set(XKBlib "X11/Xlib.h;X11/XKBlib.h")
+ set(CMAKE_EXTRA_INCLUDE_FILES "${XKBlib};X11/extensions/Xrandr.h")
+ check_type_size("XRRNotifyEvent" X11_EXTENSIONS_XRANDR_H)
+ set(HAVE_X11_EXTENSIONS_XRANDR_H "${X11_EXTENSIONS_XRANDR_H}")
+ set(CMAKE_EXTRA_INCLUDE_FILES)
+
+ check_include_files("${XKBlib};X11/extensions/dpms.h"
+ HAVE_X11_EXTENSIONS_DPMS_H)
+ check_include_files("X11/extensions/Xinerama.h"
+ HAVE_X11_EXTENSIONS_XINERAMA_H)
+ check_include_files("${XKBlib};X11/extensions/XKBstr.h"
+ HAVE_X11_EXTENSIONS_XKBSTR_H)
+ check_include_files("X11/extensions/XKB.h" HAVE_XKB_EXTENSION)
+ check_include_files("X11/extensions/XTest.h" HAVE_X11_EXTENSIONS_XTEST_H)
+ check_include_files("${XKBlib}" HAVE_X11_XKBLIB_H)
+ check_include_files("X11/extensions/XInput2.h" HAVE_XI2)
+
+ if(HAVE_X11_EXTENSIONS_DPMS_H)
+ # Assume that function prototypes declared, when include exists.
+ set(HAVE_DPMS_PROTOTYPES 1)
+ endif()
+
+ if(NOT HAVE_X11_XKBLIB_H)
+ message(FATAL_ERROR "Missing header: " ${XKBlib})
+ endif()
+
+ check_library_exists("SM;ICE" IceConnectionNumber "" HAVE_ICE)
+ check_library_exists("Xext;X11" DPMSQueryExtension "" HAVE_Xext)
+ check_library_exists("Xtst;Xext;X11" XTestQueryExtension "" HAVE_Xtst)
+ check_library_exists("Xinerama" XineramaQueryExtension "" HAVE_Xinerama)
+ check_library_exists("Xi" XISelectEvents "" HAVE_Xi)
+ check_library_exists("Xrandr" XRRQueryExtension "" HAVE_Xrandr)
+
+ if(HAVE_ICE)
+
+ # Assume we have SM if we have ICE.
+ set(HAVE_SM 1)
+ list(APPEND libs SM ICE)
+
+ endif()
+
+ if(!X11_xkbfile_FOUND)
+ message(FATAL_ERROR "Missing library: xkbfile")
+ endif()
+
+ if(HAVE_Xtst)
+
+ # Xtxt depends on X11.
+ set(HAVE_X11)
+ list(APPEND libs Xtst X11 xkbfile)
+
+ else()
+
+ message(FATAL_ERROR "Missing library: Xtst")
+
+ endif()
+
+ if(HAVE_Xext)
+ list(APPEND libs Xext)
+ endif()
+
+ if(HAVE_Xinerama)
+ list(APPEND libs Xinerama)
+ else(HAVE_Xinerama)
+ if(HAVE_X11_EXTENSIONS_XINERAMA_H)
+ set(HAVE_X11_EXTENSIONS_XINERAMA_H 0)
+ message(WARNING "Old Xinerama implementation detected, disabled")
+ endif()
+ endif()
+
+ if(HAVE_Xrandr)
+ list(APPEND libs Xrandr)
+ endif()
+
+ # this was outside of the linux scope, not sure why, moving it back inside.
+ if(HAVE_Xi)
+ list(APPEND libs Xi)
+ endif()
+
+ add_definitions(-DWINAPI_XWINDOWS=1)
+
+endmacro()
+
+#
+# Windows
+#
+macro(configure_windows_libs)
+
+ set(CMAKE_CXX_FLAGS
+ "${CMAKE_CXX_FLAGS} /MP /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob2")
+
+ list(
+ APPEND
+ libs
+ Wtsapi32
+ Userenv
+ Wininet
+ comsuppw
+ Shlwapi)
+
+ add_definitions(/DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS
+ /DSYNERGY_VERSION=\"${SYNERGY_VERSION}\" /D_XKEYCHECK_H)
+
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/res/win/version.rc.in
+ ${CMAKE_BINARY_DIR}/src/version.rc @ONLY)
+
+endmacro()
+
+macro(configure_openssl)
+ # Apple has to use static libraries because "Use of the Apple-provided OpenSSL
+ # libraries by apps is strongly discouraged."
+ # https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/SecureNetworkCommunicationAPIs/SecureNetworkCommunicationAPIs.html
+ if(APPLE OR DEFINED ENV{SYNERGY_STATIC_OPENSSL})
+ set(OPENSSL_USE_STATIC_LIBS TRUE)
+ endif()
+
+ find_package(OpenSSL REQUIRED)
+endmacro()
+
+macro(configure_test_libs)
+
+ if(BUILD_TESTS AND NOT EXISTS
+ "${PROJECT_SOURCE_DIR}/ext/googletest/CMakeLists.txt")
+ message(FATAL_ERROR "Git submodule for Google Test is missing")
+ endif()
+
+ if(ENABLE_COVERAGE)
+ include(cmake/CodeCoverage.cmake)
+ append_coverage_compiler_flags()
+ setup_target_for_coverage_gcovr_xml(
+ NAME
+ coverage
+ EXECUTABLE
+ unittests
+ BASE_DIRECTORY
+ "${PROJECT_SOURCE_DIR}/src"
+ EXCLUDE
+ "ext/*")
+ endif()
+
+ include_directories(BEFORE SYSTEM
+ ${PROJECT_SOURCE_DIR}/ext/googletest/googletest/include)
+endmacro()
+
+macro(update_submodules)
+
+ find_package(Git QUIET)
+
+ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
+
+ option(GIT_SUBMODULE "Check submodules during build" ON)
+
+ if(GIT_SUBMODULE)
+
+ message(STATUS "Submodule update")
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ RESULT_VARIABLE GIT_SUBMODULE_RESULT)
+
+ if(NOT GIT_SUBMODULE_RESULT EQUAL "0")
+ message(
+ FATAL_ERROR "Git submodule update failed: ${GIT_SUBMODULE_RESULT}")
+ endif()
+
+ endif()
+ endif()
+
+endmacro()
diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake
index bd4331df3..511acd606 100644
--- a/cmake/Packaging.cmake
+++ b/cmake/Packaging.cmake
@@ -18,103 +18,168 @@
# If enabled, configure packaging based on OS.
#
macro(configure_packaging)
- if (${SYNERGY_BUILD_INSTALLER})
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- configure_macos_packaging()
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
- configure_windows_packaging()
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly")
- configure_linux_packaging()
- endif()
- else()
- message (STATUS "Not configuring installer")
+
+ if(${SYNERGY_BUILD_INSTALLER})
+ set(CPACK_PACKAGE_NAME "synergy")
+ set(CPACK_PACKAGE_CONTACT "Synergy ")
+ set(CPACK_PACKAGE_DESCRIPTION "Mouse and keyboard sharing utility")
+ set(CPACK_PACKAGE_VENDOR "Symless")
+
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ configure_windows_packaging()
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ configure_macos_packaging()
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|DragonFly")
+ configure_linux_packaging()
endif()
+
+ include(CPack)
+ else()
+ message(STATUS "Not configuring installer")
+ endif()
+
+endmacro()
+
+#
+# Windows installer
+#
+macro(configure_windows_packaging)
+
+ message(STATUS "Configuring Windows installer")
+
+ set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION_MS})
+ set(QT_PATH $ENV{CMAKE_PREFIX_PATH})
+
+ find_openssl_dir_win32(OPENSSL_PATH)
+
+ configure_files(${CMAKE_CURRENT_SOURCE_DIR}/res/dist/wix
+ ${CMAKE_BINARY_DIR}/installer)
+
endmacro()
#
# macOS app bundle
#
macro(configure_macos_packaging)
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set (CMAKE_INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks")
- set (SYNERGY_BUNDLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/res/dist/macos/bundle)
- set (SYNERGY_BUNDLE_DIR ${CMAKE_BINARY_DIR}/bundle)
- set (SYNERGY_BUNDLE_APP_DIR ${SYNERGY_BUNDLE_DIR}/Synergy.app)
- set (SYNERGY_BUNDLE_BINARY_DIR ${SYNERGY_BUNDLE_APP_DIR}/Contents/MacOS)
- configure_files (${SYNERGY_BUNDLE_SOURCE_DIR} ${SYNERGY_BUNDLE_DIR})
- endif()
-endmacro()
-function(find_openssl_dir_win32 result)
- execute_process(
- COMMAND where openssl
- OUTPUT_VARIABLE OPENSSL_PATH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
+ message(STATUS "Configuring macOS app bundle")
- # It's possible that there are multiple OpenSSL installations on the system,
- # which is the case on GitHub runners.
- # For now we'll pick the first one, but that's probably not very robust.
- # Maybe our choco config could install to a specific location?
- string(REGEX REPLACE "\r?\n" ";" OPENSSL_PATH_LIST ${OPENSSL_PATH})
- message(STATUS "Found OpenSSL binaries at: ${OPENSSL_PATH_LIST}")
+ set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION})
- list(GET OPENSSL_PATH_LIST 0 OPENSSL_FIRST_PATH)
- message(STATUS "First OpenSSL binary: ${OPENSSL_FIRST_PATH}")
+ set(CMAKE_INSTALL_RPATH
+ "@loader_path/../Libraries;@loader_path/../Frameworks")
+ set(SYNERGY_BUNDLE_SOURCE_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR}/res/dist/macos/bundle)
+ set(SYNERGY_BUNDLE_DIR ${CMAKE_BINARY_DIR}/bundle)
+ set(SYNERGY_BUNDLE_APP_DIR ${SYNERGY_BUNDLE_DIR}/Synergy.app)
+ set(SYNERGY_BUNDLE_BINARY_DIR ${SYNERGY_BUNDLE_APP_DIR}/Contents/MacOS)
- get_filename_component(OPENSSL_BIN_DIR ${OPENSSL_FIRST_PATH} DIRECTORY)
- message(STATUS "OpenSSL bin dir: ${OPENSSL_BIN_DIR}")
-
- get_filename_component(OPENSSL_DIR ${OPENSSL_BIN_DIR} DIRECTORY)
- message(STATUS "OpenSSL install root dir: ${OPENSSL_DIR}")
+ configure_files(${SYNERGY_BUNDLE_SOURCE_DIR} ${SYNERGY_BUNDLE_DIR})
- set(${result} ${OPENSSL_DIR} PARENT_SCOPE)
-endfunction()
-
-#
-# Windows installer
-#
-macro(configure_windows_packaging)
- find_openssl_dir_win32(OPENSSL_PATH)
- set(QT_PATH $ENV{CMAKE_PREFIX_PATH})
- configure_files (${CMAKE_CURRENT_SOURCE_DIR}/res/dist/wix ${CMAKE_BINARY_DIR}/installer)
endmacro()
#
# Linux packages (including BSD and DragonFly)
#
macro(configure_linux_packaging)
- configure_files (${CMAKE_CURRENT_SOURCE_DIR}/res/dist/rpm ${CMAKE_BINARY_DIR}/rpm)
- install(FILES res/synergy.svg DESTINATION share/icons/hicolor/scalable/apps)
- install(FILES res/synergy.desktop DESTINATION share/applications)
+
+ message(STATUS "Configuring Linux packaging")
+
+ set(CPACK_PACKAGE_VERSION ${SYNERGY_VERSION_LINUX})
+ set(CPACK_GENERATOR "DEB;RPM;TGZ;STGZ")
+
+ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Synergy ")
+ set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
+
+ set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
+ set(CPACK_RPM_PACKAGE_GROUP "Applications/System")
+
+ # The default for CMake seems to be /usr/local, which seems uncommon. While
+ # the default /usr/local prefix causes the app to appear on Debian and Fedora,
+ # it doesn't seem to appear on Arch Linux. Setting the prefix to /usr seems to
+ # work on a wider variety of distros, and that also seems to be where most
+ # apps install to.
+ set(CMAKE_INSTALL_PREFIX /usr)
+
+ install(FILES res/dist/linux/synergy.desktop DESTINATION share/applications)
+ install(FILES res/synergy.png DESTINATION share/pixmaps)
+
+ # Prepare PKGBUILD for Arch Linux
+ configure_file(res/dist/arch/PKGBUILD.in ${CMAKE_BINARY_DIR}/PKGBUILD @ONLY)
+
endmacro()
#
# Same as the `configure_file` command but for directories recursively.
#
-macro (configure_files srcDir destDir)
- message (STATUS "Configuring directory ${destDir}")
- make_directory (${destDir})
+macro(configure_files srcDir destDir)
- file (GLOB_RECURSE sourceFiles RELATIVE ${srcDir} ${srcDir}/*)
- file (GLOB_RECURSE templateFiles LIST_DIRECTORIES false RELATIVE ${srcDir} ${srcDir}/*.in)
- list (REMOVE_ITEM sourceFiles ${templateFiles})
+ message(STATUS "Configuring directory ${destDir}")
+ make_directory(${destDir})
- foreach (sourceFile ${sourceFiles})
- set (sourceFilePath ${srcDir}/${sourceFile})
- if (IS_DIRECTORY ${sourceFilePath})
- message (STATUS "Copying directory ${sourceFile}")
- make_directory (${destDir}/${sourceFile})
- else()
- message (STATUS "Copying file ${sourceFile}")
- configure_file (${sourceFilePath} ${destDir}/${sourceFile} COPYONLY)
- endif()
- endforeach (sourceFile)
+ file(
+ GLOB_RECURSE sourceFiles
+ RELATIVE ${srcDir}
+ ${srcDir}/*)
+ file(
+ GLOB_RECURSE templateFiles
+ LIST_DIRECTORIES false
+ RELATIVE ${srcDir}
+ ${srcDir}/*.in)
+ list(REMOVE_ITEM sourceFiles ${templateFiles})
- foreach (templateFile ${templateFiles})
- set (sourceTemplateFilePath ${srcDir}/${templateFile})
- string (REGEX REPLACE "\.in$" "" templateFile ${templateFile})
- message (STATUS "Configuring file ${templateFile}")
- configure_file (${sourceTemplateFilePath} ${destDir}/${templateFile} @ONLY)
- endforeach (templateFile)
-endmacro (configure_files)
+ foreach(sourceFile ${sourceFiles})
+ set(sourceFilePath ${srcDir}/${sourceFile})
+ if(IS_DIRECTORY ${sourceFilePath})
+ message(STATUS "Copying directory ${sourceFile}")
+ make_directory(${destDir}/${sourceFile})
+ else()
+ message(STATUS "Copying file ${sourceFile}")
+ configure_file(${sourceFilePath} ${destDir}/${sourceFile} COPYONLY)
+ endif()
+
+ endforeach(sourceFile)
+
+ foreach(templateFile ${templateFiles})
+
+ set(sourceTemplateFilePath ${srcDir}/${templateFile})
+ string(REGEX REPLACE "\.in$" "" templateFile ${templateFile})
+ message(STATUS "Configuring file ${templateFile}")
+ configure_file(${sourceTemplateFilePath} ${destDir}/${templateFile} @ONLY)
+
+ endforeach(templateFile)
+
+endmacro(configure_files)
+
+#
+# Find the OpenSSL directory on Windows based on the location of the first
+# `openssl` binary found.
+#
+function(find_openssl_dir_win32 result)
+
+ execute_process(
+ COMMAND where openssl
+ OUTPUT_VARIABLE OPENSSL_PATH
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ # It's possible that there are multiple OpenSSL installations on the system,
+ # which is the case on GitHub runners. For now we'll pick the first one, but
+ # that's probably not very robust. Maybe our choco config could install to a
+ # specific location?
+ string(REGEX REPLACE "\r?\n" ";" OPENSSL_PATH_LIST ${OPENSSL_PATH})
+ message(STATUS "Found OpenSSL binaries at: ${OPENSSL_PATH_LIST}")
+
+ list(GET OPENSSL_PATH_LIST 0 OPENSSL_FIRST_PATH)
+ message(STATUS "First OpenSSL binary: ${OPENSSL_FIRST_PATH}")
+
+ get_filename_component(OPENSSL_BIN_DIR ${OPENSSL_FIRST_PATH} DIRECTORY)
+ message(STATUS "OpenSSL bin dir: ${OPENSSL_BIN_DIR}")
+
+ get_filename_component(OPENSSL_DIR ${OPENSSL_BIN_DIR} DIRECTORY)
+ message(STATUS "OpenSSL install root dir: ${OPENSSL_DIR}")
+
+ set(${result}
+ ${OPENSSL_DIR}
+ PARENT_SCOPE)
+
+endfunction()
diff --git a/cmake/Version.cmake b/cmake/Version.cmake
index 4a05f8d38..cbf8c9da6 100644
--- a/cmake/Version.cmake
+++ b/cmake/Version.cmake
@@ -18,41 +18,77 @@
# On Windows, we also set a special 4-digit MSI version number.
macro(set_version)
- set (SYNERGY_VERSION $ENV{SYNERGY_VERSION})
+ set(SYNERGY_VERSION $ENV{SYNERGY_VERSION})
+ string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION)
+
+ if(NOT SYNERGY_VERSION)
+ file(READ "${CMAKE_SOURCE_DIR}/VERSION" SYNERGY_VERSION)
string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION)
+ endif()
- if (NOT SYNERGY_VERSION)
- file(READ "${CMAKE_SOURCE_DIR}/VERSION" SYNERGY_VERSION)
- string(STRIP "${SYNERGY_VERSION}" SYNERGY_VERSION)
- endif()
+ message(STATUS "Version number (semver): " ${SYNERGY_VERSION})
+ add_definitions(-DSYNERGY_VERSION="${SYNERGY_VERSION}")
- message (STATUS "Version number: " ${SYNERGY_VERSION})
- add_definitions (-DSYNERGY_VERSION="${SYNERGY_VERSION}")
-
- # Useful for copyright (e.g. in macOS bundle .plist.in and Windows version .rc file)
- string(TIMESTAMP SYNERGY_BUILD_YEAR "%Y")
+ # Useful for copyright (e.g. in macOS bundle .plist.in and Windows version .rc
+ # file)
+ string(TIMESTAMP SYNERGY_BUILD_YEAR "%Y")
- # MSI requires a 4-digit number and doesn't accept semver.
- if (WIN32)
- string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ "${SYNERGY_VERSION}")
- set(VERSION_MAJOR "${CMAKE_MATCH_1}")
- set(VERSION_MINOR "${CMAKE_MATCH_2}")
- set(VERSION_PATCH "${CMAKE_MATCH_3}")
-
- # Find the revision number, which is the number after the 'r'.
- string(REGEX MATCH "r([0-9]+)$" _ "${SYNERGY_VERSION}")
- set(VERSION_REVISION "${CMAKE_MATCH_1}")
- if (NOT VERSION_REVISION)
- set(VERSION_REVISION "0")
- endif()
-
- # Dot-separated version number for MSI and Windows version .rc file.
- set(SYNERGY_VERSION_MS "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_REVISION}")
- message (STATUS "Version number for Microsoft (dots): " ${SYNERGY_VERSION_MS})
-
- # CSV version number for Windows version .rc file.
- set(SYNERGY_VERSION_MS_CSV "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}")
- message (STATUS "Version number for Microsoft (CSV): " ${SYNERGY_VERSION_MS_CSV})
- endif()
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ set_windows_version()
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set_linux_version()
+ endif()
+
+endmacro()
+
+macro(set_four_part_version)
+
+ string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" _ "${SYNERGY_VERSION}")
+ set(VERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(VERSION_MINOR "${CMAKE_MATCH_2}")
+ set(VERSION_PATCH "${CMAKE_MATCH_3}")
+
+ # Find the revision number, which is the number after the 'r'.
+ string(REGEX MATCH "r([0-9]+)$" _ "${SYNERGY_VERSION}")
+ set(VERSION_REVISION "${CMAKE_MATCH_1}")
+ if(NOT VERSION_REVISION)
+ set(VERSION_REVISION "0")
+ endif()
+
+ set(SYNERGY_VERSION_FOUR_PART
+ "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_REVISION}")
+
+endmacro()
+
+# MSI requires a 4-digit number and doesn't accept semver.
+macro(set_windows_version)
+
+ set_four_part_version()
+
+ # Dot-separated version number for MSI and Windows version .rc file.
+ set(SYNERGY_VERSION_MS ${SYNERGY_VERSION_FOUR_PART})
+ message(STATUS "Version number for (Microsoft 4-part): "
+ ${SYNERGY_VERSION_MS})
+
+ # CSV version number for Windows version .rc file.
+ set(SYNERGY_VERSION_MS_CSV
+ "${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}")
+ message(STATUS "Version number for (Microsoft CSV): "
+ ${SYNERGY_VERSION_MS_CSV})
+endmacro()
+
+macro(set_linux_version)
+
+ # Replace the first occurrence of '-' with '~' for Linux versioning; the '-'
+ # char is reserved for use at at the end of the version string to indicate a
+ # package revision. Debian has always used this convention, but support for
+ # this was also introduced in RPM 4.10.0.
+ string(REGEX REPLACE "-" "~" SYNERGY_VERSION_LINUX "${SYNERGY_VERSION}")
+ message(STATUS "Version number (DEB/RPM): ${SYNERGY_VERSION_LINUX}")
+
+ # Arch does not support SemVer or DEB/RPM version format, so use the four-part
+ # version format which funnily enough is what Microsoft requires for MSI.
+ set_four_part_version()
+ message(STATUS "Version number (4-part): ${SYNERGY_VERSION_FOUR_PART}")
endmacro()
diff --git a/config.yml b/config.yaml
similarity index 52%
rename from config.yml
rename to config.yaml
index 51b8a4337..c89e89b7a 100644
--- a/config.yml
+++ b/config.yaml
@@ -17,11 +17,11 @@ config:
dependencies:
command: brew bundle --file=Brewfile
- # arch, opensuse, etc, patches welcome! :)
linux:
debian: &debian
dependencies:
- command: sudo apt-get update; sudo apt-get install -y \
+ command: sudo apt-get update; \
+ sudo apt-get install -y \
cmake \
make \
g++ \
@@ -29,35 +29,69 @@ config:
libx11-dev \
libxtst-dev \
libssl-dev \
- pkg-config \
libglib2.0-dev \
libgdk-pixbuf-2.0-dev \
libnotify-dev \
libxkbfile-dev \
qtbase5-dev \
qttools5-dev \
- libgtk-3-dev \
- rpm
+ libgtk-3-dev
ubuntu:
<<: *debian
fedora: &fedora
dependencies:
- command: sudo dnf check-update; sudo dnf install -y \
+ command: sudo dnf check-update; \
+ sudo dnf install -y \
cmake \
make \
gcc-c++ \
openssl-devel \
- libXtst-devel \
glib2-devel \
gdk-pixbuf2-devel \
+ libXtst-devel \
libnotify-devel \
+ libxkbfile-devel \
qt5-qtbase-devel \
qt5-qttools-devel \
- libxkbfile-devel \
gtk3-devel \
rpm-build
- centos:
- <<: *fedora
+ opensuse-tumbleweed: &opensuse-tumbleweed
+ dependencies:
+ command: sudo zypper refresh; \
+ sudo zypper --non-interactive remove busybox-which; \
+ sudo zypper install -y \
+ cmake \
+ make \
+ gcc-c++ \
+ openssl-devel \
+ glib2-devel \
+ gdk-pixbuf-devel \
+ libXtst-devel \
+ libnotify-devel \
+ libxkbfile-devel \
+ libqt5-qtbase-devel \
+ libqt5-qttools-devel \
+ gtk3-devel \
+ rpm-build
+
+ arch: &arch
+ dependencies:
+ command: sudo pacman -Syu --noconfirm \
+ base-devel \
+ cmake \
+ gcc \
+ openssl \
+ glib2 \
+ gdk-pixbuf2 \
+ libxtst \
+ libnotify \
+ libxkbfile \
+ qt5-base \
+ qt5-tools \
+ gtk3
+
+ manjaro:
+ <<: *arch
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index ec635144f..000000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/debian/control b/debian/control
deleted file mode 100644
index e1b4cd012..000000000
--- a/debian/control
+++ /dev/null
@@ -1,17 +0,0 @@
-Source: synergy
-Section: utils
-Priority: optional
-Standards-Version: 3.9.7
-Homepage: https://www.symless.com/
-Maintainer: Symless
-
-Package: synergy
-Architecture: any
-Section: utils
-Priority: optional
-Depends: ${shlibs:Depends},
- ${misc:Depends}
-Description: Keyboard and mouse sharing solution
- Synergy allows you to share one mouse and keyboard between multiple computers.
- Work seamlessly across Windows, macOS and Linux.
-Homepage: https://symless.com/synergy
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index f9a5f5219..000000000
--- a/debian/copyright
+++ /dev/null
@@ -1,5 +0,0 @@
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: Synergy
-Source: https://www.symless.com/synergy
-Disclaimer: This package is not part of the Debian project as it contains closed source proprietary components
-Copyright: Copyright (C) 2012-2017 Symless Ltd
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index d4d5a171a..000000000
--- a/debian/rules
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/make -f
-
-%:
- dh $@ --buildsystem=cmake --builddirectory=build --parallel
-
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 89ae9db8f..000000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (native)
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
deleted file mode 100644
index ab1240797..000000000
--- a/debian/source/lintian-overrides
+++ /dev/null
@@ -1,2 +0,0 @@
-file-without-copyright-information
-binary-without-manpage
diff --git a/doc/QtCodeStyle.xml b/doc/QtCodeStyle.xml
deleted file mode 100644
index b07d20da2..000000000
--- a/doc/QtCodeStyle.xml
+++ /dev/null
@@ -1,234 +0,0 @@
-
-
-
-
-
- CodeStyleData
-
- false
- false
- true
- false
- false
- false
- true
- false
- true
- false
- false
- false
- true
- true
- false
- true
- false
- false
- false
- 4
- true
- false
- 2
- false
- 4
-
-
-
- DisplayName
- Synergy
-
-
-
-
-
-
-
- CodeStyleData
-
- false
- false
- true
- false
- false
- false
- true
- false
- true
- false
- false
- false
- true
- true
- false
- true
- false
- false
- false
- 4
- true
- false
- 2
- false
- 4
-
-
-
- DisplayName
- Synergy
-
-
-
-
-
-
-
- CodeStyleData
-
- false
- false
- true
- false
- false
- false
- true
- false
- true
- false
- false
- false
- true
- true
- false
- true
- false
- false
- false
- 4
- true
- false
- 2
- false
- 4
-
-
-
- DisplayName
- Synergy
-
-
-
-
-
-
-
- CodeStyleData
-
- false
- false
- true
- false
- false
- false
- true
- false
- true
- false
- false
- false
- true
- true
- false
- true
- false
- false
- false
- 4
- true
- false
- 2
- false
- 4
-
-
-
- DisplayName
- Synergy
-
-
-
-
-
-
-
- CodeStyleData
-
- false
- false
- true
- false
- false
- false
- true
- false
- true
- false
- false
- false
- true
- true
- false
- true
- false
- false
- false
- 4
- true
- false
- 2
- false
- 4
-
-
-
- DisplayName
- Synergy
-
-
-
-
-
-
-
- CodeStyleData
-
- false
- false
- true
- false
- false
- false
- true
- false
- true
- false
- false
- false
- true
- true
- false
- true
- false
- false
- false
- 4
- true
- false
- 2
- false
- 4
-
-
-
- DisplayName
- Synergy
-
-
diff --git a/doc/org.synergy-foss.org.synergyc.plist b/doc/org.synergy-foss.org.synergyc.plist
deleted file mode 100644
index 385ad74b3..000000000
--- a/doc/org.synergy-foss.org.synergyc.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- Label
- org.symless.com.synergyc.plist
- OnDemand
-
- ProgramArguments
-
- /usr/bin/synergyc
-
- 192.168.0.2
-
- RunAtLoad
-
-
-
diff --git a/doc/org.synergy-foss.org.synergys.plist b/doc/org.synergy-foss.org.synergys.plist
deleted file mode 100644
index 116615d1f..000000000
--- a/doc/org.synergy-foss.org.synergys.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
- Label
- org.symless.com.synergys.plist
- OnDemand
-
- ProgramArguments
-
- /usr/bin/synergys
- --no-daemon
- --config
-
- /Users/snorp/.synergy.conf
-
- RunAtLoad
-
-
-
diff --git a/doc/synergyc.man b/doc/synergyc.man
deleted file mode 100644
index 29e6ac873..000000000
--- a/doc/synergyc.man
+++ /dev/null
@@ -1,84 +0,0 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.11.
-.TH SYNERGYC "1" "February 2020" "synergyc 1.11.0-stable, protocol version 1.6" "User Commands"
-.SH NAME
-synergyc \- manual page for synergyc 1.11.0-stable, protocol version 1.6
-.SH SYNOPSIS
-.B synergyc
-[\fI\,--yscroll \/\fR] [\fI\,--display \/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name \/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug \/\fR] \fI\,\/\fR
-.SH DESCRIPTION
-Connect to a synergy mouse/keyboard sharing server.
-.TP
-\fB\-d\fR, \fB\-\-debug\fR
-filter out log messages with priority below level.
-level may be: FATAL, ERROR, WARNING, NOTE, INFO,
-DEBUG, DEBUG1, DEBUG2.
-.TP
-\fB\-n\fR, \fB\-\-name\fR use screen\-name instead the hostname to identify
-this screen in the configuration.
-.TP
-\fB\-1\fR, \fB\-\-no\-restart\fR
-do not try to restart on failure.
-.PP
-* \fB\-\-restart\fR restart the server automatically if it fails.
-.TP
-\fB\-l\fR \fB\-\-log\fR
-write log messages to file.
-.TP
-\fB\-\-no\-tray\fR
-disable the system tray icon.
-.TP
-\fB\-\-enable\-drag\-drop\fR
-enable file drag & drop.
-.TP
-\fB\-\-enable\-crypto\fR
-enable the crypto (ssl) plugin.
-.TP
-\fB\-\-display\fR
-connect to the X server at
-.TP
-\fB\-\-no\-xinitthreads\fR
-do not call XInitThreads()
-.TP
-\fB\-f\fR, \fB\-\-no\-daemon\fR
-run in the foreground.
-.PP
-* \fB\-\-daemon\fR run as a daemon.
-.TP
-\fB\-\-yscroll\fR
-defines the vertical scrolling delta, which is
-120 by default.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-display this help and exit.
-.TP
-\fB\-\-version\fR
-display version information and exit.
-.PP
-* marks defaults.
-.PP
-The server address is of the form: [][:]. The hostname
-must be the address or hostname of the server. The port overrides the
-default port, 24800.
-.PP
-synergyc: a server address or name is required
-Try `synergyc \fB\-\-help\fR' for more information.
-.SH COPYRIGHT
-Copyright \(co 2012\-2019 Symless Ltd.
-.br
-Copyright \(co 2008\-2014 Nick Bolton
-.br
-Copyright \(co 2002\-2014 Chris Schoeneman
-synergyc: a server address or name is required
-Try `synergyc \fB\-\-help\fR' for more information.
-.SH "SEE ALSO"
-The full documentation for
-.B synergyc
-is maintained as a Texinfo manual. If the
-.B info
-and
-.B synergyc
-programs are properly installed at your site, the command
-.IP
-.B info synergyc
-.PP
-should give you access to the complete manual.
diff --git a/doc/synergys.man b/doc/synergys.man
deleted file mode 100644
index 337b4725f..000000000
--- a/doc/synergys.man
+++ /dev/null
@@ -1,88 +0,0 @@
-.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.11.
-.TH SYNERGYS "1" "February 2020" "synergys 1.11.0-stable, protocol version 1.6" "User Commands"
-.SH NAME
-synergys \- manual page for synergys 1.11.0-stable, protocol version 1.6
-.SH SYNOPSIS
-.B synergys
-[\fI\,--address \/\fR] [\fI\,--config \/\fR] [\fI\,--display \/\fR] [\fI\,--no-xinitthreads\/\fR] [\fI\,--daemon|--no-daemon\/\fR] [\fI\,--name \/\fR] [\fI\,--restart|--no-restart\/\fR] [\fI\,--debug \/\fR]
-.SH DESCRIPTION
-Start the synergy mouse/keyboard sharing server.
-.TP
-\fB\-a\fR, \fB\-\-address\fR
-listen for clients on the given address.
-.TP
-\fB\-c\fR, \fB\-\-config\fR
-use the named configuration file instead.
-.TP
-\fB\-d\fR, \fB\-\-debug\fR
-filter out log messages with priority below level.
-level may be: FATAL, ERROR, WARNING, NOTE, INFO,
-DEBUG, DEBUG1, DEBUG2.
-.TP
-\fB\-n\fR, \fB\-\-name\fR use screen\-name instead the hostname to identify
-this screen in the configuration.
-.TP
-\fB\-1\fR, \fB\-\-no\-restart\fR
-do not try to restart on failure.
-.PP
-* \fB\-\-restart\fR restart the server automatically if it fails.
-.TP
-\fB\-l\fR \fB\-\-log\fR
-write log messages to file.
-.TP
-\fB\-\-no\-tray\fR
-disable the system tray icon.
-.TP
-\fB\-\-enable\-drag\-drop\fR
-enable file drag & drop.
-.TP
-\fB\-\-enable\-crypto\fR
-enable the crypto (ssl) plugin.
-.TP
-\fB\-\-display\fR
-connect to the X server at
-.TP
-\fB\-\-no\-xinitthreads\fR
-do not call XInitThreads()
-.TP
-\fB\-f\fR, \fB\-\-no\-daemon\fR
-run in the foreground.
-.PP
-* \fB\-\-daemon\fR run as a daemon.
-.TP
-\fB\-h\fR, \fB\-\-help\fR
-display this help and exit.
-.TP
-\fB\-\-version\fR
-display version information and exit.
-.PP
-* marks defaults.
-.PP
-The argument for \fB\-\-address\fR is of the form: [][:]. The
-hostname must be the address or hostname of an interface on the system.
-The default is to listen on all interfaces. The port overrides the
-default port, 24800.
-.PP
-If no configuration file pathname is provided then the first of the
-following to load successfully sets the configuration:
-.IP
-$HOME/.synergy.conf
-\fI\,/etc/synergy.conf\/\fP
-.SH COPYRIGHT
-Copyright \(co 2012\-2019 Symless Ltd.
-.br
-Copyright \(co 2008\-2014 Nick Bolton
-.br
-Copyright \(co 2002\-2014 Chris Schoeneman
-.SH "SEE ALSO"
-The full documentation for
-.B synergys
-is maintained as a Texinfo manual. If the
-.B info
-and
-.B synergys
-programs are properly installed at your site, the command
-.IP
-.B info synergys
-.PP
-should give you access to the complete manual.
diff --git a/res/Readme.txt b/res/Readme.txt
deleted file mode 100644
index e4bfb1752..000000000
--- a/res/Readme.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Thank you for chosing Synergy!
-http://symless.com/
-
-Synergy allows you to share your keyboard and mouse between computers over a network.
-
-For FAQ, setup, and usage instructions, please visit our online Readme:
-http://symless.com/pm/projects/synergy/wiki/Readme
-
-Have fun!
-
-Thanks,
-The Synergy Team
diff --git a/res/dist/arch/PKGBUILD.in b/res/dist/arch/PKGBUILD.in
new file mode 100644
index 000000000..fdbf65477
--- /dev/null
+++ b/res/dist/arch/PKGBUILD.in
@@ -0,0 +1,33 @@
+# Maintainer: Synergy team
+
+pkgname=synergy
+pkgver=@SYNERGY_VERSION_FOUR_PART@
+pkgrel=1
+pkgdesc="Mouse and keyboard sharing utility"
+url='https://symless.com/synergy/'
+arch=('x86_64')
+license=('GPL-2.0-only')
+depends=(
+ 'gcc-libs'
+ 'glibc'
+ 'openssl'
+ 'libx11'
+ 'libxi'
+ 'libxkbfile'
+ 'libxext'
+ 'libxtst'
+ 'libxinerama'
+ 'libxkbcommon-x11'
+ 'libnotify'
+ 'hicolor-icon-theme'
+ 'qt5-base'
+)
+conflicts=('synergy-git' 'synergy1-bin' 'synergy2-bin' 'synergy3-bin')
+
+package() {
+ # By default, `makepkg` will run from the `src` directory, which would
+ # only install the binaries, and not the .desktop file, etc. To install
+ # everything, we need to run `make install` with the root Makefile.
+ cd $startdir
+ make install DESTDIR=$pkgdir
+}
diff --git a/flatpak/flatpak-desktop.patch b/res/dist/flatpak/flatpak-desktop.patch
similarity index 100%
rename from flatpak/flatpak-desktop.patch
rename to res/dist/flatpak/flatpak-desktop.patch
diff --git a/flatpak/synergy-business.yml b/res/dist/flatpak/synergy-business.yml
similarity index 100%
rename from flatpak/synergy-business.yml
rename to res/dist/flatpak/synergy-business.yml
diff --git a/flatpak/synergy-enterprise.yml b/res/dist/flatpak/synergy-enterprise.yml
similarity index 100%
rename from flatpak/synergy-enterprise.yml
rename to res/dist/flatpak/synergy-enterprise.yml
diff --git a/flatpak/synergy.yml b/res/dist/flatpak/synergy.yml
similarity index 100%
rename from flatpak/synergy.yml
rename to res/dist/flatpak/synergy.yml
diff --git a/res/synergy.desktop b/res/dist/linux/synergy.desktop
similarity index 81%
rename from res/synergy.desktop
rename to res/dist/linux/synergy.desktop
index fa987bdf5..6a62168d6 100644
--- a/res/synergy.desktop
+++ b/res/dist/linux/synergy.desktop
@@ -2,7 +2,7 @@
Type=Application
Version=1.0
Name=Synergy
-Comment=Keyboard and mouse sharing solution
+Comment=Mouse and keyboard sharing utility
Path=/usr/bin
Exec=/usr/bin/synergy
Icon=synergy
diff --git a/res/dist/rpm/synergy-business.spec.in b/res/dist/rpm/synergy-business.spec.in
deleted file mode 100644
index 6cc117663..000000000
--- a/res/dist/rpm/synergy-business.spec.in
+++ /dev/null
@@ -1,32 +0,0 @@
-%define _rpmfilename %%{NAME}_%%{Version}-%%{Release}.rpm
-
-Name: synergy-business
-Version: @SYNERGY_VERSION@
-Summary: Keyboard and mouse sharing solution
-Group: Applications/Productivity
-URL: https://symless.com/synergy
-Source: https://symless.com/synergy/downloads
-Vendor: Symless
-Packager: Symless
-License: GPLv2
-Epoch: 1
-Release: @SYNERGY_VERSION@%{?dist}
-Requires: openssl
-
-%description
-Synergy allows you to share one mouse and keyboard between multiple computers.
-Work seamlessly across Windows, macOS and Linux.
-
-%files
-%defattr(755,root,root,-)
-%{_bindir}/synergy
-%{_bindir}/synergyc
-%{_bindir}/synergys
-%{_bindir}/syntool
-%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop
-%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/synergy.svg
-%exclude %{_bindir}/synergy-core
-
-%changelog
-* Wed Apr 26 2017 Symless
-- Initial version of the package
diff --git a/res/dist/rpm/synergy-enterprise.spec.in b/res/dist/rpm/synergy-enterprise.spec.in
deleted file mode 100644
index 7310f2dcc..000000000
--- a/res/dist/rpm/synergy-enterprise.spec.in
+++ /dev/null
@@ -1,32 +0,0 @@
-%define _rpmfilename %%{NAME}_%%{Version}-%%{Release}.rpm
-
-Name: synergy-enterprise
-Version: @SYNERGY_VERSION@
-Summary: Keyboard and mouse sharing solution
-Group: Applications/Productivity
-URL: https://symless.com/synergy
-Source: https://symless.com/synergy/downloads
-Vendor: Symless
-Packager: Symless
-License: GPLv2
-Epoch: 1
-Release: @SYNERGY_VERSION@%{?dist}
-Requires: openssl
-
-%description
-Synergy allows you to share one mouse and keyboard between multiple computers.
-Work seamlessly across Windows, macOS and Linux.
-
-%files
-%defattr(755,root,root,-)
-%{_bindir}/synergy
-%{_bindir}/synergyc
-%{_bindir}/synergys
-%{_bindir}/syntool
-%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop
-%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/synergy.svg
-%exclude %{_bindir}/synergy-core
-
-%changelog
-* Wed Apr 26 2017 Symless
-- Initial version of the package
diff --git a/res/dist/rpm/synergy.spec.in b/res/dist/rpm/synergy.spec.in
deleted file mode 100644
index 64c2fc9ef..000000000
--- a/res/dist/rpm/synergy.spec.in
+++ /dev/null
@@ -1,32 +0,0 @@
-%define _rpmfilename %%{NAME}_%%{VERSION}-%%{RELEASE}.rpm
-
-Name: synergy
-Version: @SYNERGY_VERSION@
-Summary: Keyboard and mouse sharing solution
-Group: Applications/Productivity
-URL: https://symless.com/synergy
-Source: https://symless.com/synergy/downloads
-Vendor: Symless
-Packager: Symless
-License: GPLv2
-Epoch: 1
-Release: @SYNERGY_VERSION@%{?dist}
-Requires: openssl
-
-%description
-Synergy allows you to share one mouse and keyboard between multiple computers.
-Work seamlessly across Windows, macOS and Linux.
-
-%files
-%defattr(755,root,root,-)
-%{_bindir}/synergy
-%{_bindir}/synergyc
-%{_bindir}/synergys
-%{_bindir}/syntool
-%attr(644,-,-) %{_datarootdir}/applications/synergy.desktop
-%attr(644,-,-) %{_datarootdir}/icons/hicolor/scalable/apps/synergy.svg
-%exclude %{_bindir}/synergy-core
-
-%changelog
-* Wed Apr 26 2017 Symless
-- Initial version of the package
diff --git a/res/dist/wix/Product.wxs b/res/dist/wix/Product.wxs
index f4bd5f861..df562ed6c 100644
--- a/res/dist/wix/Product.wxs
+++ b/res/dist/wix/Product.wxs
@@ -44,10 +44,10 @@
common_background
-
+
-
-
+
+
diff --git a/res/dist/wix/SynergyWelcome.wxs b/res/dist/wix/SynergyWelcome.wxs
index 380d11059..f2b716320 100644
--- a/res/dist/wix/SynergyWelcome.wxs
+++ b/res/dist/wix/SynergyWelcome.wxs
@@ -7,7 +7,7 @@
welcome_background
-
+