0

In our project we are using some external libraries and using CMake to generate VS projects for build them. All libs exports cmake variables to configure them(include\exclude project, build as static\shared lib). I want to share my CMakeCache.txt files with my teammates so that we have the same configuration for that libs.

Of course, I can't simply share my cache file because the are some absolute paths defined in it and it can't be reused on other machine. I understand, that cache files is not intended to be a sharable file. But what can I do except of including theese external lib projects to my cmake project and setting exported varibles there?

Thanks a lot!

  • Possible duplicate of [How to re-use existing CMake variables with new generator](https://stackoverflow.com/questions/43083194/how-to-re-use-existing-cmake-variables-with-new-generator). Reduce the cache to entries that you can share. – Florian Aug 30 '17 at 13:31
  • I think that reducing cache entries can help only for first-time generating, because after it cache will be updated with all reduced entries. So that solution doesn't work for regular exchange. Your solution with "grep" proposed in referenced question still involves a lot of manual work at one side and can be really tricky if there are no so obvious prefixes for variables that I want share. Maybe, in my case it will be better to create "canonical" cache file and share it insted of CMakeCache.txt. – Vladimir Aug 30 '17 at 13:55
  • 2
    Then see [CMake preload script for cache](https://stackoverflow.com/questions/17597673/cmake-preload-script-for-cache) – Florian Aug 30 '17 at 14:15
  • Possible duplicate of [CMake preload script for cache](https://stackoverflow.com/questions/17597673/cmake-preload-script-for-cache) – usr1234567 Aug 31 '17 at 05:21

0 Answers0