Removed custom  to use the standard CMake mechanism : do not specify the library type in ADD_LIBRARY and let  decide.