diff --git a/Synergy-Core b/Synergy-Core index 2316663..3698410 160000 --- a/Synergy-Core +++ b/Synergy-Core @@ -1 +1 @@ -Subproject commit 2316663352c5c505ef115a49f4fcda16e518808b +Subproject commit 36984104ec98aa4d03206d654746113c865e507d diff --git a/buildWindows.cmd b/buildWindows.cmd index 232bbd7..9fb7b10 100644 --- a/buildWindows.cmd +++ b/buildWindows.cmd @@ -1,15 +1,19 @@ @echo off +rem Path to the Qt library, Visual C++, 64-bit build. set libQtPath=c:\Qt\Qt5.12.9\5.12.9\msvc2017_64 +rem Visual Studio environment variables, see: https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019 +set vcvarsallCommand=c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat + +rem Run 'cmake --help' to choose the suitable generator for your current tool chain. +set cmakeGenerator=Visual Studio 16 2019 + if not exist "%libQtPath%" ( echo error: Unable to resolve Qt library. Make sure the 'libQtPath' variable is correct. exit 1 ) -rem https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019 -set vcvarsallCommand=c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat - if not exist "%vcvarsallCommand%" ( echo error: Unable to resolve vcvarsall command file. Make sure the 'vcvarsallCommand' variable is correct. exit 1 @@ -94,7 +98,7 @@ exit 0 :configureCMake - cmake -S "%synergyCorePath%" -B "%buildPath%" -G "Visual Studio 16 2019" -D CMAKE_PREFIX_PATH="%libQtPath%" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON + cmake -S "%synergyCorePath%" -B "%buildPath%" -G "%cmakeGenerator%" -D CMAKE_PREFIX_PATH="%libQtPath%" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON if %errorlevel% equ 1 exit 1 exit /b 0 @@ -102,8 +106,7 @@ exit 0 call "%buildPath%\version.bat" set synergyVersion=%SYNERGY_VERSION_MAJOR%.%SYNERGY_VERSION_MINOR%.%SYNERGY_VERSION_PATCH% - set synergyVersionStage=%SYNERGY_VERSION_STAGE% - set synergyReleaseName=synergy-%synergyVersion%-%synergyVersionStage%-windows-x64 + set synergyReleaseName=synergy-%synergyVersion%-windows-x64 exit /b 0 :configure diff --git a/readme.md b/readme.md index f0aec72..7d18f94 100644 --- a/readme.md +++ b/readme.md @@ -28,11 +28,18 @@ File / Directory | Description [`Synergy-Core`](https://github.com/symless/synergy-core/) | The official Synergy Core submodule. [`Tools`](./Tools) | Temporary location for build tools. [`buildLinux.sh`](./buildLinux.sh) | Shell script for building binaries in Linux Mint or Ubuntu. +[`buildWindows.cmd`](./buildWindows.cmd) | Command script for building binaries in Windows. - + + + +## Official Documentation + +If you choose to build Synergy manually, consult the following official documentation: + +* [Compiling](https://github.com/symless/synergy-core/wiki/Compiling) +* [Compiling Synergy Core](https://github.com/symless/synergy-core/wiki/Compiling-Synergy-Core) +* [Building the Windows MSI Package](https://github.com/symless/synergy-core/wiki/Building-the-Windows-MSI-Package) ## Cloning the Repository @@ -66,31 +73,27 @@ For building Debian packages: sudo apt-get install build-essential devscripts dh-make lintian -Alternatively, consult the [official wiki](https://github.com/symless/synergy-core/wiki/Compiling) for installing dependencies. - ### Building -Run the shell script `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch. +**Easy Mode:** -Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root. - -1. Create a `build` subdirectory in the `Synergy-Core` submodule: +Run the shell script `buildLinux.sh --all` to build all packages. For other options, run with the `--help` switch. - cd Synergy-Core - mkdir build - cd build +**Hard Mode:** -2. Configure the project: +Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root. - cmake .. -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON + cd Synergy-Core + mkdir build + cd build -3. Build the project: + cmake .. -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON - cmake --build . --parallel 8 + cmake --build . --parallel 8 -4. Optional, install the application: +Optional, install the application: - sudo cmake --install . + sudo cmake --install . ### Launching Automatically @@ -123,14 +126,35 @@ _Incomplete._ * [Qt 5](https://www.qt.io/download), select the following components: * Qt 5.12.9, MSVC 2017 64-bit -2. +2. Edit the `buildWindows.cmd` script and make sure the following script variables are configured properly: + + * `libQtPath` - Path to the Qt library, Visual C++, 64-bit build. + + * `vcvarsallCommand` - Path to Visual Studio's `vcvarsall.bat` command script, which sets compiler environment variables. See [Microsoft C++ toolset](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019) documentation for details. + + * `cmakeGenerator` - Specifies the "generator" setting for cmake. Run `cmake --help` to choose the suitable generator for your current tool chain. ### Building +**Easy Mode:** + Run the command script `buildWindows.cmd --all` to build all packages. For other options, run with the `--help` switch. +**Hard Mode:** + Alternatively, you can opt to build the binaries only, as detailed below. We're assuming the current path is in the `Synergy-Binaries` project root. + cd Synergy-Core + mkdir build + cd build + + call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 + + cmake .. -G "Visual Studio 16 2019" -D CMAKE_PREFIX_PATH="c:\Qt\Qt5.12.9\5.12.9\msvc2017_64" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON + + msbuild synergy-core.sln /p:Platform="x64" /p:Configuration=Release /m + +You may need to use different paths to `vcvarsall.bat` and Qt libraries, whatever is appropriate for your system. Consequently, the generator `-G` switch for `cmake` must also reflect the tool chain environment. See `cmake --help` for details. ## Disclaimers and Legal