I tried, and it turns out that for providing the installation directory, it is sufficient to give either CMAKE_INSTALL_PREFIX or installDir. Are they interchangeable or there is a difference between the two?
Yes, I read the documentation, but I did not understand the consequences of setting directly CMAKE_INSTALL_PREFIX in cacheVariables instead of setting installDir, which implicitly populates CMAKE_INSTALL_PREFIX. In other words, what is the role of installDir if I can anyway set it in CMAKE_INSTALL_PREFIX?
I see installDir as just a simpler way to specify the install directory. It is not really any different than setting the CMAKE_INSTALL_PREFIX cache variable, it’s just that installDir is more concise and a bit easier to read and set.