CMAKE_INSTALL_PREFIX available inside `install(CODE`

Is there a way to access the final (potentially overrriden) CMAKE_INSTALL_PREFIX inside a
code/script in install(CODE ...) or install(SCRIPT script.cmake ...).

Because we have custom code which hardbakes the install-prefix at configure time, but when user do cmake --install --prefix=blabla the above install(CODE ... ) will not notice this…

--prefix just gets translated into -DCMAKE_INSTALL_PREFIX=, so install(CODE "[[message(${CMAKE_INSTALL_PREFIX}]])" should work. Scripts should just be able to work as-is too.