RTSDK C/C++ Installation Guide : 4 Building RTSDK with CMake : 4.1 Building on Windows
 
4.1 Building on Windows
To run CMake in a Windows environment:
1. Obtain RTSDK. For details, refer to Section 3.
2. If obtaining RTSDK by downloading RRG packages, extract the contents of the RTSDK packages as needed. Refer to Section 3.
3. Note the name of the top-level extracted directory (i.e., on Windows, the name might be something like
RTSDK-2.2.1.L1.win.rrg or, if this is a GitHub clone, the name might be Real-Time-SDK).
The name of this extracted directory is referred to as sourceDir for the remainder of this procedure.
4. In Windows Explorer, navigate to the directory that contains sourceDir.
5. Press and hold down Shift, right-click the directory, and in the context menu, click Open command window here.
6. Issue the command:
 
 
cmake --help | -HsourceDir -BbuildDir -G “VisualStudioVersion” [-Doption ... ]
 
Where:
--help outputs a list of available command options and generator types.
sourceDir is the directory in which the top-level CMake entry point (CMakeLists.txt) resides. By default, when you build using the Solution and vcxproj files, output is sent to directory specified in SourceDir.
buildDir is the CMake directory where built binaries are stored. This directory is created if it does not exist.
VisualStudioVersion is the Visual Studio version (e.g., Visual Studio 11 2012 Win64). Valid values for VisualStudioVersion are:
- “Visual Studio 17 2022” -A x64
- "Visual Studio 16 2019" -A x64
- "Visual Studio 15 2017 Win64"
- "Visual Studio 14 2015 Win64"
 
Note:  
If you do not explicitly specify Win64, by default cmake builds the 32-bit version.
A list of visual studio versions can be obtained by typing cmake --help
option is a command line option and its associated value (e.g., -DBUILD_EMA_UNIT_TESTS=OFF). You can control aspects of how CMake builds the RTSDK by using command line options (for further details on the use of options, refer to Section 4.4).
The cmake command builds all needed Solution and vcxproj files (and other related files) in the CMake build directory and may be built using Visual Studio. Compiled output (after running make or from visual studio make) is located in its associated source directories (i.e., example executables are in the Executables directory and libraries (e.g., libema.lib, librssl.lib) in the Libs directory).
 
Note:  
Do not load individual project files from Visual Studio. You must first load the top-level solution file (rtsdk.sln in the specified buildDir). After loading the full solution from rtsdk.sln, you can begin building individual projects.