Compiling - dagelf/synergy-core GitHub Wiki
Before you can compile, you'll need the source code. Follow the Getting Started guide for help with this.
Also, this guide is for compiling Synergy Core v1.9 and up (including v2.0). If using v1.3.5 to v1.8, follow the Compiling Legacy guide.
Important: Please also reflect changes in the Core Compiling guide.
- Install Git for Windows
- Install Visual Studio Professional 2015 with Updates
- Select Custom
- Deselect all
- Within
Programming Languages
, selectVisual C++
- Git for Windows should already be installed
- Download the Windows 10 SDK Web Installer
- Click Download the installer (not the iso)
- Use default options for first 2 screens
- On the feature screen, untick everything except Debugging Tools for Windows
- Install Bonjour
- Download: Bonjour SDK for Windows v3.0
- Install Qt
- Install to C:\Qt
- Select Qt 5.9.5
- Add 'C:\Qt\Tools\QtCreator\bin' to the system PATH
- Install CMake
- Add CMake to PATH for all users
- Restart Qt
- Set
CMAKE_PREFIX_PATH
environment variable to\path\to\qt\qt_version\msvc2015_64
- Now follow the compile steps below
- Install Homebrew
- Install XCode (also available via the Mac App Store)
- Update the command line tools setting - Preferences -> Locations
- In the Command Line Tools drop down, select "Xcode 9.4"
- Install the latest version of Qt 5.9 Qt (5.9.6 as of Jun 11/18)
- Choose open source option
- Run package manager
- Select Qt 5.9.x and unselect everything other than macOS
- At bottom of list ensure Qt Creator is selected under "Tools"
- Select Continue and agree to terms
- Install cmake, openssl, libsodium using Homebrew:
brew install cmake openssl libsodium
- Now follow the compile steps below
- $
sudo apt install qtcreator qtbase5-dev cmake make g++ xorg-dev libssl-dev libx11-dev libsodium-dev libgl1-mesa-glx libegl1-mesa libcurl4-openssl-dev libavahi-compat-libdnssd-dev qtdeclarative5-dev libqt5svg5-dev libsystemd-dev
- Edit the Qt kit environment field (Manage Kits in Projects) and add
BOOST_ROOT=/home/<user>/boost
sudo yum groupinstall "Development Tools"
sudo yum -y install epel-release cmake3 boost-static git libXtst-devel qt5-qtbase-devel qt5-qtdeclarative-devel libcurl-devel openssl-devel
sudo yum groupinstall "Development Tools"
sudo yum -y install avahi-compat-libdns_sd-devel avahi-compat-libdns_sd cmake3 boost-static git libXtst-devel qt5-qtbase-devel qt5-qtdeclarative-devel libcurl-devel openssl-devel
sudo zypper install avahi-compat-mDNSResponder-devel libavahi-devel libqt5-qtbase-devel cmake libopenssl-devel libcurl-devel libXtst-devel
Make sure you have completed the steps at Getting Started.
Compiling from the IDE (e.g. Qt Creator).
Do this first on macOS.
- Qt Creator > Preferences > Build & Run > CMake
- Click Add, set Path to:
/usr/local/bin/cmake
- Go to the Kits tab
- Set the C compiler to Clang 64-bit
- Restart Qt Creator
- Open Qt Creator
- If macOS, follow macOS Only steps
- Open Project
- Navigate to the project directory (from git clone)
- Open CMakeLists.txt
- Untick "Imported Kit"
- Expand "Desktop Qt..."
- Untick all except Debug and Release
- Right-click project and select Run CMake
- If macOS, follow macOS Post-CMake steps
- Right-click project and select Build
- Open Projects
- Select Build
- Find
CMAKE_OSX_DEPLOYMENT_TARGET
- Set value to
10.10
- Find
CMAKE_OSX_SYSROOT
- Set value to
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/
- Click Apply Configuration Changes
- Go back to the All OSes steps (above)
Compiling from the command line.
cd Projects\synergy
mkdir build
cd build
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug ..
msbuild synergy-core.sln /p:Platform="x64" /p:Configuration=Debug /m
cd Projects/synergy
mkdir build
cd build
QT_PATH=$HOME/Qt/5.9.3/clang_64
export PATH=$PATH:/usr/local/bin:$QT_PATH/bin
#cmake -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -DOSX_TARGET_MAJOR=10 -DOSX_TARGET_MINOR=12 -DCMAKE_OSX_ARCHITECTURES=x86_64 ..
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_CONFIGURATION_TYPES=$CMAKE_BUILD_TYPE ..
make
cd Projects/synergy
mkdir build
cd build
cmake ..
make