Which env was changed with cmake --config command

I used some opensource libraries in my own project with cmake, the build type is release by default with cmake --build . command, but the build type of opensource libraries becomes debug, it will be ok if I use cmake --build . --config Release command, so how can I keep same build type with opensource libraries? also which env is changed with --config parameter?
thanks.

Projects can set their own default through CMAKE_BUILD_TYPE. It usually defaults to Debug or "" if not touched (depending on generator).

I think it just sets CMAKE_BUILD_TYPE for single-config generators and tells the build tool which config to use for multi-config generators.