INCLUDE_INSTALL_DIR cannot be used
In short: Doing cmake -DINCLUDE_INSTALL_DIR=include
to cater for #1879 doesn't work because it adds the current folder as a prefix to include
and passing an absolute path (inside CMAKE_INSTALL_PREFIX) will duplicate the install prefix.
The problem is the set(INCLUDE_INSTALL_DIR ... CACHE PATH ...)
.
If you pass that a relative path CMake will make it absolute treating it as relative to the current folder. This is of course wrong and CMake will even error out during the install step because it finds an include path relative to the build dir.
However CMake will not expand it, if the value wasn't set (on cmd line), see https://cmake.org/cmake/help/v3.3/command/set.html
The fix is simple: Change "PATH" to "STRING" for this and all other variables that should contain relative paths. To sidestep potential misconfiguration due to the current issue one could change https://gitlab.com/libeigen/eigen/-/blob/e4fb0ddf78b06bb34c2a33d2e0507ecb0420a2c9/CMakeLists.txt#L580 to use MAKE_ABSOLUTE and/or check if the INCLUDE_INSTALL_DIR
is absolute and if so remove CMAKE_INSTALL_PREFIX
from the beginning or error if the prefix is different. Maybe simply error if any of those supposedly relative paths is absolute.