The library does not provides pre-build binaries or provides an installation package. To install the binary files on the system, the source code must be compiled and copied to the appropriate directory.
The following steps show how to install the library:
-
Download the source code from an existing tags and extract the content to a local directory (for example
c:\projects\win32Arduino
or~/dev/win32Arduino
). -
Build the source code according to the Build Steps instructions specified in this document.
-
Navigate to the
build
directory and execute the 'install' command for your platform:- On Windows, enter
cmake --build . --config Release --target INSTALL
. - On Linux, enter
sudo make install
.
- On Windows, enter
This section explains how to compile and build the software and how to get a development environment ready.
The following software must be installed on the system for compiling source code:
- Google C++ Testing Framework v1.8.0
- RapidAssist v0.9.1
- CMake v3.4.3 (or newer)
These are the base requirements to build and use win32Arduino:
- GNU-compatible Make or gmake
- POSIX-standard shell
- A C++98-standard-compliant compiler
- Microsoft Visual C++ 2010 or newer
The win32Arduino library uses the CMake build system to generate a platform-specific build environment. CMake reads the CMakeLists.txt files that you'll find throughout the directories, checks for installed dependencies and then generates files for the selected build system.
To build the software, execute the following steps:
-
Download the source code from an existing tags and extract the content to a local directory (for example
c:\projects\win32Arduino
or~/dev/win32Arduino
). -
Generate the project files for your build system using the following commands:
mkdir build
cd build
cmake ..
- Build the source code:
- On Windows, run
cmake --build . --config Release
or openwin32Arduino.sln
with Visual Studio. - On Linux, run
make
command.
- On Windows, run
The following table shows the available build option:
Name | Type | Default | Usage |
---|---|---|---|
CMAKE_INSTALL_PREFIX | STRING | See CMake documentation | Defines the installation folder of the library. |
BUILD_SHARED_LIBS | BOOL | OFF | Enable/disable the generation of shared library makefiles |
WIN32ARDUINO_BUILD_TEST | BOOL | OFF | Enable/disable the generation of unit tests target. |
WIN32ARDUINO_BUILD_DOC | BOOL | OFF | Enable/disable the generation of API documentation target. |
WIN32ARDUINO_BUILD_SAMPLES | BOOL | OFF | Build all samples projects |
To enable a build option, run the following command at cmake configuration time:
cmake -D<BUILD-OPTION-NAME>=ON ..
win32Arduino comes with unit tests which help maintaining the product stability and level of quality.
Test are build using the Google Test v1.8.0 framework. For more information on how googletest is working, see the google test documentation primer.
Test are disabled by default and must be manually enabled. See the Build Options for details on activating unit tests.
Test are automatically build when building the solution.
To run tests, open a shell prompt and browse to the build/bin
folder and run win32arduino_unittest
executable. For Windows users, the executable is located in build\bin\Release
.
Test results are saved in junit format in file win32arduino_unittest.x86.debug.xml
or win32arduino_unittest.x86.release.xml
depending on the selected configuration.
The latest test results are available at the beginning of the README.md file.