Take a look at CMake packages.
This will allow pretty much exactly the user workflow that you described. The idea here is that when you build your project, CMake will write a configuration file for you to ship with the binaries. Your users can then load that config file in their CMake project (using find_package
) and will be able to link to your binaries with a minimum of effort (usually a simple target_link_libraries
call does the job).
This approach is to be preferred over the classic find_library
approach, which potentially requires a lot more steps on the user's side to get things up and running.
As for your troubles regarding learning CMake: I feel your pain. CMake is not particularly easy to learn by nature. On top of that a lot of the documentation available on the web is severely outdated. I'd recommend starting with the updated CMake reference manual which has been restructured for the upcoming CMake 3.0 release. It's still a lot of content to dig through, so don't expect perfect results too quickly, but it's a good place to start.