I created a CMakeLists.txt that contains the following
project(P4V) cmake_minimum_required(VERSION 2.6) option(BUILD_STATIC_LIBS \"Build the static library\
this works for me:
cmake -D DBUILD_SHARED_LIBS=ON DBUILD_STATIC_LIBS=ON DBUILD_TESTS=ON ..