1 Building UPM {#building}
4 UPM uses cmake in order to make compilation relatively painless. Cmake runs
5 build out of tree so the recommended way is to clone from git and make a build/
8 UPM will attempt to build all directories inside src/ and they must contain
9 individual CMakeLists.txt files.
18 Our cmake configure has a number of options, `cmake -i` will ask you all sorts
19 of interesting questions, you can disable swig modules, build documentation
22 Few recommended options:
23 Changing install path from /usr/local to /usr
24 -DCMAKE_INSTALL_PREFIX:PATH=/usr
27 -DCMAKE_BUILD_TYPE=DEBUG
29 Using clang instead of gcc:
30 -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang
32 Often developers are only interested in building one module or even just the
33 python/node module to do some quick testing using scripting. In order to do
34 this you need to use the target name for the python or node module you want to
35 rebuild. For example the lcd module target name is i2clcd. Therfore the python
36 module target name will be prefixed by _pyupm_. Just do the following to build
37 only that module. Modules not using the UPM cmake macros may have different
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
50 g++ test.cxx -lupm_tm1637 -I/usr/include/upm
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
58 pkg-config --cflags --libs upm-tm1637