My project requires CMAKE_INSTALL_PREFIX to be provided during the configuration step. However, cmake allow the user to override it with cmake --install ... --prefix. That will result in a broken installation.
Is there a good way to exit with error if the prefix is different between the configuration and installation step. Perhaps there is a way to write install(CODE ...) to compare cached value against the current value?