At least in Arch linux, and probably others, the linker stage fails because gcc is configured to define "-fno-common" by default, and so it becomes illegal to declare a global variable of the same name in more than one C file that are going to be linked into the same object file.
The workaround is to add
set(CMAKE_C_FLAGS "-fcommon")
set(CMAKE_CXX_FLAGS "-fcommon")
to CMakeLists.txt.
The real fix would be to set -fno-common to force the compiler error and then fix all the instances where global variables have been defined more than once in files being linked together.
---Tim