cmake: handle cases when cmake has pre-initialized CMAKE_INSTALL_PREFIX
Merge pull request #5577 from Montellese/cmake_install_prefix

cmake: handle cases when cmake has pre-initialized CMAKE_INSTALL_PREFIX