applied optional library settings in cmake