|  | 
|  | 1 | +# C++ Demos | 
|  | 2 | + | 
|  | 3 | +- [Overview](#overview) | 
|  | 4 | +- [Building and Running the Demos on Linux and macOS](#building-and-running-the-demos-on-linux-and-macos) | 
|  | 5 | +- [Building and Running the Demos on Windows](#building-and-running-the-demos-on-windows) | 
|  | 6 | + | 
|  | 7 | +## Overview | 
|  | 8 | + | 
|  | 9 | +This directory contains C++ sample programs for DataStorm. These examples are | 
|  | 10 | +provided to get you started on using a particular DataStorm feature or coding | 
|  | 11 | +technique. | 
|  | 12 | + | 
|  | 13 | +## Building and Running the Demos on Linux and macOS | 
|  | 14 | + | 
|  | 15 | +### Prerequisites | 
|  | 16 | + | 
|  | 17 | +The makefiles require GNU make 3.80 or later. | 
|  | 18 | + | 
|  | 19 | +On macOS, the command-line demos require the Xcode Command Line Tools to be | 
|  | 20 | +installed (use `xcode-select --install` to install them). | 
|  | 21 | + | 
|  | 22 | +If you've installed DataStorm in a non-standard location or want to use the | 
|  | 23 | +source tree build, you'll need to set the `DATASTORM_HOME` environment variable | 
|  | 24 | +with the path name of the installation directory or source tree: | 
|  | 25 | +``` | 
|  | 26 | +export DATASTORM_HOME=~/testing/datastorm | 
|  | 27 | +``` | 
|  | 28 | + | 
|  | 29 | +### Building the Demos | 
|  | 30 | + | 
|  | 31 | +Review the settings in `make/Make.rules`. For example, set `OPTIMIZE=yes` | 
|  | 32 | +to build with optimization. | 
|  | 33 | + | 
|  | 34 | +When you're ready to start the build, run `make`, for example: | 
|  | 35 | +``` | 
|  | 36 | +make V=1 | 
|  | 37 | +``` | 
|  | 38 | + | 
|  | 39 | +`V=1` in the example above turns on verbose output. | 
|  | 40 | + | 
|  | 41 | +The `clean` and `distclean` targets allow you clean all the demos. `clean` | 
|  | 42 | +removes the binary files created by the build; `distclean` removes all these | 
|  | 43 | +files plus the C++ files generated by slice2cpp. | 
|  | 44 | + | 
|  | 45 | +Note that `make clean` only removes the binary files for the configuration and | 
|  | 46 | +platform specified with the `CONFIGS` and `PLATFORMS` variables in `Make.rules`. | 
|  | 47 | + | 
|  | 48 | +You can also build or clean a single demo with `make <demo-path>[_clean|_distclean]`, | 
|  | 49 | +for example: | 
|  | 50 | +``` | 
|  | 51 | +make V=1 stock | 
|  | 52 | +make stock_distclean | 
|  | 53 | +``` | 
|  | 54 | + | 
|  | 55 | +### Running the Demos | 
|  | 56 | + | 
|  | 57 | +Refer to the README.md file in each demo directory for usage instructions. | 
|  | 58 | + | 
|  | 59 | +## Building and Running the Demos on Windows | 
|  | 60 | + | 
|  | 61 | +### Building the Demos | 
|  | 62 | + | 
|  | 63 | +Open the solution file `DataStorm C++ demos.sln` to build the sample programs. | 
|  | 64 | + | 
|  | 65 | +The demos are configured to use the DataStorm NuGet package provided by ZeroC. | 
|  | 66 | +The build downloads automatically this DataStorm NuGet package. | 
|  | 67 | + | 
|  | 68 | +If you have disabled the automatic download of NuGet packages by Visual Studio, | 
|  | 69 | +you need to restore the packages before you build using `Tools > NuGet Package | 
|  | 70 | +Manager > Manage NuGet Packages for Solution...` in Visual Studio. | 
|  | 71 | + | 
|  | 72 | +Then select your target configuration (Debug or Release) and platform (Win32 | 
|  | 73 | +or x64). Right click on the desired demo in the Solution Explorer window and | 
|  | 74 | +select `Build`. | 
|  | 75 | + | 
|  | 76 | +### Running the Demos | 
|  | 77 | + | 
|  | 78 | +You need to add the DataStorm and Ice `bin` directories to your PATH before running | 
|  | 79 | +the demos. | 
|  | 80 | + | 
|  | 81 | +If you are building Debug, add the Debug `bin` directories with a command similar | 
|  | 82 | +to: | 
|  | 83 | +``` | 
|  | 84 | +set PATH=%USERPROFILE%\datastorm\demos\cpp\packages\zeroc.datastorm.v143.1.1.1\build\native\bin\x64\Debug;%USERPROFILE%\datastorm\demos\cpp\packages\zeroc.ice.v143.3.7.9\build\native\bin\x64\Debug;%PATH% | 
|  | 85 | +``` | 
|  | 86 | + | 
|  | 87 | +If you are building Release, add the Release `bin` directories with a command | 
|  | 88 | +similar to: | 
|  | 89 | +``` | 
|  | 90 | +set PATH=%USERPROFILE%\datastorm\demos\cpp\packages\zeroc.datastorm.v143.1.1.1\build\native\bin\x64\Release;%USERPROFILE%\datastorm\demos\cpp\packages\zeroc.ice.v143.3.7.9\build\native\bin\x64\Release;%PATH% | 
|  | 91 | +``` | 
|  | 92 | + | 
|  | 93 | +Then refer to the README.md file in each demo directory for usage instructions. | 
0 commit comments