When linking libraries with Cmake, it may get confused on which language must be used. This leads to the following error:
CMake Error: CMake can not determine linker language for target:[some name]
CMake Error: Cannot determine link language for target "[some name]".
The solution is to explicitly tell it:
SET_TARGET_PROPERTIES([some name] PROPERTIES LINKER_LANGUAGE C)