Cmake Settings not loaded from project iml file
Answered
It appears that the project.iml file in the .idea folder is supposed to be settings that can be source controlled for multiple users. However, if I enter in th e CMakeSettings block, it won't use it when CLion loads. It appears that CMakeSettings are only used from the workspace.xml file which contains all user specific saved data. I would like to know how to save these CMake build settings in the project.iml so that all users get the same settings and don't have to set them up manually each time either after an initial clone of the repo or after a purge.
Please sign in to leave a comment.
Hi, Dean!
What CMake settings do you mean? File | Settings | Build, Execution, Deployment | CMake?
Correct. As there are Profiles that are project specific with a decent amount of changes from the default settings, I would like to be able to source control these for all users.
According to the web help article,
*.imlfile that describes the project structure.workspace.xmlfile that contains your workspace preferences.CMake profile contains settings which are related to your workspace ("generation path", for example), that's why CMake profiles are stored in workspace.xml.
But the CMake settings are not always a preference. In our case, the toolchain and variables we pass it are tied to the project structure. We don't want people to normally be setting their preferences here as it is development for an embedded project.
Yes, but in general CMake profile may contain some user specific data, so it seems incorrect to write these settings into *.iml by default. Sorry for the inconvenience. Your problem should be resolved when the (per-project) defaults for CMake settings will be implemented: https://youtrack.jetbrains.com/issue/CPP-1887. Feel free to follow or upvote.
Thanks for a link. For now I will follow our plan B which will be to create a shell script that will default the Workspace.xml file if it is the first time the repo is cloned or it gets purged. Not ideal, but it will work until there is a better solution.
Dean, I've just found another related issue: https://youtrack.jetbrains.com/issue/CPP-7911. Please follow this one too.