add Layer class
add cmake function do avoid duplication of functionalilty