Generalize CMakeLists.txt so hierarchy uses LIB_NAME.