Since NVIDIA driver version 361.28 it is possible to utilize GLVND, the OpenGL Vendor Neutral Dispatch for Linux.
That way you can link libOpenGL.so
and either libGLX.so
or libEGL.so
.
There is alleged CMake support starting with CMake 3.10.0
More info: