install accepts multiple TYPE options, each of which will use CMAKE_INSTALL_* variables if available before using the built-in default. Nearly all of the built-in defaults match the defaults offered by GNUInstallDirs and I initially (perhaps incorrectly) thought that meant you normally don’t need to even include GNUInstallDirs yourself, assuming you aren’t referencing the variables directly. Then I realised about TYPE DOC.
This type was quite surprising as it means these install to different places:
# Installs to share/doc/copyright
install(FILES copyright TYPE DOC)
# Installs to share/doc/<package>/copyright
include(GNUInstallDirs)
install(FILES copyright TYPE DOC)
This is all valid and correct as per how documentation is technically written, I just find it surprising it behaves that way espcially since it’s the only type I’m aware of that does this. Is there a backstory behind the different defaults? Is there other catches with skipping include(GNUInstallDirs) that I missed?