[ENH] improved macro for add_library