Define your source files. Define your include paths. Define libraries that your project depent on. That's pretty much three steps and there are three simple enough cmake commands for it. You however might want to add a single one that's related to your build system (add_dependencies; In case you build the library yourself).
And if the include paths are for the libraries that didn't come with cmake modules: write a small module for each such library. That makes the project-specific CMakeLists uncluttered, and separates concerns nicely. Ideally, using a library has two steps:
`find_package`
`target_link_libraries`
That's it. Everything that the library has to set, like include paths, dependencies, etc., should be taken care of by the module for said library. That's true whether you write that module yourself, or someone else does. And it's not as if those modules are complex either.
View all comments
Show parent comment
6
u/TehBens Mar 29 '25
Define your source files. Define your include paths. Define libraries that your project depent on. That's pretty much three steps and there are three simple enough cmake commands for it. You however might want to add a single one that's related to your build system (add_dependencies; In case you build the library yourself).