Build Variant Index Environment Variable

This change introduces an environment variable for the CMake build system specifying the index of the current variant being built.

We use this to ensure Doxygen documentation (which is quite large) is only built for a specific (generally first) variant without having to look for a specific package in the environment.