Sync build configurations through version control

I use clion-2019.1 on linux to cross build c++ applications and libraries for arm devices. I use cmake with several commandline arguments to specify  a toolchainfile, installation prefixes and build_types. I need different sets and combinations to allow for debugging, profiling and testing. These can be conveniently configured in clion through "File" -> "Settings" -> "Build, Execution, Deployment" -> "CMake". Here I can add profiles, that solve my need. Yet I did not find a way to share this with my colleagues resulting in non uniform methods for debugging, profiling and testing across my team.

We use Git as a version control system.  I would like to add the required config files for the IDE to our repository, such that a fresh clone of the repository results in a working clion interface including our synchronised profiles. I consider the profiles as project specific settings in contrast to (for example) the color scheme used in the IDE by different team mates. These personal settings must not be synced.

In my effort to get this working I started a CPP executable project from the clion ide, and added one custom profile form the above described menu. I noticed that the .idea/workspace.xml actually contains that profile definition. So I added this file to version control (among the other files from that directory (vcs.xml, modules.xml, misc.xml *.iml). A fresh checkout results in an idea with the extra profiles selectable, but running a build results in an error claiming the build directory does not exist. This is just slightly annoying (as I could not find a way to have the IDE automatically created the specified "generation path") to do this manually. I guess a prebuild step may be able to solve this, but for testing purposes I create the "generation path" myself. Trying a rebuild that fails in cmake not being able to load cache..

Now I wonder what files are required to get the profiles synced amongst my co-workers. Without including any produced or intermediate required files into my code repository. As to me it does not make sense to include any files from the "generation path" let alone the path itself in version control, I consider these generated output.

As a sidenote. The CMakeList.txt is all that is required to get this working properly without the IDE.

Thanks for any ideas

1

Please sign in to leave a comment.