Fixed CMakeLists.txt
Fixed building static libs when BUILD_SHARED_LIBS was true