Can I install ROOT only the static library?

Hi all!
I want to install install ROOT with only static library, not shared library,
so I install ROOT with cmake -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF, just the same as installing GEANT4
I try to compiler with g++ -static root-config --libs --cflags p1.C -o p1.C but it fails.
Doesn’t ROOT support static library, or the command root-config --libs --cflags does not support static librarys?