cmake: added static library support

CMake provides BUILD_SHARED_LIBS option to choose library type in add_library
when it is not set explicity. Need to use this option