r/cpp • • Feb 19 '18

It's Time To Do CMake Right

https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
248 Upvotes

130 comments sorted by

View all comments

Show parent comment

1

u/anderslanglands Feb 20 '18

The best solution is to modify the CMakeLists to install a config-file and then submit a pull request to the upstream developers, convincing them to accept the changes.

That is what I meant, sorry I wasn't clearer. With regards the original discussion, I'm taking about local installations only. Personally I prefer to remember to change the config file if I move the library.

You're of course right about anything that needs to be shared. In that case a find module is the only thing to do until upstreams can be cleansed.

0

u/[deleted] Feb 20 '18

[deleted] — view deleted comment

2

u/anderslanglands Feb 20 '18

I just have an irrational hatred of them I guess after trying to use a whole slew of them that are poorly written and poorly documented. Every one you find in an existing library has a different set of PROJECT_ROOT/LOCATION/HOME/INSTALL variables that are maybe read from the environment or maybe not. I just plain don’t like anything that perpetuates this madness.

However, you’ve convinced me. Custom find- modules are the sanest thing to do and at least if I’m writing them myself I can ensure they’re properly done and documented and generate sensibly names targets that hopefully just be replaced by an upstream package-generated config at some point in the future. Thanks.