How to use CMAKE_SHARED_LIBRARY_PREFIX in command line?

I am trying to specify a prefix for a project to resolve naming conflicts issues. However, CMAKE_SHARED_LIBRARY_PREFIX only works within CMake scripts (set(CMAKE_SHARED_LIBRARY_PREFIX …)) and not on the command line (-DCMAKE_SHARED_LIBRARY_PREFIX=…). Is there any way to make it works correctly?

Additionally, is there a variable that serves as CMAKE_EXECUTABLE_PREFIX corresponding to CMAKE_EXECUTABLE_SUFFIX?

CMAKE_SHARED_LIBRARY_PREFIX is not meant to be set by a project or the developer. It is meant to be set by CMake itself, or by a toolchain file, since it represents the behavior of the target system.