The problem with having license checks in a separate lib is that it's trivial to replace with a custom lib which just return true for any security checks. That is probably the reason why you cannot find any simple libs which does that for you.
If piracy is not a concern of yours, I'd look into OpenSSL which can easily do the job with keys. That will stop casual users from trying to abuse your system at least.
The way I've managed software licenses is to add support inside the main application binary. You need to integrate the checks using carefully crafted code that makes it hard(er) for an attacker to reverse the binary and find your function which does the checking. This also means obfuscating parts of your code on purpose.
My general advice though is to include a license agreement with your code and handle this as a legal issue.