hueplusplus
1.0.0
|
To get the newest version of the hueplusplus library, clone it directly from github. The master branch contains the latest tested and stable version, while the development branch is more unstable.
This creates a folder hueplusplus with the library sources.
When you want to update the library for a new version, use pull with rebase.
To build the library, you need to use CMake version 3.8 or higher. It is easiest to create a separate build directory where the build files are stored.
To install or uninstall the library use the make targets.
If you have a project that already uses CMake you probably want to add the hueplusplus library directly in your cmake file. For that the best way is to use find_package().
But this will only work if the hueplusplus library is already installed. Instead, if you have the hueplusplus repository included in your project repository (as a submodule) or know where the folder lives you can do the following:
This will check if the hueplusplus library was found by find_package() and if not it will use the specified path to the library source and compile it during the build process.
The cmake project defines two library targets: hueplusplusstatic
to link as a static library and hueplusplusshared
to link as a shared library.
When you are not using CMake, you have to install hueplusplus and change your build configuration to link to the compiled library. The header files in the include directory need to be added to the include path. How you do this depends on the build system.
If you additionally want to run the tests use cmake with the option -Dhueplusplus_TESTS=ON. Testing is done with Google gtest and gmock. Note that you wont need to install gtest/gmock yourself, because cmake will automatically download them and include them during the build. The custom target unittest
compiles and executes all tests.
If you also want to execute coverage tests you will need to install gcov and lcov yourself. To run the coverage test use
There are some small example programs using this library in the examples folder. To build them, set hueplusplus_EXAMPLES=ON
. The target hueplusplus_examples
builds all examples into build/examples.