Simplify CMake code for handling Cgl libraries.