1.3.2. Building the samples
After setting up your environment, obtaining the SDK, and obtaining the samples, you can build the sample applications from source to verify that your build environment is correctly set up.
The sample applications are provided both as pre-built binaries, and as a CMake project, so you can build them using any standard CMake build toolset. The CMake project is pre-configured to find the Proximie SDK, whether it is installed from our APT repository or is located in the release archive, so no additional configuration should be necessary to build the samples; simply follow the instructions below to build the samples from source.
The Python sample applications do not require building, and can be run directly with the Python interpreter; see Running samples for details on running the Python sample applications.
1.3.2.1. Building methods
You can build the C++ sample applications as you would any CMake project:
Our recommendation would be to open the samples/cpp directory in Visual Studio Code, and
install the C++ extension pack; this includes the CMake Tools extension, and will allow you
to simply click the “Build” button in the VS Code interface to build the samples.
To build from the command line, simply:
Obtain the samples, either via the APT package and
pxsdk cpp-samplescommand, or by downloading the release archive and extracting it to a suitable location; see Obtaining the sample applications for details.Enter your C++ samples directory
cd <samples-location>
Create and configure a
builddirectory:cmake -B build
Build the samples, using all available CPU cores:
cmake --build build -j $(nproc)
Built applications will then be available in the <samples-location>/bin directory.
You could now run the hello-sdk sample application as follows:
./bin/hello-sdk
For full details of the sample applications, see Running samples.