Modified the rules to be compatible with cmake