Commit 577181f179a85e16ddfb47c8ec63f9948f747853

Authored by Moritz W
1 parent 70b340cc

Incorporate build and install as well as testing into readme

Showing 1 changed file with 40 additions and 5 deletions
README.md
... ... @@ -24,7 +24,7 @@ if (bridges.empty())
24 24  
25 25 ### Using Bridges
26 26 If you have found the Bridge you were looking for, you can then move on with the authentication process.
27   -To get a new username from the Bridge (for now) you simply call GetBridge(bridges[\<index\>]),
  27 +To get a new username from the Bridge (for now) you simply call GetBridge(bridges[\<index\>]),
28 28 where index is your preferred Bridge from the part [Finding Bridges](#findingBridges).
29 29 ```C++
30 30 Hue bridge = finder.GetBridge(bridges[0]);
... ... @@ -56,18 +56,53 @@ light1.setColorRGB(255, 128, 0);
56 56 lights[1].Off();
57 57 lights.at(1).setColorHue(4562);
58 58 ```
59   -But keep in mind that some light types do not have all functions available. So you might call a
60   -specific function, but nothing will happen. For that you might want to check beforehand what type
61   -of a lamp you are controlling. For that you can call the function getColorType(), which will return
  59 +But keep in mind that some light types do not have all functions available. So you might call a
  60 +specific function, but nothing will happen. For that you might want to check beforehand what type
  61 +of a lamp you are controlling. For that you can call the function getColorType(), which will return
62 62 a ColorType.
63 63 ```C++
64 64 ColorType type1 = light1.getColorType();
65 65 ```
66 66  
67 67 ### Further reading
68   -If you want to know more about all functions just look inside the doxygen description,
  68 +If you want to know more about all functions just look inside the doxygen description,
69 69 which for now can be found in the regarding sourcecode file or create the documentation
70 70 with the provided Doxyfile yourself.
71 71  
  72 +## Build and install
  73 +If you want to build the library you can use cmake (at least version 2.8.3). First create a build folder and then execute cmake.
  74 +```bash
  75 +mkdir build
  76 +cd build
  77 +cmake ..
  78 +```
  79 +Then compile the code with make. If you are inpatient use the option -j<number>, where number specifies how many files are compiled at the same time. Note this number should not exceed the number of cores*2 of your machine.
  80 +```bash
  81 +make
  82 +```
  83 +```bash
  84 +make -j4
  85 +```
  86 +If you want to install the library use
  87 +```bash
  88 +make install
  89 +```
  90 +To remove it
  91 +```bash
  92 +make uninstall
  93 +```
  94 +If you additionally want to run the tests you will need to checkout the testing branch and 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.
  95 +```bash
  96 +mkdir build
  97 +cd build
  98 +cmake .. -Dhueplusplus_TESTS=ON
  99 +make
  100 +```
  101 +To execute them use
  102 +```bash
  103 +./hueplusplus/test/HuePlusPlus_Test
  104 +```
  105 +
  106 +
72 107 ## Copyright
73 108 Copyright (c) 2017 Jan Rogall & Moritz Wirger. See LICENSE for further details.
... ...