Defer evaluation of CMAKE_INSTALL_PREFIX

Per #2765. This change should not be needed to close the bug, but it's probably a good idea.