cmake: add build option for tests
cmake: add build option for tests

Add an option to enable or disable tests. This will allow the user to
build c-periphery without threads and will avoid the following build
failure:

[ 68%] Building C object CMakeFiles/test_serial.dir/tests/test_serial.c.o
/data/buildroot/buildroot-test/instance-0/output/build/c-periphery-2.2.1/tests/test_gpio_sysfs.c:13:10: fatal error: pthread.h: No such file or directory
 #include <pthread.h>

Fixes:
 - http://autobuild.buildroot.org/results/6bbc4de3f857dcb7ff5e6f9fa1441ba4e0af1338

Signed-off-by: Fabrice Fontaine <7d88633730b8b85c1516e612893df72eae9cd341@gmail.com>
Signed-off-by: Vanya A. Sergeev <7a38d8cbd20d9932ba948efaa364bb62651d5ad4@sergeev.io>

vsergeev/c-periphery