building.md: Adding doc on building a simple example with g++ and using pkg-config
authorBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 14 Jul 2014 09:55:17 +0000 (10:55 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Mon, 14 Jul 2014 09:55:17 +0000 (10:55 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
docs/building.md

index 2db8540..762e846 100644 (file)
@@ -40,3 +40,20 @@ naming.
 ~~~~~~~~~~~~~
 make _pyupm_i2clcd
 ~~~~~~~~~~~~~
+
+Sometimes you want to build a small C++ example against an installed library.
+This is fairly easy if installed systemwide. Just link against the correct
+librar (in this case libupm-tm1637) and then add /usr/include/upm to the loader
+path:
+
+~~~~~~~~~~~~
+g++ test.cxx -lupm_tm1637 -I/usr/include/upm
+~~~~~~~~~~~~
+
+You can also use pkg-config to return the information to you, which is
+considered the correct way if including UPM in a build system like cmake or
+autotools on linux.
+
+~~~~~~~~~~~
+pkg-config --cflags --libs upm-tm1637
+~~~~~~~~~~~