Browse Source

building.md: Adding doc on building a simple example with g++ and using pkg-config

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Brendan Le Foll 10 years ago
parent
commit
d2e2682f0e
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      docs/building.md

+ 17
- 0
docs/building.md View File

@@ -40,3 +40,20 @@ naming.
40 40
 ~~~~~~~~~~~~~
41 41
 make _pyupm_i2clcd
42 42
 ~~~~~~~~~~~~~
43
+
44
+Sometimes you want to build a small C++ example against an installed library.
45
+This is fairly easy if installed systemwide. Just link against the correct
46
+librar (in this case libupm-tm1637) and then add /usr/include/upm to the loader
47
+path:
48
+
49
+~~~~~~~~~~~~
50
+g++ test.cxx -lupm_tm1637 -I/usr/include/upm
51
+~~~~~~~~~~~~
52
+
53
+You can also use pkg-config to return the information to you, which is
54
+considered the correct way if including UPM in a build system like cmake or
55
+autotools on linux.
56
+
57
+~~~~~~~~~~~
58
+pkg-config --cflags --libs upm-tm1637
59
+~~~~~~~~~~~